Package org.ka2ddo.yaac.gui.drawlayer
Class StrokeIcon
java.lang.Object
org.ka2ddo.yaac.gui.drawlayer.StrokeIcon
- All Implemented Interfaces:
Icon
This class implements an icon that shows a particular
BasicStroke
style of line.- Author:
- Andrew Pavlin, KA2DDO
-
Constructor Summary
ConstructorDescriptionStrokeIcon
(BasicStroke stroke, String strokeType) Create a StrokeIcon object. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the icon's height.int
Returns the icon's width.Get the stroke associated with this icon.Get the name of this generic stroke type.void
Draw the icon at the specified location.
-
Constructor Details
-
StrokeIcon
Create a StrokeIcon object.- Parameters:
stroke
- the BasicStroke to draw for this iconstrokeType
- the String name of the stroke type
-
-
Method Details
-
getIconHeight
public int getIconHeight()Returns the icon's height.- Specified by:
getIconHeight
in interfaceIcon
- Returns:
- an int specifying the fixed height of the icon.
-
paintIcon
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. -
getIconWidth
public int getIconWidth()Returns the icon's width.- Specified by:
getIconWidth
in interfaceIcon
- Returns:
- an int specifying the fixed width of the icon.
-
getStroke
Get the stroke associated with this icon.- Returns:
- BasicStroke object
-
getStrokeType
Get the name of this generic stroke type.- Returns:
- String stroke type name
-