Class Graphics2DRenderer

    • Constructor Detail

      • Graphics2DRenderer

        public Graphics2DRenderer()
    • Method Detail

      • init

        public Graphics2DRenderer init​(Graphics2D graphics)
        Initializes this instance. During renderering the current transformation will be leaved unchanged. But the current Clip may be cleared.
        Parameters:
        graphics - Graphics2D context into which the BaiscGraphicalElements are painted.
        Returns:
        this instance.
      • startRendering

        public void startRendering​(GraphicalComposite composite)
        Starts rendering of the specified composite. Does nothing except if composite has a ClippingShape. In this case the Clip of the Graphics2D context becomes the clipping rectangle determined by the bounding box of the ClippingShape.
        Specified by:
        startRendering in interface GraphicalCompositeRenderer
      • render

        public void render​(Polygon polygon)
        Paints the specified polygon into the Graphics2D context.
        Specified by:
        render in interface PolygonRenderer
      • render

        public void render​(Rectangle rectangle)
        Paints the specified rectangle into the current Graphics context.
        Specified by:
        render in interface RectangleRenderer
      • render

        public void render​(Oval oval)
        Paints the specified oval into the current Graphics context.
        Specified by:
        render in interface OvalRenderer
      • render

        public void render​(Text text)
        Paints the specified text into the current Graphics context.

        If the font size is zero the default font size will be used.

        If the orientation angle is unequal zero the text will first be painted into an off-screen image and rotated. Finally, it will be drawn into the current Graphics context. Note, that only integer multiples of 90 degree rotation are performed. Other orientation angles will be adjusted to the nearest integer multiple of 90 degree.

        Specified by:
        render in interface TextRenderer