org.softsmithy.lib.swing.icon
Class ShapeIcon

java.lang.Object
  extended by org.softsmithy.lib.swing.icon.ShapeIcon
All Implemented Interfaces:
Icon, XIcon

public class ShapeIcon
extends Object
implements XIcon

Author:
puce

Constructor Summary
ShapeIcon()
          Creates a new instance of ShapeIcon
ShapeIcon(Shape shape)
           
 
Method Summary
 int getIconHeight()
          Returns the icon's height.
 int getIconWidth()
          Returns the icon's width.
 XIcon getScaledInstance(int newWidth, int newHeight)
          FIXME
 Shape getShape()
          Getter for property shape.
 Stroke getStroke()
          Getter for property stroke.
 ShapeIcon getTransformedInstance(AffineTransform at)
           
 boolean isFilled()
          Getter for property filled.
 void paintIcon(Component c, Graphics g, int x, int y)
          Draw the icon at the specified location.
 void setFilled(boolean filled)
          Setter for property filled.
 void setShape(Shape shape)
          Setter for property shape.
 void setStroke(Stroke stroke)
          Setter for property stroke.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeIcon

public ShapeIcon()
Creates a new instance of ShapeIcon


ShapeIcon

public ShapeIcon(Shape shape)
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

getShape

public Shape getShape()
Getter for property shape.

Returns:
Value of property shape.

setShape

public void setShape(Shape shape)
Setter for property shape.

Parameters:
shape - New value of property shape.

isFilled

public boolean isFilled()
Getter for property filled.

Returns:
Value of property filled.

setFilled

public void setFilled(boolean filled)
Setter for property filled.

Parameters:
filled - New value of property filled.

getStroke

public Stroke getStroke()
Getter for property stroke.

Returns:
Value of property stroke.

setStroke

public void setStroke(Stroke stroke)
Setter for property stroke.

Parameters:
stroke - New value of property stroke.

getTransformedInstance

public ShapeIcon getTransformedInstance(AffineTransform at)

getScaledInstance

public XIcon getScaledInstance(int newWidth,
                               int newHeight)
FIXME

Specified by:
getScaledInstance in interface XIcon


Copyright © 2002-2011 SoftSmithy. All Rights Reserved.