Class AbstractJ2DRenderer

    • Constructor Detail

      • AbstractJ2DRenderer

        public AbstractJ2DRenderer()
    • Method Detail

      • prepareAndExecuteDraw

        public final void prepareAndExecuteDraw​(DrawableCombiner dc,
                                                Primitive primitive,
                                                java.lang.Object obj,
                                                ViewportJ2D vp)
        Prepares the object for rendering to a Java2D viewport
        Specified by:
        prepareAndExecuteDraw in interface IJ2DRenderer
        Parameters:
        dc - the DrawableCombiner drawing the object
        primitive - the primitive being drawn
        obj - the object being drawn
        vp - the viewport
      • setupDCMatrix

        public static final boolean setupDCMatrix​(DrawableCombiner dc,
                                                  java.lang.Object obj,
                                                  boolean enablePos,
                                                  boolean enableSize,
                                                  boolean enableRot,
                                                  ViewportJ2D vp)
        Sets the basic matrix for the combiner, call can be skipped if alternative draw method is required.
        Parameters:
        obj - object being drawn
        g - the viewport context
        enablePos - enables position setup
        enableSize - enables size setup
        enableRot - enables rotation setup
      • setupMatrix

        protected boolean setupMatrix​(DrawableCombiner dc,
                                      Primitive primitive,
                                      java.lang.Object obj,
                                      java.awt.Graphics2D g,
                                      IViewport vp)
        Sets up the transformation matrix before drawing.
        Parameters:
        obj - object being drawn
        g - graphics context
        Returns:
        true, if the setup was successful
      • draw

        public abstract void draw​(DrawableCombiner dc,
                                  Primitive primitive,
                                  java.lang.Object obj,
                                  ViewportJ2D vp)
        Draws the primitive.
        Specified by:
        draw in interface IJ2DRenderer
        Parameters:
        dc - the DrawableCombiner drawing the object
        primitive - the primitive being drawn
        obj - the object being drawn
        vp - the viewport