Class GraphicScene

  • All Implemented Interfaces:
    chemaxon.marvin.util.CallbackIface, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, javax.media.opengl.GLEventListener

    @PublicAPI
    public class GraphicScene
    extends JPanel
    implements javax.media.opengl.GLEventListener, chemaxon.marvin.util.CallbackIface
    GraphicScene is the main "entry point" to MarvinSpace. It is the top level class of the visualization class hierarchy. It extends JPanel to be able to use it as a swing component, and represents a hardware accelerated OpenGL2 context called canvas.
    GraphicScene (scene) consits of cells, represented by the GraphicCell class. By default the entire scene is one cell. Cells visualize GraphicComponents (components) associtated to them. Visualization settings are primarily passed to the scene namely camera view, projection, rotation, zooming, etc. Component specific settings are passed to each individual component by the cells.
    Breif overview of main functions:
    • content & layout: The size of the OpenGL2 canvas; size, number and orientaion of cells.
    • component management: Adding new components, removing existing components.
    • event handling: Delivering events to graphics objects by group: scene events, cell events and component events are distinguished.
    • active cell, selected components: Restricting settings to specific parts of the scene.
    • location & selection of components
    • viewing transformations
    • remdering: Drawing visible components
    Example of typical usage:
     GraphicScene graphicScene = new GraphicScene( rowCount, columnCount );
     graphicScene.setSize(600, 600);
     this.getContentPane().add(graphicScene);
     this.show();
    
     graphicScene.getEventHandler().readMolecule(moleculeFile.pdb);
     graphicScene.processEvent("Protein.DrawType", "Stick");
     graphicScene.processEvent( "Ligand.DrawType", "Spacefill");
     graphicScene.processEvent( "Quality", "High");
     
    Since:
    Marvin 4.0.2
    See Also:
    Serialized Form
    • Constructor Detail

      • GraphicScene

        public GraphicScene()
                     throws Exception
        Creates a hardware accelerated and double buffered GraphicScene. It has one cell.
        Throws:
        Exception
      • GraphicScene

        public GraphicScene​(int rowCount,
                            int columnCount)
                     throws Exception
        Creates a hardware accelerated and double buffered GraphicScene. It will have the given number of rows and columns, that is rowCount * columnCount cells.
        Parameters:
        rowCount - number of rows of cells
        columnCount - number of columns of cells
        Throws:
        Exception
    • Method Detail

      • printProperties

        public static void printProperties()
      • setProgressBar

        public void setProgressBar​(chemaxon.marvin.space.gui.JMSpaceProgressBar progressBar)
      • isVerbose

        public boolean isVerbose()
        Gets the verbose level. The level of verboseness will not be returned. See also getVerboseLevel().
        Returns:
        verbose is enabled or not
      • setVerbose

        public void setVerbose​(boolean flag)
        Sets the verbose level on/off. The level of verboseness will be basic. See also setVerbose(int level).
      • setDropTarget

        public void setDropTarget​(DropTargetListener dl)
        Sets the DropTarget of the graphic canvas.
        Parameters:
        dl -
      • processAwtEvent

        public void processAwtEvent​(AWTEvent evt,
                                    String evtID,
                                    String evtValue)
        The given awt event will go to the queue of events, and will be performed during the next draw.
        Parameters:
        evt - AWTEvent to process
        evtID - identifier of the event
        evtValue - value of the event or empty String
      • processEvent

        public void processEvent​(String evtID,
                                 String evtValue)
        The given event will go to the queue of events, and will be performed during the next draw. These can be specific options, or draw properties with entire scene as range.
        Parameters:
        evtID - identifier of the event
        evtValue - value of the event
      • processCellEvent

        public void processCellEvent​(String evtID,
                                     String evtValue)
        The given event will go to the queue of events, and will be performed during the next draw. These draw properties will have effect only in the active cell.
        Parameters:
        evtID - identifier of the event
        evtValue - value of the event
      • processComponentEvent

        public void processComponentEvent​(Object component,
                                          String evtID,
                                          String evtValue)
        The given event will go to the queue of events, and will be performed during the next draw. These draw properties will have effect only on the given object. These events are mainly coming from the selection panel.
        Parameters:
        component - range of event
        evtID - identifier of the event
        evtValue - value of the event
      • getEventHandler

        public chemaxon.marvin.space.MSpaceEventHandler getEventHandler()
        Returns the event handler of the scene.
        Returns:
        handler that processes events being in the queue
      • setMotionMode

        public void setMotionMode​(int mode)
        Notifies every cell of moving and standing modes. This is useful when a component uses a time consuming computation that can be delayed to the non-interactive mode.
        Parameters:
        mode - see MODE_MOVING, MODE_STANDING
      • setSynchronousMode

        public void setSynchronousMode​(boolean state)
        Sets handling of cells to synchronous/asynchronous. Cell events will be passed based on this, i.e in synchronous mode every cell will get the cell-range events and only the active cell will get it in asynchronous mode.
        Parameters:
        state - synchronous mode is enabled or not
      • measureFrameRate

        public void measureFrameRate()
        Measures frame rate of drawing. It is required for auto-scaled rendering quality. We use frame rate instead of FPS, because frame rate is linear while FPS is not.
      • getViewportWidth

        public int getViewportWidth()
        Returns the phisical width of the viewport.
        Returns:
        width in pixels
      • getViewportHeight

        public int getViewportHeight()
        Returns the phisical height of the viewport.
        Returns:
        height in pixels
      • setSceneSize

        public void setSceneSize​(int rowCount,
                                 int columnCount)
                          throws Exception
        Sets the number of rows and columns.
        Parameters:
        rowCount - number of rows, must be greater than 0
        columnCount - number of columns, must be greater than 0
        Throws:
        Exception - on initialization failure
      • createNewCell

        public void createNewCell()
                           throws Exception
        Sets an empty cell to be the active cell. Adds new row or column if necessary.
        Throws:
        Exception
      • setBounds

        public void setBounds​(int x,
                              int y,
                              int width,
                              int height)
        Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height.
        Overrides:
        setBounds in class Component
        Parameters:
        x - the new x-coordinate of this component
        y - the new y-coordinate of this component
        width - the new width of this component
        height - the new height of this component
      • setSize

        public void setSize​(int sizex,
                            int sizey)
        Sets the physical size of the scene.
        Overrides:
        setSize in class Component
        Parameters:
        sizex - width in pixels
        sizey - height in pixels
      • setNearEdgeTolerance

        public void setNearEdgeTolerance​(int tolerance)
        Sets a border near the boundary of the cells in which mouse handling can work other way.
        Parameters:
        tolerance - in pixels
      • getCellTop

        public int getCellTop()
        Returns the y coordinate of the top of the active cell.
        Returns:
        greatest y coordinate in pixels
      • getCellButtom

        public int getCellButtom()
        Returns the y coordinate of the buttom of the active cell in pixels.
        Returns:
        lowest y coordinate in pixels
      • getCellLeft

        public int getCellLeft()
        Returns the x coordinate of the left edge of the active cell.
        Returns:
        lowest x coordinate in pixels
      • getCellRight

        public int getCellRight()
        Returns the x coordinate of the right edge of the active cell.
        Returns:
        greatest x coordinate in pixels
      • getCellWidth

        public int getCellWidth()
        Returns the width of the cells. Note that cells have uniform size.
        Returns:
        width of cells in pixels
      • getCellHeight

        public int getCellHeight()
        Returns the height of the cells. Note that cells have uniform size.
        Returns:
        heigth of cells in pixels
      • getRowCount

        public int getRowCount()
        Returns the number of rows in the scene.
        Returns:
        number of rows
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns in the scene.
        Returns:
        number of columns
      • getCellCount

        public int getCellCount()
        Returns the number of cells in the scene.
        Returns:
        number of cells
      • getGraphicComponentCount

        public int getGraphicComponentCount()
        Returns the total number of GraphicComponents in the cells.
        Returns:
        summary of components in all cells
      • addComponent

        public boolean addComponent​(GraphicComponent component)
                             throws Exception
        Adds a component to the active or to the first cell. Has the component process the global drawing properties.
        Parameters:
        component - to add
        Returns:
        adding component succeeded or not // * @throws MSpaceException when scene is not properly initialized
        Throws:
        Exception
      • addComponentToEmptyCell

        public boolean addComponentToEmptyCell​(GraphicComponent gc)
                                        throws Exception
        Adds a component to an empty cell. Has the component process the global drawing properties.
        Parameters:
        gc - component to add
        Returns:
        adding component succeeded or not // * @throws MSpaceException when scene is not properly initialized
        Throws:
        Exception
      • addComponent

        public boolean addComponent​(GraphicComponent component,
                                    int cellIndex)
                             throws Exception
        Adds a component to the cell having the given index. Has the component process the global drawing properties.
        Parameters:
        component - to add
        cellIndex - internal index of the cell
        Returns:
        adding component succeeded or not
        Throws:
        Exception
      • addCoordinateSystem

        public chemaxon.marvin.space.CoordinateComponent addCoordinateSystem​(int cellIndex)
                                                                      throws Exception
        Adds a dummy graphic component that represents the coordinate system.
        Parameters:
        cellIndex - internal index of the cell
        Throws:
        Exception
      • removeSelectedComponents

        public void removeSelectedComponents()
        Removes all selected components from the active cell with all related components (connected monitors, surface of a molecule). If a component is partly selected, it will not be deleted.
      • removeUnselectedComponents

        public void removeUnselectedComponents()
        Removes all unselected components from the active cell with all related components (connected monitors, surface of a molecule). If a component is not entirely selected, it will not be deleted.
      • removeUnselectedMonitors

        public void removeUnselectedMonitors()
        Removes all unselected monitor component from the scene.
      • removeAllComponents

        public void removeAllComponents()
        Removes all component from the scene and clears the selection panel.
      • removeAllComponents

        public void removeAllComponents​(Class c)
        Removes all component from the scene and clears the selection panel.
      • removeComponent

        public void removeComponent​(GraphicComponent component)
        Removes a component from the scene.
        Parameters:
        component - to remove
      • removeComponent

        public void removeComponent​(chemaxon.marvin.space.UOID componentId)
        Removes a component from the scene.
        Parameters:
        componentId - identifier of the component to remove
      • containsComponent

        public boolean containsComponent​(GraphicComponent gc)
        Returns true if the component exists in the scene.
        Returns:
        valid component or not
      • setActiveCell

        public void setActiveCell​(int i)
        Sets the ith cell to be the active cell of the scene.
        Parameters:
        i - internal index of the cell
      • deactivateActiveCell

        public void deactivateActiveCell()
        Sets the active cell to be no longer active.
      • getCell

        public GraphicCell getCell​(int cellIndex)
        Returns the GraphicCell which has the given index.
        Parameters:
        cellIndex - internal index of the cell
        Returns:
        the required cell
      • getActiveCellIndex

        public int getActiveCellIndex()
        Returns the index of the active cell.
        Returns:
        internal index
      • getActiveCell

        public GraphicCell getActiveCell()
        Returns the active cell of the scene.
        Returns:
        the cell
      • isActiveCell

        public boolean isActiveCell​(int cellIndex)
        Returns true if the cell having cellIndex is the active cell of the scene.
        Parameters:
        cellIndex - internal index of the cell
        Returns:
        is active or not
      • hasSelectedComponent

        public boolean hasSelectedComponent()
        Returns true if there is at least 1 selected component in the active cell.
        Returns:
        is there any selected component
      • hasSelectedComponentElement

        public boolean hasSelectedComponentElement()
        Returns true if there is at least 1 selected ComponentElement in the active cell.
        Returns:
        is there any selected elements
      • getGraphicComponent

        public GraphicComponent getGraphicComponent​(int componentIndex)
        Returns the GraphicComponent having the given index in the active cell.
        Parameters:
        componentIndex - internal index of the component
        Returns:
        component having given index or null
      • getGraphicComponent

        public GraphicComponent getGraphicComponent​(int cellIndex,
                                                    int componentIndex)
        Returns the GraphicComponent of the given cell.
        Parameters:
        componentIndex - internal index of the component
        cellIndex - internal index of the cell
        Returns:
        component having given index or null
      • getGraphicComponent

        public GraphicComponent getGraphicComponent​(chemaxon.marvin.space.UOID id)
        Returns the GraphicComponent with the given id.
      • hideSelectedComponents

        public void hideSelectedComponents()
        Hides all selected components from the active cell with all related components (connected monitors, surface of a molecule). If a component is partly selected, it will not be hidden.
      • hideUnselectedComponents

        public void hideUnselectedComponents()
        Hides all unselected components from the active cell with all related components (connected monitors, surface of a molecule). If a component is not entirely selected, it will not be hidden.
      • fadeSelectedComponents

        public void fadeSelectedComponents()
        Sets the drawing mode of all selected elements to faded so it will be hardly visible, and prevents them from clicking. Note that each decendants of GraphicComponent should implement this behaviour to take affect.
      • fadeUnselectedComponents

        public void fadeUnselectedComponents()
        Sets the drawing mode of all unselected elements to faded so it will be hardly visible, and prevents them from clicking. Note that each decendants of GraphicComponent should implement this behaviour to take affect.
      • showAllComponents

        public void showAllComponents()
        Sets all invisible component of the active cell to visible.
      • showFaded

        public void showFaded()
        Sets the drawing mode of all faded elements back to the original drawing mode. Note that each decendants of GraphicComponent should implement this behaviour to take affect.
      • hideAllMonitors

        public void hideAllMonitors()
        Sets all monitor component of the active cell to invisible.
      • showAllMonitors

        public void showAllMonitors()
        Sets all monitor component of the active cell to visible.
      • showAllComponents

        public void showAllComponents​(Class c)
        Sets all components of the given class in the active cell to be visible.
      • hideAllComponents

        public void hideAllComponents​(Class c)
        Sets all components of the given class in the active cell to be invisible.
      • getDrawProperty

        public String getDrawProperty​(String name)
        Returns the draw property of the scene or null if the property is not defined.
        Parameters:
        name - identifier of the property
        Returns:
        value of the property as String
      • getCellDrawProperty

        public String getCellDrawProperty​(String name)
        Returns the draw property from the active cell or null if there is no active cell or the property is not defined in the active cell.
        Parameters:
        name - the name of the draw property
        Returns:
        value of the property as String
      • getCellDrawProperty

        public String getCellDrawProperty​(int cellIdx,
                                          String name)
        Returns the draw property from the given cell or null if not defined.
        Parameters:
        cellIdx - internal index of the cell.
        name - the name of the draw property
      • setCellDrawProperty

        public void setCellDrawProperty​(int cellIndex,
                                        String propertyName,
                                        String propertyValue)
                                 throws Exception
        Sets the given draw property to the given cell.
        Parameters:
        cellIndex - internal index of the cell.
        propertyName - the name of the draw property
        propertyValue - the value of the property
        Throws:
        Exception
      • setDrawProperty

        public void setDrawProperty​(Properties properties)
                             throws Exception
        Sets the given draw properties to the entire scene.
        Parameters:
        properties - set of draw properties
        Throws:
        Exception
      • setDrawProperty

        public void setDrawProperty​(String propertyName,
                                    String propertyValue)
                             throws Exception
        Sets the draw property for all cells. These properties are stored in this class in order to pass them to newly created cells.
        Throws:
        Exception
      • setDrawProperty

        public void setDrawProperty​(String propertyName,
                                    String propertyValue,
                                    int range)
                             throws Exception
        Sets the draw property either to the entire scene or to the active cell.
        Parameters:
        propertyName - the name of the draw property
        propertyValue - the value of the property
        range - SCENE_RANGE, CELL_RANGE
        Throws:
        Exception
      • resetSettings

        public void resetSettings()
                           throws Exception
        Sets all draw properties to the default value and resets view.
        Throws:
        Exception
      • resetView

        public void resetView()
        Resets view settings of the active cell including rotation, zoom and shifting. Takes effect at the next redraw because of threading issues.
      • resetAll

        public void resetAll()
        Resets view settings of all cells including rotation, zoom and shifting. Takes effect at the next redraw because of threading issues.
      • setAntialias

        public void setAntialias​(boolean state)
        Enables/disables full scene anti-aliasing.
        Parameters:
        state - the required state of anti-aliasing
      • isAntialiasEnabled

        public boolean isAntialiasEnabled()
        Returns true if full-screen antialias is enabled. Note, that on mouse drag event antialias is/should be automatically disabled.
        Returns:
        state of anti/aliasing
      • getBackgroundColor

        public Color getBackgroundColor()
        Returns the background color of the scene.
        Returns:
        color as java.awt.Color
      • getBackgroundColorF

        public float[] getBackgroundColorF()
      • setBackgroundColor

        public void setBackgroundColor​(Color newColor)
        Sets the background color of the scene and an alpha value of 0 (transparent background).
        Parameters:
        newColor - color as java.awt.Color
      • setBackgroundColor

        public void setBackgroundColor​(float[] newColor)
      • isTransparentBackgroundEnabled

        public boolean isTransparentBackgroundEnabled()
        Returns true if the background is transparent. Note the alpha value of the background color can be 0 or 1 that means totally opaque or totally transparent.
        Returns:
        the background color is totally transparent or totally opaque
      • setTransparentBackground

        public void setTransparentBackground​(boolean b)
        Enables/disables transparent background color. The difference cannot be seen on the canvas, but it is an important property of saving images.
        Parameters:
        b -
      • isSmoothBackgroundEnabled

        public boolean isSmoothBackgroundEnabled()
        Returns true if the background is enabled to be smooth, so that it does not have a homogenous color.
        Returns:
        the background is homogenous or shaded
      • setSmoothBackground

        public void setSmoothBackground​(boolean b)
        Enables/disables shaded background.
        Parameters:
        b -
      • reshape

        public void reshape​(javax.media.opengl.GLAutoDrawable glAutoDrawable,
                            int x,
                            int y,
                            int width,
                            int height)
        Called by the drawable during the first repaint after the component has been resized. The client can update the viewport and view volume of the window appropriately, for example by a call to GL2.glViewport(int, int, int, int);. Note that for convenience the component has already called GL2.glViewport(int, int, int, int)(x, y, width, height) when this method is called, so the client may not have to do anything in this method.
        Specified by:
        reshape in interface javax.media.opengl.GLEventListener
        Parameters:
        glAutoDrawable - The GLDrawable object.
        x - The X Coordinate of the viewport rectangle.
        y - The Y coordinate of the viewport rectangle.
        width - The new width of the window.
        height - The new height of the window.
      • displayChanged

        public void displayChanged​(javax.media.opengl.GLAutoDrawable glAutoDrawable,
                                   boolean b,
                                   boolean b1)
                            throws Exception
        Called by the system.
        Throws:
        Exception
      • isGLInitialized

        public boolean isGLInitialized()
        Returns true if the OpenGL2 canvas is already initialized. It is to prevent too early gl-related calls such as setSceneSize in applets.
      • getGL

        public javax.media.opengl.GL2 getGL()
        Returns the OpenGL2 interface.
      • getGLAutoDrawable

        public javax.media.opengl.GLAutoDrawable getGLAutoDrawable()
        Returns the GLAutoDrawable object.
      • getGLCanvas

        public Component getGLCanvas()
        Returns the GL2 canvas.
      • getGLInfo

        public String getGLInfo​(boolean extended)
        Returns the OpenGL2 Renderer, Version, and Vendor and Extensions in VERBOSE_LEVEL_DEVEL mode.
        Parameters:
        extended - the available extensions are to returned or not
        Returns:
        info as String
      • addListToDelete

        public void addListToDelete​(int list)
        Adds a gl list id to the deletion list
        Parameters:
        list - gl list id
      • init

        public void init​(javax.media.opengl.GLAutoDrawable glAutoDrawable)
        Called by the drawable immediately after the OpenGL2 context is initialized for the first time. Can be used to perform one-time OpenGL2 initialization such as setup of lights and display lists.
        Specified by:
        init in interface javax.media.opengl.GLEventListener
        Parameters:
        glAutoDrawable - The GLAutoDrawable object.
      • display

        public void display​(javax.media.opengl.GLAutoDrawable glAutoDrawable)
        Warning: this function should not be called directly, use refresh() or redraw() instead. Draws every cell of the scene. The result depends on the cells. Called by the drawable to initiate OpenGL2 rendering by the client. After all GLEventListeners have been notified of a display event, the drawable will swap its buffers if necessary.
        Specified by:
        display in interface javax.media.opengl.GLEventListener
        Parameters:
        glAutoDrawable - The GLAutoDrawable object.
      • refresh

        public void refresh()
      • redraw

        public void redraw()
        Redraws the entire scene.
      • getBufferedImage

        public BufferedImage getBufferedImage()
        Returns the Canvas as a BufferedImage with the same size in pixels. Can be saved as a picture.
      • createImage

        public int createImage​(Buffer buf,
                               int imageWidth,
                               int imageHeight)
      • activateContainerCell

        public void activateContainerCell​(GraphicComponent component)
        The containing cell of the GraphicComponent will be the active cell of the scene.
      • locateObject

        public chemaxon.marvin.space.UOID locateObject​(int x,
                                                       int y)
        Returns the identifire of the object under x,y position. Returns a cell id if location is not in the active cell.
        Parameters:
        x - coordinate in pixels
        y - coordinate in pixels
      • locateObject

        public chemaxon.marvin.space.UOID locateObject​(int x,
                                                       int y,
                                                       Class componentClass)
        Returns the identifire of the given class object under x,y position. Returns a cell id if location is not in the active cell.
        Parameters:
        x - coordinate in pixels
        y - coordinate in pixels
        componentClass - components of other classes will be ignored in location
        Since:
        Marvin 4.0.3
      • locateCellId

        public chemaxon.marvin.space.UOID locateCellId​(int x,
                                                       int y)
        Returns the id of the cell under x, y position.
        Parameters:
        x - coordinate in pixels
        y - coordinate in pixels
      • locateCell

        public int locateCell​(int x,
                              int y)
        Returns the internal index of the cell under x,y position.
        Parameters:
        x - window coordinate
        y - window coordinate
      • getControllableObject

        public GraphicComponent getControllableObject​(String type)
        Returns a selected component from the active cell what can be controlled by the given tye controller.
        Parameters:
        type - identifier of the type of the controller, "Shift", "Rotate", "Resize"
        Returns:
        controllable component or null
      • locationNearEdgeX

        public boolean locationNearEdgeX​(int x,
                                         int y)
        Tells whether the given location is near the vertical edges of any cell.
        Parameters:
        x - horizontal mouse location in absolute window coordinate
        y - vertical mouse location in absolute window coordinate
        Returns:
        result of location
      • locationNearEdgeY

        public boolean locationNearEdgeY​(int x,
                                         int y)
        Tells whether the given location is near the horizontal edges of any cell.
        Parameters:
        x - horizontal mouse location in absolute window coordinate
        y - vertical mouse location in absolute window coordinate
        Returns:
        result of location
      • locationNearEdge

        public boolean locationNearEdge​(int x,
                                        int y)
        Tells whether the given location is near to any edges of any cell.
        Parameters:
        x - horizontal mouse location in absolute window coordinate
        y - vertical mouse location in absolute window coordinate
        Returns:
        result of location
      • clearSelection

        public void clearSelection​(int index)
        Sets all components and parts of components to be unselected in the given cell.
        Parameters:
        index - internal index of the cell
      • exclusiveSelection

        public void exclusiveSelection​(chemaxon.marvin.space.UOID id)
        Exclusive selection in the given component in its container cell. The previously picked part of the component will be selected, and all selected components and parts of components will be unselected.
        Parameters:
        id - identifier of the component
      • extendSelection

        public void extendSelection​(chemaxon.marvin.space.UOID id)
        Additive selection in the given component in its container cell. The previously picked part of the component will be selected, and all selection remains as is.
        Parameters:
        id - identifier of the component
      • invertSelection

        public void invertSelection​(chemaxon.marvin.space.UOID id)
        The previously picked part of the component will be selected if it was unselected and vice versa. All other selection remains as is.
        Parameters:
        id - identifier of the component
      • componentBecameSelected

        public boolean componentBecameSelected​(int cellIdx)
        Returns true if a component became selected previously in the given cell. Information from a selection is kept up to this query.
        Parameters:
        cellIdx - internal index of the cell
        Returns:
        flag indicating if selection occurred or not
      • componentBecameUnselected

        public boolean componentBecameUnselected​(int cellIdx)
        Returns true if a component became unselected previously in the given cell. Information from an unselection is kept up to this query.
        Parameters:
        cellIdx - internal index of the cell
        Returns:
        flag indicating if unselection occurred or not
      • getTransformationCenter

        public float[] getTransformationCenter()
        Returns the center of transformation of the active cell or null if there is no active cell.
        Returns:
        coordinates in the model space
      • getShiftX

        public double getShiftX​(int cellIndex)
        Returns corrected shifting value of the given cell.
        Parameters:
        cellIndex -
        Returns:
        x coordinate in world coordinates
      • getShiftY

        public double getShiftY​(int cellIndex)
        Returns corrected shifting value of the given cell.
        Parameters:
        cellIndex -
        Returns:
        y coordinate in world coordinates
      • setTransformationCenter

        public void setTransformationCenter​(chemaxon.marvin.space.UOID id)
        Sets the center of transformation of the active cell to the coordinates of the named component. The actual coordinates are got by the GraphicComponent.getCoordinates(float[]) method
        Parameters:
        id - identifier of the component
      • setTransformationCenter

        public void setTransformationCenter​(float[] c)
        Sets the transformation center explicitly to the given value. It will affect the active cell or all cells in case of synchronous mode.
        Parameters:
        c - exact coordinates to be set
      • zoom

        public void zoom​(double factor)
        Sets the given zoom factor in the active cell or in every cells in case of synchronous mode.
        Parameters:
        factor - zooming factor, usually it is the changing of the mouse coordinates in pixels
      • zoomAnimated

        public void zoomAnimated​(double f,
                                 int n)
        Sets the given zoom factor dividing by n parts. Every part of zoom is followed by a refresh() event.
        Parameters:
        f - zoom factor
        n - number of zoom effects and refreshes
      • rotate

        public void rotate​(double rx,
                           double ry,
                           double rz)
        Sets the given rotation factor in the active cell or in every cells in case of synchronous mode.
        Parameters:
        rx - rotation angle around the x axis
        ry - rotation angle around the y axis
        rz - rotation angle around the z axis
      • rotateTo

        public void rotateTo​(float[] rm)
        Sets the matrix of rotation explicitly in the active cell or in every cells in case of synchronous mode.
        Parameters:
        rm - 4x4 matrix of rotation
      • shift

        public void shift​(double shiftx,
                          double shifty)
        Sets the given shift factor in the active cell or in every cells in case of synchronous mode.
        Parameters:
        shiftx - translation along x axis in window coordinates
        shifty - translation along y axis in window coordinates
      • shiftAnimated

        public void shiftAnimated​(double shiftx,
                                  double shifty,
                                  int n)
        Sets the given shift factor dividing by n parts. Every part of shift is followed by a refresh() event.
        Parameters:
        shiftx - translation along x axis in window coordinates
        shifty - translation along y axis in window coordinates
        n - number of shift effects and refreshes
      • dispose

        public void dispose​(javax.media.opengl.GLAutoDrawable glad)
        Specified by:
        dispose in interface javax.media.opengl.GLEventListener
      • callback

        public Object callback​(String eventID,
                               Object value)
        Specified by:
        callback in interface chemaxon.marvin.util.CallbackIface