strokes
Class StrokeIcon

java.lang.Object
  extended by strokes.StrokeIcon
All Implemented Interfaces:
javax.swing.Icon

public class StrokeIcon
extends java.lang.Object
implements javax.swing.Icon

A javax.swing.Icon of a stroke. It can be used e.g. to implement custom visual clues for strokes.

Author:
Caroline Appert

Constructor Summary
StrokeIcon(int width, int height, java.awt.Color colorStroke, int sizeStartingPoint, java.awt.Color colorStartingPoint, java.util.Vector<java.awt.geom.Point2D> stroke)
          Builds a StrokeIcon.
StrokeIcon(int width, int height, java.util.Vector<java.awt.geom.Point2D> stroke)
          Builds a StrokeIcon.
 
Method Summary
 int getIconHeight()
          
 int getIconWidth()
          
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrokeIcon

public StrokeIcon(int width,
                  int height,
                  java.awt.Color colorStroke,
                  int sizeStartingPoint,
                  java.awt.Color colorStartingPoint,
                  java.util.Vector<java.awt.geom.Point2D> stroke)
Builds a StrokeIcon.

Parameters:
width - The width of the icon
height - The height of the icon
colorStroke - The color of the stroke
sizeStartingPoint - The diameter of the starting point
colorStartingPoint - The color of the starting point
stroke - The stroke

StrokeIcon

public StrokeIcon(int width,
                  int height,
                  java.util.Vector<java.awt.geom.Point2D> stroke)
Builds a StrokeIcon. The stroke is drawn in black with a red starting point of diameter 6.

Parameters:
width - The width of the icon
height - The height of the icon
stroke - The stroke
Method Detail

getIconHeight

public int getIconHeight()

Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()

Specified by:
getIconWidth in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)

Specified by:
paintIcon in interface javax.swing.Icon