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 TypeMethodDescriptionint
Gets the icon height.int
Gets the icon width.void
Paints the icon.void
Sets the color.void
Sets the colors.void
setStroke
(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:
getIconWidth
in interfaceIcon
- Returns:
- the icon width
-
getIconHeight
public int getIconHeight()Gets the icon height.- Specified by:
getIconHeight
in interfaceIcon
- Returns:
- the icon height
-
paintIcon
Paints the icon.
-