Class StraightConnectorShape
java.lang.Object
org.pathvisio.libgpml.model.connector.AbstractConnector
org.pathvisio.libgpml.model.connector.StraightConnectorShape
- All Implemented Interfaces:
ConnectorShape
public class StraightConnectorShape extends AbstractConnector
Implements a straight connector Shape, i.e. a Connector with only 90-degree
angles.
- 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 StraightConnectorShape()
-
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.boolean
hasValidWaypoints(ConnectorRestrictions restrictions)
Checks whether the waypoints as provided by the ConnectorRestrictions are valid and will be used to draw the connector pathvoid
recalculateShape(ConnectorRestrictions restrictions)
Forces the connector to redraw it's path.double
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
-
Constructor Details
-
StraightConnectorShape
public StraightConnectorShape()
-
-
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
-
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.
-
hasValidWaypoints
Description copied from interface:ConnectorShape
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
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
-