Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.component
Class PartialIcon

java.lang.Object
  extended by com.sciapp.component.PartialIcon
All Implemented Interfaces:
Icon

public class PartialIcon
extends Object
implements Icon

The default icon for showing a partially selected state of a TristateCheckBox. It uses another icon to paint the general layout and then draws a filled rectangle in the middle.


Field Summary
protected  Color fillColor
          the rectangle's fill color
protected  Icon ic
          the icon to paint over
protected  int marginX
          the distance of the filled rectangle from the left/right
protected  int marginY
          the distance of the filled rectangle from the top/bottom
 
Constructor Summary
PartialIcon(Icon ic)
          Creates a PartialIcon.
 
Method Summary
 int getIconHeight()
          Returns the icon's height.
 int getIconWidth()
          Returns the icon's width.
 void paintIcon(Component c, Graphics g, int x, int y)
          Draw the icon at the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ic

protected Icon ic
the icon to paint over


marginX

protected int marginX
the distance of the filled rectangle from the left/right


marginY

protected int marginY
the distance of the filled rectangle from the top/bottom


fillColor

protected Color fillColor
the rectangle's fill color

Constructor Detail

PartialIcon

public PartialIcon(Icon ic)
Creates a PartialIcon.

Method Detail

getIconHeight

public int getIconHeight()
Returns the icon's height.

Specified by:
getIconHeight in interface Icon
Returns:
an int specifying the fixed height of the icon.

getIconWidth

public int getIconWidth()
Returns the icon's width.

Specified by:
getIconWidth in interface Icon
Returns:
an int specifying the fixed width of the icon.

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.

Specified by:
paintIcon in interface Icon

Copyright © 2005 Scientific Applications. All Rights Reserved.