Interface ConnectorShape
- All Known Implementing Classes:
AbstractConnector,CurvedConnectorShape,ElbowConnectorShape,FreeConnectorShape,SegmentedConnector,StraightConnectorShape
public interface ConnectorShape
Implement this to provide a line shape for connectors.
Different implementations may draw a Line in different ways, for example with
curved or straight lines.
- Author:
- unknown
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classConnectorShape.SegmentA single segment of the connector path.static classConnectorShape.WayPointThe class for a waypoint, a point through which the connector passes. -
Field Summary
-
Method Summary
Modifier and Type Method Description java.awt.ShapecalculateAdjustedShape(double startLineEndingWidth, double endLineEndingWidth)Calculates shape from the width of the line endings.java.awt.geom.Point2DfromLineCoordinate(double l)Translates a 1-dimensional line coordinate to a 2-dimensional view coordinate.ConnectorShape.Segment[]getSegments()Get the individual segments of the pathjava.awt.ShapegetShape()Returns the Shape that represents the connector path.ConnectorShape.WayPoint[]getWayPoints()Get the waypoints through which the connector passesbooleanhasValidWaypoints(ConnectorRestrictions restrictions)Checks whether the waypoints as provided by the ConnectorRestrictions are valid and will be used to draw the connector pathvoidrecalculateShape(ConnectorRestrictions restrictions)Forces the connector to redraw it's path.doubletoLineCoordinate(java.awt.geom.Point2D v)Translates a 2-dimensional view coordinate to a 1-dimensional line coordinate.
-
Field Details
-
AXIS_X
static final int AXIS_X- See Also:
- Constant Field Values
-
AXIS_Y
static final int AXIS_Y- See Also:
- Constant Field Values
-
-
Method Details
-
recalculateShape
Forces the connector to redraw it's path. The cache for segments, waypoints and shape.- Parameters:
restrictions- the ConnectorRestrictions that provides the start, end and preferred waypoints
-
getShape
java.awt.Shape getShape()Returns the Shape that represents the connector path. -
calculateAdjustedShape
java.awt.Shape calculateAdjustedShape(double startLineEndingWidth, double endLineEndingWidth)Calculates shape from the width of the line endings. This gets...- Parameters:
startLineEndingWidth- .endLineEndingWidth- .
-
getSegments
ConnectorShape.Segment[] getSegments()Get the individual segments of the path- Returns:
- array of segments.
-
getWayPoints
ConnectorShape.WayPoint[] getWayPoints()Get the waypoints through which the connector passes- Returns:
- array of waypoints.
-
hasValidWaypoints
Checks whether the waypoints as provided by the ConnectorRestrictions are valid and will be used to draw the connector path- Parameters:
restrictions- the connector restrictions.- Returns:
- true if the waypoints are used, false if not
-
fromLineCoordinate
java.awt.geom.Point2D fromLineCoordinate(double l)Translates a 1-dimensional line coordinate to a 2-dimensional view coordinate. The 1-dimensional line coordinate is position objects that are attached to the line.- Parameters:
l- the double.
-
toLineCoordinate
double toLineCoordinate(java.awt.geom.Point2D v)Translates a 2-dimensional view coordinate to a 1-dimensional line coordinate.- Parameters:
v- the Point2D
-