Interface GeneiousGraphics2D


  • public interface GeneiousGraphics2D
    Provides some (but not all) of the functionality of Graphics2D, but also provides some extra useful methods The primary reason for the existence of this interface is so that SequenceGraphs can be rendered as a circular view in the SequenceViewer correctly. (we can't just use a standard AffineTransform as a circular view can not be obtained from an AffineTransform)

    Despite this being interface, plug-ins should not implement this interface themselves or they risk breaking when Geneious adds and implements additional functionality in future versions.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void drawLine​(int x1, int y1, int x2, int y2)
      See Graphics.drawLine(int, int, int, int)
      void drawOval​(int x1, int y1, int width, int height)
      See Graphics.drawOval(int, int, int, int)
      void drawPolygon​(java.awt.Polygon polygon)
      See Graphics.drawPolygon(java.awt.Polygon).
      void drawPolyLine​(int[] x, int[] y, int nPoints)
      See Graphics.drawPolyline(int[], int[], int)
      void drawRect​(int x1, int y1, int width, int height)
      See Graphics.drawRect(int, int, int, int)
      void drawRoundRect​(int x, int y, int width, int height, int arcWidth, int arcHeight)
      See Graphics.drawRoundRect(int, int, int, int, int, int)
      void drawString​(java.lang.String text, int x, int y)
      See Graphics2D.drawString(String, int, int).
      void drawStringCentred​(java.lang.String text, int centreX, int centreY)
      Just like Graphics2D.drawString(String,int,int) except that the text is centred at centreX , centreY
      void drawStringWithinBounds​(java.lang.String text, int x, int y, int width, int height, boolean rotate)
      draws the given text squashed or stretched into the given dimensions at the given location
      void fillOval​(int x1, int y1, int width, int height)
      See Graphics.fillOval(int, int, int, int)
      void fillPolygon​(java.awt.Polygon polygon)
      See Graphics.fillPolygon(java.awt.Polygon)
      void fillRect​(int x1, int y1, int width, int height)
      See Graphics.fillRect(int, int, int, int)
      void fillRoundRect​(int x, int y, int width, int height, int arcWidth, int arcHeight)
      See Graphics.fillRoundRect(int, int, int, int, int, int)
      java.awt.Color getColor()
      See Graphics.getColor()
      java.awt.Composite getComposite()  
      java.awt.Font getFont()
      See Graphics.getFont()
      java.awt.Graphics2D getGraphicsIfFlat()  
      java.awt.Paint getPaint()
      See Graphics2D.getPaint()
      java.awt.Graphics2D getRealGraphics()  
      java.lang.Object getRenderingHint​(java.awt.RenderingHints.Key hintKey)
      See Graphics2D.getRenderingHint(java.awt.RenderingHints.Key).
      java.awt.Stroke getStroke()
      See Graphics2D.getStroke()
      void setColor​(java.awt.Color color)
      See Graphics.setColor(java.awt.Color)
      void setComposite​(java.awt.Composite comp)  
      void setFont​(java.awt.Font font)
      See Graphics.setFont(java.awt.Font)
      void setPaint​(java.awt.Paint stroke)
      See Graphics2D.setPaint(java.awt.Paint)
      void setRenderingHint​(java.awt.RenderingHints.Key hintKey, java.lang.Object hintValue)
      See Graphics2D.setRenderingHint(java.awt.RenderingHints.Key, Object).
      void setStroke​(java.awt.Stroke stroke)
      See Graphics2D.setStroke(java.awt.Stroke)
    • Method Detail

      • getGraphicsIfFlat

        java.awt.Graphics2D getGraphicsIfFlat()
        Returns:
        get wrapped Graphics2D if this GeneiousGraphics2D is for a flat (non-circular) view or null for a non-linear (circular) view. This is useful for performing more advanced graphics tweaks that you wouldn't normally show on a linear view.
        Since:
        API 4.61 (Geneious 5.6.1)
      • getRealGraphics

        java.awt.Graphics2D getRealGraphics()
        Returns:
        get wrapped Graphics2D. This is useful for performing more advanced graphics tweaks such as setting anti-aliasing.
        Since:
        API 4.910 (Geneious 9.1.0)
      • drawPolygon

        void drawPolygon​(java.awt.Polygon polygon)
        See Graphics.drawPolygon(java.awt.Polygon).
      • setRenderingHint

        void setRenderingHint​(java.awt.RenderingHints.Key hintKey,
                              java.lang.Object hintValue)
        See Graphics2D.setRenderingHint(java.awt.RenderingHints.Key, Object).
      • getRenderingHint

        java.lang.Object getRenderingHint​(java.awt.RenderingHints.Key hintKey)
        See Graphics2D.getRenderingHint(java.awt.RenderingHints.Key).
      • setComposite

        void setComposite​(java.awt.Composite comp)
        See Also:
        Graphics2D.setComposite(java.awt.Composite)
      • getComposite

        java.awt.Composite getComposite()
        See Also:
        Graphics2D.getComposite()
      • fillPolygon

        void fillPolygon​(java.awt.Polygon polygon)
        See Graphics.fillPolygon(java.awt.Polygon)
      • setColor

        void setColor​(java.awt.Color color)
        See Graphics.setColor(java.awt.Color)
      • setFont

        void setFont​(java.awt.Font font)
        See Graphics.setFont(java.awt.Font)
      • setStroke

        void setStroke​(java.awt.Stroke stroke)
        See Graphics2D.setStroke(java.awt.Stroke)
      • setPaint

        void setPaint​(java.awt.Paint stroke)
        See Graphics2D.setPaint(java.awt.Paint)
      • getColor

        java.awt.Color getColor()
        See Graphics.getColor()
      • getStroke

        java.awt.Stroke getStroke()
        See Graphics2D.getStroke()
      • getPaint

        java.awt.Paint getPaint()
        See Graphics2D.getPaint()
      • getFont

        java.awt.Font getFont()
        See Graphics.getFont()
      • drawString

        void drawString​(java.lang.String text,
                        int x,
                        int y)
        See Graphics2D.drawString(String, int, int).
      • drawStringCentred

        void drawStringCentred​(java.lang.String text,
                               int centreX,
                               int centreY)
        Just like Graphics2D.drawString(String,int,int) except that the text is centred at centreX , centreY
      • drawStringWithinBounds

        void drawStringWithinBounds​(java.lang.String text,
                                    int x,
                                    int y,
                                    int width,
                                    int height,
                                    boolean rotate)
        draws the given text squashed or stretched into the given dimensions at the given location
        Parameters:
        text - the text to render
        x - left corner
        y - top corner
        width - desired width of the squashed text
        height - desired height of the squashed text
        rotate - if true, then rotate by 90 degrees anti clockwise
      • fillRect

        void fillRect​(int x1,
                      int y1,
                      int width,
                      int height)
        See Graphics.fillRect(int, int, int, int)
      • drawRect

        void drawRect​(int x1,
                      int y1,
                      int width,
                      int height)
        See Graphics.drawRect(int, int, int, int)
      • drawLine

        void drawLine​(int x1,
                      int y1,
                      int x2,
                      int y2)
        See Graphics.drawLine(int, int, int, int)
      • drawPolyLine

        void drawPolyLine​(int[] x,
                          int[] y,
                          int nPoints)
        See Graphics.drawPolyline(int[], int[], int)
      • drawRoundRect

        void drawRoundRect​(int x,
                           int y,
                           int width,
                           int height,
                           int arcWidth,
                           int arcHeight)
        See Graphics.drawRoundRect(int, int, int, int, int, int)
      • fillRoundRect

        void fillRoundRect​(int x,
                           int y,
                           int width,
                           int height,
                           int arcWidth,
                           int arcHeight)
        See Graphics.fillRoundRect(int, int, int, int, int, int)
      • fillOval

        void fillOval​(int x1,
                      int y1,
                      int width,
                      int height)
        See Graphics.fillOval(int, int, int, int)
      • drawOval

        void drawOval​(int x1,
                      int y1,
                      int width,
                      int height)
        See Graphics.drawOval(int, int, int, int)