CH.ifa.draw.figures
Class AbstractLineDecoration

java.lang.Object
  extended by CH.ifa.draw.figures.AbstractLineDecoration
All Implemented Interfaces:
LineDecoration, Storable, java.io.Serializable, java.lang.Cloneable
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
 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

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