Class SegmentedConnector
java.lang.Object
org.pathvisio.libgpml.model.connector.AbstractConnector
org.pathvisio.libgpml.model.connector.SegmentedConnector
- All Implemented Interfaces:
ConnectorShape
- Direct Known Subclasses:
ElbowConnectorShape
,FreeConnectorShape
public abstract class SegmentedConnector extends AbstractConnector
Base class for segmented connectors.
- Author:
- unknown
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.pathvisio.libgpml.model.connector.ConnectorShape
ConnectorShape.Segment, ConnectorShape.WayPoint
-
Field Summary
Fields inherited from interface org.pathvisio.libgpml.model.connector.ConnectorShape
AXIS_X, AXIS_Y
-
Constructor Summary
Constructors Constructor Description SegmentedConnector()
-
Method Summary
Modifier and Type Method Description protected java.awt.Shape
calculateShape(ConnectorShape.Segment[] segments)
Calculates shape from the width of the line endings.java.awt.geom.Point2D
fromLineCoordinate(double l)
Translates a 1-dimensional line coordinate to a 2-dimensional view coordinate.protected java.awt.geom.Point2D
fromLineCoordinate(double l, ConnectorShape.Segment[] segments)
(package private) double
getTotalLength(ConnectorShape.Segment[] segments)
Returns the sum of the lengths of the segmentsdouble
toLineCoordinate(java.awt.geom.Point2D v)
Translates a 2-dimensional view coordinate to a 1-dimensional line coordinate.Methods inherited from class org.pathvisio.libgpml.model.connector.AbstractConnector
calculateAdjustedShape, getSegments, getShape, getWayPoints, setSegments, setShape, setWayPoints
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.pathvisio.libgpml.model.connector.ConnectorShape
hasValidWaypoints, recalculateShape
-
Constructor Details
-
SegmentedConnector
public SegmentedConnector()
-
-
Method Details
-
fromLineCoordinate
- Parameters:
l
-segments
-- Returns:
-
calculateShape
Calculates shape from the width of the line endings.- Specified by:
calculateShape
in classAbstractConnector
- Parameters:
segments
- the array of segments.- Returns:
- the calculated shape.
-
getTotalLength
Returns the sum of the lengths of the segments- Parameters:
segments
- the array of segments.- Returns:
- the total length of segments.
-
fromLineCoordinate
public 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
public double toLineCoordinate(java.awt.geom.Point2D v)Translates a 2-dimensional view coordinate to a 1-dimensional line coordinate.- Parameters:
v
- the Point2D
-