Class StrokeIcon

java.lang.Object
org.ka2ddo.yaac.gui.drawlayer.StrokeIcon
All Implemented Interfaces:
Icon

public class StrokeIcon extends Object implements Icon
This class implements an icon that shows a particular BasicStroke style of line.
Author:
Andrew Pavlin, KA2DDO
  • Constructor Details

    • StrokeIcon

      public StrokeIcon(BasicStroke stroke, String strokeType)
      Create a StrokeIcon object.
      Parameters:
      stroke - the BasicStroke to draw for this icon
      strokeType - the String name of the stroke type
  • Method Details

    • 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.
    • 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
    • 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.
    • getStroke

      public BasicStroke getStroke()
      Get the stroke associated with this icon.
      Returns:
      BasicStroke object
    • getStrokeType

      public String getStrokeType()
      Get the name of this generic stroke type.
      Returns:
      String stroke type name