org.jhotdraw.draw.decoration
Interface LineDecoration
-
- All Superinterfaces:
- java.lang.Cloneable, java.io.Serializable
- All Known Implementing Classes:
- AbstractLineDecoration, ArrowTip, CompositeLineDecoration, GeneralPathTip, PerpendicularBar
public interface LineDecoration extends java.lang.Cloneable, java.io.SerializableA line decoration can be used to draw a decoration at the start or end of a line.Typically a line decoration is set as an attribute value to a
BezierFigureusing the attribute keysorg.jhotdraw.draw.AttributeKeys.START_DECORATIONandorg.jhotdraw.draw.AttributeKeys.END_DECORATION.
Design PatternsDecorator
The start and end point of aBezierFigurecan be decorated with a line decoration.
Component:BezierFigure; Decorator:LineDecoration.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voiddraw(java.awt.Graphics2D g, Figure f, java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2)Draws the decoration in the direction specified by the two Points.doublegetDecorationRadius(Figure f)Returns the radius of the decorator.java.awt.geom.Rectangle2D.DoublegetDrawingArea(Figure f, java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2)Returns the drawing bounds of the decorator.
-
-
-
Method Detail
-
draw
void draw(java.awt.Graphics2D g, Figure f, java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2)Draws the decoration in the direction specified by the two Points.
-
getDecorationRadius
double getDecorationRadius(Figure f)
Returns the radius of the decorator. This is used to crop the end of the line, to prevent it from being drawn over the decorator.
-
getDrawingArea
java.awt.geom.Rectangle2D.Double getDrawingArea(Figure f, java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2)
Returns the drawing bounds of the decorator.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG