Class MultiPosIcon
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.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.
-
-
-
Method Detail
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth
in interfacejavax.swing.Icon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight
in interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
- Specified by:
paintIcon
in interfacejavax.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 contextpositions
- graphic positions of points
-
-