Class ShapeIcon
java.lang.Object
org.opensourcephysics.cabrillo.tracker.ShapeIcon
- All Implemented Interfaces:
Icon
This Icon centers and fills the shape specified in its constructor.
- Author:
- Douglas Brown
-
Constructor Summary
ConstructorsConstructorDescriptionShapeIcon(org.opensourcephysics.cabrillo.tracker.MultiShape shape, int width, int height) Constructs a ShapeIcon.ShapeIcon(org.opensourcephysics.cabrillo.tracker.MultiShape shape, org.opensourcephysics.cabrillo.tracker.MultiShape decoration, int width, int height) Constructs a ShapeIcon. -
Method Summary
Modifier and TypeMethodDescriptionintGets the icon height.intGets the icon width.voidPaints the icon.voidSets the color.voidSets the colors.voidsetStroke(BasicStroke stroke) Sets the stroke.
-
Constructor Details
-
ShapeIcon
public ShapeIcon(org.opensourcephysics.cabrillo.tracker.MultiShape shape, org.opensourcephysics.cabrillo.tracker.MultiShape decoration, int width, int height) Constructs a ShapeIcon.- Parameters:
shape- the shape to drawdecoration- a decorating shape to drawwidth- width of the iconheight- height of the icon
-
ShapeIcon
public ShapeIcon(org.opensourcephysics.cabrillo.tracker.MultiShape shape, int width, int height) Constructs a ShapeIcon.- Parameters:
shape- the shape to drawwidth- width of the iconheight- height of the icon
-
-
Method Details
-
setColor
Sets the color.- Parameters:
color- the desired color
-
setColor
Sets the colors.- Parameters:
color- the desired colordecorationColor- the desired decoration color
-
setStroke
Sets the stroke.- Parameters:
stroke-
-
getIconWidth
public int getIconWidth()Gets the icon width.- Specified by:
getIconWidthin interfaceIcon- Returns:
- the icon width
-
getIconHeight
public int getIconHeight()Gets the icon height.- Specified by:
getIconHeightin interfaceIcon- Returns:
- the icon height
-
paintIcon
Paints the icon.
-