Package uk.ac.starlink.topcat.plot2
Class ZoneIcon
- java.lang.Object
-
- uk.ac.starlink.topcat.plot2.ZoneIcon
-
- All Implemented Interfaces:
javax.swing.Icon
public class ZoneIcon extends java.lang.Object implements javax.swing.Icon
Icon that displays the position of a Zone within a Gang. This is supposed to be suitable for inclusion into a GUI component like a combo box renderer.- Since:
- 12 Feb 2016
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description ZoneIcon(java.awt.Dimension size, java.awt.Rectangle[] rects, int iHighlight)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.Icon
createZoneIcon(java.awt.Dimension size, int border, uk.ac.starlink.ttools.plot2.Gang gang, int izone)
Creates a zone icon from a gang.int
getIconHeight()
int
getIconWidth()
void
paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
-
-
-
Constructor Detail
-
ZoneIcon
public ZoneIcon(java.awt.Dimension size, java.awt.Rectangle[] rects, int iHighlight)
Constructor.- Parameters:
size
- icon sizerects
- zone rectanglesiHighlight
- index intorects
giving the one to highlight (may be negative for no highlight)- See Also:
createZoneIcon(java.awt.Dimension, int, uk.ac.starlink.ttools.plot2.Gang, int)
-
-
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
-
createZoneIcon
public static javax.swing.Icon createZoneIcon(java.awt.Dimension size, int border, uk.ac.starlink.ttools.plot2.Gang gang, int izone)
Creates a zone icon from a gang.- Parameters:
size
- total icon sizeborder
- empty border in pixels around all sidesgang
- gang defining zone positionsizone
- index of zone in gang to highlight (may be null for no highlight)- Returns:
- icon
-
-