Class MultiPosIcon

  • All Implemented Interfaces:
    javax.swing.Icon

    public abstract class MultiPosIcon
    extends java.lang.Object
    implements javax.swing.Icon
    Uncoloured icon suitable for legends representing multi-position plot types. This abstract class generates X,Y positions representing the positions on the icon, and concrete subclasses can do something visually specific with them.
    Since:
    28 Nov 2013
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiPosIcon​(int npos)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int getIconHeight()  
      int getIconWidth()  
      void paintIcon​(java.awt.Component c, java.awt.Graphics g, int x, int y)  
      protected abstract void paintPositions​(java.awt.Graphics g, java.awt.Point[] positions)
      Generates graphics for a given set of positions in a way that represents the behaviour this icon wants to illustrate.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultiPosIcon

        public MultiPosIcon​(int npos)
        Constructor.
        Parameters:
        npos - number of points
    • Method Detail

      • getIconWidth

        public int getIconWidth()
        Specified by:
        getIconWidth in interface javax.swing.Icon
      • getIconHeight

        public int getIconHeight()
        Specified by:
        getIconHeight in interface javax.swing.Icon
      • paintIcon

        public void paintIcon​(java.awt.Component c,
                              java.awt.Graphics g,
                              int x,
                              int y)
        Specified by:
        paintIcon in interface javax.swing.Icon
      • paintPositions

        protected abstract void paintPositions​(java.awt.Graphics g,
                                               java.awt.Point[] positions)
        Generates graphics for a given set of positions in a way that represents the behaviour this icon wants to illustrate. The number of positions presented is that specified at construction time.
        Parameters:
        g - graphics context
        positions - graphic positions of points