Interface IRenderer<T extends IChemObject>

    • Method Detail

      • generateDiagram

        IRenderingElement generateDiagram​(T obj)
        Internal method to generate the intermediate format.
        Parameters:
        obj - the IChemObject to generate a diagram for
        Returns:
        a tree of rendering elements
      • getRenderer2DModel

        RendererModel getRenderer2DModel()
        Returns the drawing model, giving access to drawing parameters.
        Returns:
        the rendering model
      • toModelCoordinates

        javax.vecmath.Point2d toModelCoordinates​(double screenXTo,
                                                 double screenYTo)
        Converts screen coordinates into model (or world) coordinates.
        Parameters:
        screenXTo - the screen's x coordinate
        screenYTo - the screen's y coordinate
        Returns:
        the matching model coordinates
        See Also:
        toScreenCoordinates(double, double)
      • toScreenCoordinates

        javax.vecmath.Point2d toScreenCoordinates​(double screenXTo,
                                                  double screenYTo)
        Converts model (or world) coordinates into screen coordinates.
        Parameters:
        screenXTo - the model's x coordinate
        screenYTo - the model's y coordinate
        Returns:
        the matching screen coordinates
        See Also:
        toModelCoordinates(double, double)
      • setZoom

        void setZoom​(double zoomFactor)
        Set a new zoom factor.
        Parameters:
        zoomFactor - the new zoom factor
      • shiftDrawCenter

        void shiftDrawCenter​(double screenX,
                             double screenY)
        Set a new drawing center in screen coordinates.
        Parameters:
        screenX - the x screen coordinate of the drawing center
        screenY - the y screen coordinate of the drawing center
      • paint

        Rectangle paint​(T object,
                        IDrawVisitor drawVisitor)
        Paint an IChemObject.
        Parameters:
        object - the chem object to paint
        drawVisitor - the class that visits the generated elements
        Returns:
        the rectangular area where was drawn
      • paint

        void paint​(T object,
                   IDrawVisitor drawVisitor,
                   Rectangle2D bounds,
                   boolean resetCenter)
        Paint the chem object within the specified bounds.
        Parameters:
        object - Object to draw
        drawVisitor - the visitor to draw to
        bounds - the screen bounds between which to draw
        resetCenter - a boolean indicating the the drawing center needs to be reset
      • setScale

        void setScale​(T object)
        Set the scale for an IChemObject. It calculates the average bond length of the model and calculates the multiplication factor to transform this to the bond length that is set in the RendererModel.
        Parameters:
        object - the IChemObject to draw.
      • calculateDiagramBounds

        Rectangle calculateDiagramBounds​(T object)
        Given a IChemObject, calculates the bounding rectangle in screen space.
        Parameters:
        object - the IChemObject to draw.
        Returns:
        a rectangle in screen space.
      • getGenerators

        List<IGenerator<T>> getGenerators()
        Returns a List of IGenerators for this renderer.
        Returns:
        the list of generators for this renderer.