Class AbstractConnector
java.lang.Object
org.pathvisio.libgpml.model.connector.AbstractConnector
- All Implemented Interfaces:
ConnectorShape
- Direct Known Subclasses:
SegmentedConnector,StraightConnectorShape
public abstract class AbstractConnector extends java.lang.Object implements ConnectorShape
Abstract connector shape implementation that deals with cached shapes,
segments and waypoints. ConnectorShapes may implement this class and use the
setShape, setSegments and setWayPoints to refresh the cached shape.
- Author:
- thomas
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.pathvisio.libgpml.model.connector.ConnectorShape
ConnectorShape.Segment, ConnectorShape.WayPoint -
Field Summary
Fields Modifier and Type Field Description private ConnectorShape.Segment[]segmentsprivate java.awt.Shapeshapeprivate ConnectorShape.WayPoint[]waypointsFields inherited from interface org.pathvisio.libgpml.model.connector.ConnectorShape
AXIS_X, AXIS_Y -
Constructor Summary
Constructors Constructor Description AbstractConnector() -
Method Summary
Modifier and Type Method Description java.awt.ShapecalculateAdjustedShape(double startGap, double endGap)Calculates shape from the width of the line endings.protected abstract java.awt.ShapecalculateShape(ConnectorShape.Segment[] segments)Calculates shape from the width of the line endings.ConnectorShape.Segment[]getSegments()Returns the segments of the connector shape as an array.java.awt.ShapegetShape()Returns the connector shape.ConnectorShape.WayPoint[]getWayPoints()Returns the waypoints of the connector shape as an array.protected voidsetSegments(ConnectorShape.Segment[] segments)Sets the segment cache that will be returned bygetSegments().protected voidsetShape(java.awt.Shape shape)Sets the shape cache that will be returned bygetShape().voidsetWayPoints(ConnectorShape.WayPoint[] waypoints)Sets the waypoints cache that will be returned bygetWayPoints().Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pathvisio.libgpml.model.connector.ConnectorShape
fromLineCoordinate, hasValidWaypoints, recalculateShape, toLineCoordinate
-
Field Details
-
shape
private java.awt.Shape shape -
segments
-
waypoints
-
-
Constructor Details
-
AbstractConnector
public AbstractConnector()
-
-
Method Details
-
getShape
public java.awt.Shape getShape()Returns the connector shape.- Specified by:
getShapein interfaceConnectorShape- Returns:
- shape the shape.
-
calculateShape
Calculates shape from the width of the line endings.- Parameters:
segments- the array of segments.- Returns:
- the calculated shape.
-
calculateAdjustedShape
public java.awt.Shape calculateAdjustedShape(double startGap, double endGap)Calculates shape from the width of the line endings.- Specified by:
calculateAdjustedShapein interfaceConnectorShape- Parameters:
startGap- the double.endGap- the double.
-
setShape
protected void setShape(java.awt.Shape shape)Sets the shape cache that will be returned bygetShape().- Parameters:
shape- the shape.
-
getSegments
Returns the segments of the connector shape as an array.- Specified by:
getSegmentsin interfaceConnectorShape- Returns:
- segments the segment array.
-
setSegments
Sets the segment cache that will be returned bygetSegments().- Parameters:
segments- the segment array.
-
getWayPoints
Returns the waypoints of the connector shape as an array.- Specified by:
getWayPointsin interfaceConnectorShape- Returns:
- waypoints the waypoint array.
-
setWayPoints
Sets the waypoints cache that will be returned bygetWayPoints().- Parameters:
waypoints- the waypoint array.
-