uk.ac.starlink.topcat.plot2
Class ZoneIcon

java.lang.Object
  extended by uk.ac.starlink.topcat.plot2.ZoneIcon
All Implemented Interfaces:
Icon

public class ZoneIcon
extends Object
implements 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
ZoneIcon(Dimension size, Rectangle[] rects, int iHighlight)
          Constructor.
 
Method Summary
static Icon createZoneIcon(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(Component c, Graphics g, int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZoneIcon

public ZoneIcon(Dimension size,
                Rectangle[] rects,
                int iHighlight)
Constructor.

Parameters:
size - icon size
rects - zone rectangles
iHighlight - index into rects 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 interface Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface Icon

createZoneIcon

public static Icon createZoneIcon(Dimension size,
                                  int border,
                                  uk.ac.starlink.ttools.plot2.Gang gang,
                                  int izone)
Creates a zone icon from a gang.

Parameters:
size - total icon size
border - empty border in pixels around all sides
gang - gang defining zone positions
izone - index of zone in gang to highlight (may be null for no highlight)
Returns:
icon


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.