Class DualGraphics2D



  • public class DualGraphics2D
    extends Graphics2D
    This delegates to two underlying Graphics2Ds, so you can send the same drawing instructions to multiple destinations.

    All methods that modify the destination are sent to both Graphics2D objects. All methods that only return properties about the Graphics2D objects talk only to the first Graphics2D object.

    • Method Detail

      • create

        public DualGraphics2D create(Graphics2D[] array)
        Creates a binary tree structure of DualGraphics2Ds so every array receives the same drawing instructions.
        Parameters:
        array - an array of 2 or more Graphics2D objects.
        Returns:
        one Graphics2D to control them all.
      • addRenderingHints

        public void addRenderingHints(Map<?,?> hints)
      • clearRect

        public void clearRect(int x,
                              int y,
                              int width,
                              int height)
      • clip

        public void clip(Shape s)
      • clipRect

        public void clipRect(int x,
                             int y,
                             int width,
                             int height)
      • copyArea

        public void copyArea(int x,
                             int y,
                             int width,
                             int height,
                             int dx,
                             int dy)
      • create

        public Graphics create(int x,
                               int y,
                               int width,
                               int height)
      • dispose

        public void dispose()
      • draw

        public void draw(Shape s)
      • draw3DRect

        public void draw3DRect(int x,
                               int y,
                               int width,
                               int height,
                               boolean raised)
      • drawArc

        public void drawArc(int x,
                            int y,
                            int width,
                            int height,
                            int startAngle,
                            int arcAngle)
      • drawBytes

        public void drawBytes(byte[] data,
                              int offset,
                              int length,
                              int x,
                              int y)
      • drawChars

        public void drawChars(char[] data,
                              int offset,
                              int length,
                              int x,
                              int y)
      • drawGlyphVector

        public void drawGlyphVector(GlyphVector g,
                                    float x,
                                    float y)
      • drawImage

        public boolean drawImage(Image img,
                                 int x,
                                 int y,
                                 ImageObserver observer)
      • drawImage

        public boolean drawImage(Image img,
                                 int x,
                                 int y,
                                 int width,
                                 int height,
                                 Color bgcolor,
                                 ImageObserver observer)
      • drawImage

        public boolean drawImage(Image img,
                                 int x,
                                 int y,
                                 int width,
                                 int height,
                                 ImageObserver observer)
      • drawImage

        public boolean drawImage(Image img,
                                 int dx1,
                                 int dy1,
                                 int dx2,
                                 int dy2,
                                 int sx1,
                                 int sy1,
                                 int sx2,
                                 int sy2,
                                 Color bgcolor,
                                 ImageObserver observer)
      • drawImage

        public boolean drawImage(Image img,
                                 int dx1,
                                 int dy1,
                                 int dx2,
                                 int dy2,
                                 int sx1,
                                 int sy1,
                                 int sx2,
                                 int sy2,
                                 ImageObserver observer)
      • drawLine

        public void drawLine(int x1,
                             int y1,
                             int x2,
                             int y2)
      • drawOval

        public void drawOval(int x,
                             int y,
                             int width,
                             int height)
      • drawPolygon

        public void drawPolygon(int[] points,
                                int[] points2,
                                int points3)
      • drawPolygon

        public void drawPolygon(Polygon p)
      • drawPolyline

        public void drawPolyline(int[] points,
                                 int[] points2,
                                 int points3)
      • drawRect

        public void drawRect(int x,
                             int y,
                             int width,
                             int height)
      • drawRoundRect

        public void drawRoundRect(int x,
                                  int y,
                                  int width,
                                  int height,
                                  int arcWidth,
                                  int arcHeight)
      • drawString

        public void drawString(String s,
                               float x,
                               float y)
      • drawString

        public void drawString(String str,
                               int x,
                               int y)
      • equals

        public boolean equals(Object obj)
      • fill

        public void fill(Shape s)
      • fill3DRect

        public void fill3DRect(int x,
                               int y,
                               int width,
                               int height,
                               boolean raised)
      • fillArc

        public void fillArc(int x,
                            int y,
                            int width,
                            int height,
                            int startAngle,
                            int arcAngle)
      • fillOval

        public void fillOval(int x,
                             int y,
                             int width,
                             int height)
      • fillPolygon

        public void fillPolygon(int[] points,
                                int[] points2,
                                int points3)
      • fillPolygon

        public void fillPolygon(Polygon p)
      • fillRect

        public void fillRect(int x,
                             int y,
                             int width,
                             int height)
      • fillRoundRect

        public void fillRoundRect(int x,
                                  int y,
                                  int width,
                                  int height,
                                  int arcWidth,
                                  int arcHeight)
      • finalize

        public void finalize()
      • getBackground

        public Color getBackground()
      • getClip

        public Shape getClip()
      • getClipBounds

        public Rectangle getClipBounds()
      • getClipRect

        public Rectangle getClipRect()
      • getColor

        public Color getColor()
      • getComposite

        public Composite getComposite()
      • getFont

        public Font getFont()
      • getPaint

        public Paint getPaint()
      • getStroke

        public Stroke getStroke()
      • hashCode

        public int hashCode()
      • hit

        public boolean hit(Rectangle rect,
                           Shape s,
                           boolean onStroke)
      • hitClip

        public boolean hitClip(int x,
                               int y,
                               int width,
                               int height)
      • rotate

        public void rotate(double theta,
                           double x,
                           double y)
      • rotate

        public void rotate(double theta)
      • scale

        public void scale(double sx,
                          double sy)
      • setBackground

        public void setBackground(Color color)
      • setClip

        public void setClip(int x,
                            int y,
                            int width,
                            int height)
      • setClip

        public void setClip(Shape clip)
      • setColor

        public void setColor(Color c)
      • setComposite

        public void setComposite(Composite comp)
      • setFont

        public void setFont(Font font)
      • setPaint

        public void setPaint(Paint paint)
      • setPaintMode

        public void setPaintMode()
      • setRenderingHints

        public void setRenderingHints(Map<?,?> hints)
      • setStroke

        public void setStroke(Stroke s)
      • setXORMode

        public void setXORMode(Color c1)
      • shear

        public void shear(double shx,
                          double shy)
      • toString

        public String toString()
      • translate

        public void translate(double tx,
                              double ty)
      • translate

        public void translate(int x,
                              int y)