public class CompositeLineDecoration extends java.lang.Object implements LineDecoration, DOMStorable
LineDecoration
which can compose multiple individual line
decorations.
An composite implementation of a line decoration. It allows more than one line decoration shape to be rotated and moved to the end of the line. The shape is scaled by the stroke width.
Constructor and Description |
---|
CompositeLineDecoration()
Constructs a composite line decoration with no decorations.
|
CompositeLineDecoration(LineDecoration decoration1,
LineDecoration decoration2)
Constructs a composite line decoration with the two supplied decorations.
|
Modifier and Type | Method and Description |
---|---|
void |
addDecoration(LineDecoration decoration)
Add another line decoration into the composite line decoration.
|
void |
draw(java.awt.Graphics2D g,
Figure f,
java.awt.geom.Point2D.Double p1,
java.awt.geom.Point2D.Double p2)
Draws the arrow tip in the direction specified by the given two
Points..
|
double |
getDecorationRadius(Figure f)
Returns the radius of the decorator.
|
java.awt.geom.Rectangle2D.Double |
getDrawingArea(Figure f,
java.awt.geom.Point2D.Double p1,
java.awt.geom.Point2D.Double p2)
Returns the drawing area of the decorator.
|
void |
read(DOMInput in) |
void |
write(DOMOutput out) |
public CompositeLineDecoration()
public CompositeLineDecoration(LineDecoration decoration1, LineDecoration decoration2)
public void addDecoration(LineDecoration decoration)
public void draw(java.awt.Graphics2D g, Figure f, java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2)
draw
in interface LineDecoration
public java.awt.geom.Rectangle2D.Double getDrawingArea(Figure f, java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2)
getDrawingArea
in interface LineDecoration
public double getDecorationRadius(Figure f)
getDecorationRadius
in interface LineDecoration
public void read(DOMInput in) throws java.io.IOException
read
in interface DOMStorable
java.io.IOException
public void write(DOMOutput out) throws java.io.IOException
write
in interface DOMStorable
java.io.IOException