JHotDraw 6.0b1

org.jhotdraw.figures
Class AbstractLineDecoration

java.lang.Object
  extended by org.jhotdraw.figures.AbstractLineDecoration
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, LineDecoration, Storable
Direct Known Subclasses:
ArrowTip

public abstract class AbstractLineDecoration
extends java.lang.Object
implements LineDecoration

An standard implementation of a line decoration.

See Also:
PolyLineFigure, Serialized Form

Constructor Summary
AbstractLineDecoration()
           
 
Method Summary
 java.awt.Rectangle displayBox()
          The LineDecoration has only a displayBox after it has been drawn at least once.
 void draw(java.awt.Graphics g, int x1, int y1, int x2, int y2)
          Draws the arrow tip in the direction specified by the given two points..
 java.awt.Color getBorderColor()
          Returns color of arrow's border
 java.awt.Color getFillColor()
          Returns color with which arrow is filled
abstract  java.awt.Polygon outline(int x1, int y1, int x2, int y2)
          Hook method to calculates the outline of an arrow tip.
 void read(StorableInput dr)
          Reads the arrow tip from a StorableInput.
 void setBorderColor(java.awt.Color borderColor)
          Sets color of arrow's border
 void setFillColor(java.awt.Color fillColor)
          Sets color with which arrow is filled
 void write(StorableOutput dw)
          Stores the arrow tip to a StorableOutput.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLineDecoration

public AbstractLineDecoration()
Method Detail

draw

public void draw(java.awt.Graphics g,
                 int x1,
                 int y1,
                 int x2,
                 int y2)
Draws the arrow tip in the direction specified by the given two points.. (template method)

Specified by:
draw in interface LineDecoration

displayBox

public java.awt.Rectangle displayBox()
The LineDecoration has only a displayBox after it has been drawn at least once. If it has not yet been drawn then a rectangle of size 0 is returned.

Specified by:
displayBox in interface LineDecoration
Returns:
the display box of a LineDecoration.

outline

public abstract java.awt.Polygon outline(int x1,
                                         int y1,
                                         int x2,
                                         int y2)
Hook method to calculates the outline of an arrow tip.


write

public void write(StorableOutput dw)
Stores the arrow tip to a StorableOutput.

Specified by:
write in interface Storable

read

public void read(StorableInput dr)
          throws java.io.IOException
Reads the arrow tip from a StorableInput.

Specified by:
read in interface Storable
Throws:
java.io.IOException

setFillColor

public void setFillColor(java.awt.Color fillColor)
Sets color with which arrow is filled


getFillColor

public java.awt.Color getFillColor()
Returns color with which arrow is filled


setBorderColor

public void setBorderColor(java.awt.Color borderColor)
Sets color of arrow's border


getBorderColor

public java.awt.Color getBorderColor()
Returns color of arrow's border


JHotDraw 6.0b1