Package org.pathvisio.libgpml.model
Class LineElement
java.lang.Object
org.pathvisio.libgpml.model.PathwayObject
org.pathvisio.libgpml.model.PathwayElement
org.pathvisio.libgpml.model.LineElement
- All Implemented Interfaces:
java.lang.Cloneable,ConnectorRestrictions,Drawable,Groupable,Referenceable,Referenceable.Annotatable,Referenceable.Citable,Referenceable.Evidenceable
- Direct Known Subclasses:
GraphicalLine,Interaction
public abstract class LineElement extends PathwayElement implements Groupable, ConnectorRestrictions
This abstract class stores information for a Line pathway element, e.g.
GraphicalLine or Interaction.- Author:
- finterly
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classLineElement.AnchorThis class stores information for an Anchor pathway element.classLineElement.GenericPointAbstract class of generic point, extended byLineElement.LinePointandLineElement.Anchor.classLineElement.LinePointThis class stores information for a Point pathway element.Nested classes/interfaces inherited from class org.pathvisio.libgpml.model.PathwayElement
PathwayElement.AnnotationRef, PathwayElement.CitationRef, PathwayElement.Comment, PathwayElement.EvidenceRef, PathwayElement.InfoRefNested classes/interfaces inherited from interface org.pathvisio.libgpml.model.Referenceable
Referenceable.Annotatable, Referenceable.Citable, Referenceable.Evidenceable -
Field Summary
Fields Modifier and Type Field Description private java.util.List<LineElement.Anchor>anchorsprivate ConnectorTypeconnectorTypeprivate ArrowHeadTypeendArrowHeadTypeprivate GroupgroupRefprivate java.awt.ColorlineColorprivate java.util.List<LineElement.LinePoint>linePointsprivate LineStyleTypelineStyleprivate doublelineWidth(package private) ConnectorShapeshapeprivate ArrowHeadTypestartArrowHeadTypeprivate intzOrderFields inherited from class org.pathvisio.libgpml.model.PathwayObject
noFire, pathwayModelFields inherited from interface org.pathvisio.libgpml.model.connector.ConnectorRestrictions
SIDE_EAST, SIDE_NORTH, SIDE_SOUTH, SIDE_WEST -
Constructor Summary
Constructors Constructor Description LineElement()Instantiates a line pathway element. -
Method Summary
Modifier and Type Method Description LineElement.AnchoraddAnchor(double position, AnchorShapeType anchorShapeType)Adds a new anchor to this line at the given position with anchorShapeType property.LineElement.AnchoraddAnchor(java.lang.String elementId, double position, AnchorShapeType anchorShapeType)Creates and adds a new anchor to this line at the given position with anchorShapeType property.voidaddAnchor(LineElement.Anchor anchor)Adds given anchor to anchors list.private voidaddLinePoints(java.util.List<LineElement.LinePoint> points)Adds all given points to the linePoints list.voidadjustWayPointPreferences(ConnectorShape.WayPoint[] waypoints)private booleanalmostPerfectAlignment(int side)Check if either the line segment has less than or equal to 10 degree alignment with the side passedvoidcopyValuesFrom(LineElement src)Copies values from the given source pathway element.private ConnectorShape.SegmentfindAnchorSegment(LineElement attLine, double pos)java.util.List<LineElement.Anchor>getAnchors()Get the anchors for this line.private intgetAttachedLineDirection(LineElement.Anchor anchor)java.awt.geom.Rectangle2DgetBounds()Returns the rectangular bounds for this line pathway element.doublegetCenterX()Returns the center x coordinate of the bounding box around (start, end) this line pathway element.doublegetCenterY()Returns the center y coordinate of the bounding box around (start, end) this line pathway element.private intgetClockwisePerpendicularSide(int side)Returns the Perpendicular for a SIDE_* constant (e.g.ConnectorShapegetConnectorShape()The Connector Shape for this line - the connector shape can calculate a Shape based on the connector type (straight, elbow or curved) and possibly way pointsConnectorTypegetConnectorType()Returns the value of the connectorType property.private intgetDirectionX()returns the sign of end.x - start.xprivate intgetDirectionY()returns the sign of end.y - start.yArrowHeadTypegetEndArrowHeadType()Returns the arrowHead property of the end point.GraphLink.LinkableTogetEndElementRef()Returns the elementRef of the end point.LineElement.LinePointgetEndLinePoint()Returns the end (last) point of points list.doublegetEndLinePointX()Returns the x coordinate of the end point.doublegetEndLinePointY()Returns the y coordinate of the end point.java.awt.geom.Point2DgetEndPoint2D()converts end point from MPoint to Point2DintgetEndSide()Calculate on which side of a PathwayElement (SIDE_NORTH, SIDE_EAST, SIDE_SOUTH or SIDE_WEST) the end of this line is connected to.GroupgetGroupRef()Returns the parent group of this pathway element.doublegetHeight()Calculates and returns the height of the bounding box around (start, end) this line pathway element.doublegetLeft()Returns the left x coordinate of the bounding box around (start, end) this line pathway element.java.awt.ColorgetLineColor()Returns the color of a line.java.util.List<LineElement.LinePoint>getLinePoints()Get the points for this line.LineStyleTypegetLineStyle()Returns the visual appearance of a line, e.g.doublegetLineWidth()Returns the pixel value for the width of a line.private intgetOppositeSide(int side)Returns the opposite for a SIDE_* constant (e.g.java.util.List<java.awt.geom.Point2D>getPoints2D()converts all points from MPoint to Point2Djava.awt.geom.Rectangle2DgetRotatedBounds()Returns the rectangular bounds of this line pathway elements.private static intgetSide(double relX, double relY)private static intgetSide(double x, double y, double cx, double cy)Get the side of the given pathway element to which the x and y coordinates connectArrowHeadTypegetStartArrowHeadType()Returns the arrowHead property of the start point.GraphLink.LinkableTogetStartElementRef()Returns the elementRef of the end point.LineElement.LinePointgetStartLinePoint()Returns the start (first) point of points list.doublegetStartLinePointX()Returns the x coordinate of the start point.doublegetStartLinePointY()Returns the y coordinate of the start point.java.awt.geom.Point2DgetStartPoint2D()converts start point from MPoint to Point2DintgetStartSide()Calculate on which side of a PathwayElement (SIDE_NORTH, SIDE_EAST, SIDE_SOUTH or SIDE_WEST) the start of this line is connected to.java.lang.ObjectgetStaticProperty(StaticProperty key)Returns static property value for given key.java.util.Set<StaticProperty>getStaticPropertyKeys()Returns all static properties for this pathway object.doublegetTop()Returns the top y coordinate of the bounding box around (start, end) this line pathway element.ConnectorShape.WayPoint[]getWayPointPreferences()Get the preferred waypoints, to which the connector must draw it's path.doublegetWidth()Calculates and returns the width of the bounding box around (start, end) this line pathway element.intgetZOrder()Returns the z-order of this pathway element.booleanhasAnchor(LineElement.Anchor anchor)Checks whether anchors has the given anchor.booleanhasGroupRef()Checks whether this pathway element belongs to a group.java.awt.geom.Rectangle2DmayCross(java.awt.geom.Point2D point)Check if the connector may cross this point Optionally, returns a shape that defines the boundaries of the area around this point that the connector may not cross.voidremoveAnchor(LineElement.Anchor anchor)Removes given anchor from the anchors list.private voidremoveAnchors()Removes all anchors from the anchors list.private voidremoveLinePoints(java.util.List<LineElement.LinePoint> toRemove)Removes all points from the given line points list.voidresetWayPointPreferences()voidsetCenterX(double v)Sets the x position of the center of the line.voidsetCenterY(double v)Sets the y position of the center of the line.voidsetConnectorType(ConnectorType v)Sets the value of the connectorType property.voidsetEndArrowHeadType(ArrowHeadType value)Sets the arrow head type of the end point.voidsetEndElementRef(GraphLink.LinkableTo elementRef)Sets the elementRef for the end point.voidsetEndLinePoint(LineElement.LinePoint linePoint)Sets end linePoint coordinates to the coordinates of the given linePoint.voidsetEndLinePointX(double v)Sets the x coordinate of the end point.voidsetEndLinePointY(double v)Sets the y coordinate of the end point.private voidsetGroupRef(Group v)Sets the parent group for this pathway element.voidsetGroupRefTo(Group v)Verifies if given parent group is new and valid.voidsetLeft(double v)Sets the position of the left side of the rectangular bounds of the linevoidsetLineColor(java.awt.Color v)Sets the color of a line.voidsetLinePoints(java.util.List<LineElement.LinePoint> points)Sets linePoints to the given list of LinePoints.voidsetLineStyle(LineStyleType v)Sets the visual appearance of a line, e.g.voidsetLineWidth(double v)Sets the pixel value for the width of a line.protected voidsetPathwayModelTo(PathwayModel pathwayModel)Sets the pathway model for this pathway element.voidsetStartArrowHeadType(ArrowHeadType value)Sets the arrow head type of the start point.voidsetStartElementRef(GraphLink.LinkableTo elementRef)Sets the elementRef for the start point.voidsetStartLinePoint(LineElement.LinePoint linePoint)Sets start linePoint coordinates to the coordinates of the given linePoint.voidsetStartLinePointX(double v)Sets the x coordinate of the start point.voidsetStartLinePointY(double v)Sets the y coordinate of the start point.voidsetStaticProperty(StaticProperty key, java.lang.Object value)This works so that o.setNotes(x) is the equivalent of o.setProperty("Notes", x); Value may be null in some cases, e.g.voidsetTop(double v)Sets the position of the top side of the rectangular bounds of the linevoidsetZOrder(int v)Sets the z-order of this pathway element.protected voidterminate()Terminates this LineElement.java.awt.geom.Point2DtoAbsoluteCoordinate(java.awt.geom.Point2D p)Converts a point to pathway coordinates (relative to the pathway).java.awt.geom.Point2DtoRelativeCoordinate(java.awt.geom.Point2D mp)Converts a point to shape coordinates (relative to the bounds of the object)voidunsetGroupRef()Unsets the parent group, if any, from this pathway element.Methods inherited from class org.pathvisio.libgpml.model.PathwayElement
addAnnotation, addAnnotation, addAnnotation, addCitation, addCitation, addCitation, addComment, addComment, addEvidence, addEvidence, addEvidence, copy, copyReferencesFrom, copyValuesFrom, findComment, getAnnotationRefs, getCitationRefs, getComments, getDynamicProperties, getDynamicProperty, getDynamicPropertyKeys, getEvidenceRefs, getPropertyEx, getPropertyKeys, hasAnnotationRef, hasCitationRef, hasEvidenceRef, removeAnnotationRef, removeAnnotationRefs, removeCitationRef, removeCitationRefs, removeComment, removeEvidenceRef, removeEvidenceRefs, setComments, setDynamicProperty, setPropertyExMethods inherited from class org.pathvisio.libgpml.model.PathwayObject
addListener, dontFireEvents, fireObjectModifiedEvent, getElementId, getListeners, getObjectType, getPathwayModel, hasPathwayModel, removeListener, setElementId, setGeneratedElementId, setPathwayModel, unsetPathwayModelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pathvisio.libgpml.model.Drawable
getObjectType, getPathwayModel
-
Field Details
-
startArrowHeadType
-
endArrowHeadType
-
groupRef
-
linePoints
-
anchors
-
lineColor
private java.awt.Color lineColor -
lineStyle
-
lineWidth
private double lineWidth -
connectorType
-
zOrder
private int zOrder -
shape
ConnectorShape shape
-
-
Constructor Details
-
LineElement
public LineElement()Instantiates a line pathway element. NB: Property groupRef is to be set bysetGroupRefTo(Group). In GPML, groupRef refers to the elementId (formerly groupId) of the parent gpml:Group. Note, a group can also belong in another group. Graphics properties have default values and can be set after a line pathway element is already instantiated.
-
-
Method Details
-
getStartArrowHeadType
Returns the arrowHead property of the start point. Arrowhead specifies the glyph at the ends of graphical lines and interactions. Intermediate points have arrowhead type UNDIRECTED (the absence of an arrowhead).- Returns:
- startArrowHeadType the arrow head type.
-
setStartArrowHeadType
Sets the arrow head type of the start point.- Parameters:
value- the arrow head type to set.
-
getEndArrowHeadType
Returns the arrowHead property of the end point. Arrowhead specifies the glyph at the ends of graphical lines and interactions. Intermediate points have arrowhead type UNDIRECTED (the absence of an arrowhead).- Returns:
- endArrowHeadType the arrow head type.
-
setEndArrowHeadType
Sets the arrow head type of the end point.- Parameters:
value- the arrow head type to set.
-
getGroupRef
Returns the parent group of this pathway element. In GPML, groupRef refers to the elementId (formerly groupId) of the parent gpml:Group.- Specified by:
getGroupRefin interfaceGroupable- Returns:
- groupRef the parent group of this pathway element.
-
hasGroupRef
public boolean hasGroupRef()Checks whether this pathway element belongs to a group.- Specified by:
hasGroupRefin interfaceGroupable- Returns:
- true if and only if the group of this pathway element is effective.
-
setGroupRefTo
Verifies if given parent group is new and valid. Sets the parent group of this pathway element. Adds this pathway element to the the pathwayElements list of the new parent group. If there is an old parent group, this pathway element is removed from its pathwayElements list.- Specified by:
setGroupRefToin interfaceGroupable- Parameters:
v- the new parent group to set.
-
setGroupRef
Sets the parent group for this pathway element.- Parameters:
v- the given group to set.
-
unsetGroupRef
public void unsetGroupRef()Unsets the parent group, if any, from this pathway element.- Specified by:
unsetGroupRefin interfaceGroupable
-
getLinePoints
Get the points for this line.- Returns:
- points the list of points, an empty list if no anchors are defined.
-
setLinePoints
Sets linePoints to the given list of LinePoints. Removes old pointsremoveLinePoints(java.util.List<org.pathvisio.libgpml.model.LineElement.LinePoint>), if any, then adds new pointsaddLinePoints(java.util.List<org.pathvisio.libgpml.model.LineElement.LinePoint>). In the case of updating waypoints, start and end line points are preserved and should not be removed.- Parameters:
points- the list of points to set.
-
addLinePoints
Adds all given points to the linePoints list. Adds each point to the pathway modelPathwayModel.addPathwayObject(org.pathvisio.libgpml.model.PathwayObject)if applicable. This method is called only bysetLinePoints(java.util.List<org.pathvisio.libgpml.model.LineElement.LinePoint>).- Parameters:
points- the points to add to pathway model..
-
removeLinePoints
Removes all points from the given line points list.NB:
- Called from
setLinePoints(java.util.List<org.pathvisio.libgpml.model.LineElement.LinePoint>). For which in some cases, start and end line points are preserved and should not be removed. - When this line element is terminated
terminate(), all points of linePoints list are removed.
- Parameters:
toRemove- the list of points to remove.
- Called from
-
getAnchors
Get the anchors for this line.- Returns:
- anchors the list of anchors, an empty list if no anchors are defined.
-
hasAnchor
Checks whether anchors has the given anchor.- Parameters:
anchor- the anchor to look for.- Returns:
- true if has anchor, false otherwise.
-
addAnchor
Adds given anchor to anchors list. Sets lineElement for the given anchor.- Parameters:
anchor- the anchor to be added.
-
addAnchor
Adds a new anchor to this line at the given position with anchorShapeType property. CallsaddAnchor(Anchor anchor).- Parameters:
position- the relative position on the line, between 0 (start) to 1 (end).anchorShapeType- the shape type of the anchor.
-
addAnchor
public LineElement.Anchor addAnchor(java.lang.String elementId, double position, AnchorShapeType anchorShapeType)Creates and adds a new anchor to this line at the given position with anchorShapeType property. Anchor elementId is set immediately after creation. This method is used when reading gpml.CallsaddAnchor(Anchor anchor).- Parameters:
elementId- the elementId to set for created anchor.position- the relative position on the line, between 0 (start) to 1 (end).anchorShapeType- the shape type of the anchor.
-
removeAnchor
Removes given anchor from the anchors list. Anchor ceases to exist and is terminated.- Parameters:
anchor- the anchor to be removed.
-
removeAnchors
private void removeAnchors()Removes all anchors from the anchors list. -
getLineColor
public java.awt.Color getLineColor()Returns the color of a line.- Returns:
- lineColor the color of a line.
-
setLineColor
public void setLineColor(java.awt.Color v)Sets the color of a line.- Parameters:
v- the color of a line.- Throws:
java.lang.IllegalArgumentException- if color null.
-
getLineStyle
Returns the visual appearance of a line, e.g. Solid or Broken.- Returns:
- lineStyle the style of a line.
-
setLineStyle
Sets the visual appearance of a line, e.g. Solid or Broken.- Parameters:
v- the line style to set.- Throws:
java.lang.IllegalArgumentException- if lineStyle null.
-
getLineWidth
public double getLineWidth()Returns the pixel value for the width of a line.- Returns:
- lineWidth the width of a line.
-
setLineWidth
public void setLineWidth(double v)Sets the pixel value for the width of a line.- Parameters:
v- the width of a line.- Throws:
java.lang.IllegalArgumentException- if lineWidth is a negative value.
-
getConnectorType
Returns the value of the connectorType property. Specifies a set of rules to govern layout of Graphical Lines and Interactions. PathVisio (Java): Line Type and GPML: ConnectorType e.g. Curved, Elbow, Straight- Returns:
- connectorType the layout of a line.
-
setConnectorType
Sets the value of the connectorType property. Specifies a set of rules to govern layout of Graphical Lines and Interactions. PathVisio (Java): Line Type and GPML: ConnectorType e.g. Curved, Elbow, Straight- Parameters:
v- the layout of a line.- Throws:
java.lang.IllegalArgumentException- if ConnectorType null.
-
getZOrder
public int getZOrder()Returns the z-order of this pathway element. -
setZOrder
public void setZOrder(int v)Sets the z-order of this pathway element. -
getStartLinePoint
Returns the start (first) point of points list.- Returns:
- the first point of points list.
-
setStartLinePoint
Sets start linePoint coordinates to the coordinates of the given linePoint.- Parameters:
linePoint- the given line point.
-
getEndLinePoint
Returns the end (last) point of points list.- Returns:
- the last point of points list.
-
setEndLinePoint
Sets end linePoint coordinates to the coordinates of the given linePoint.- Parameters:
linePoint- the given line point.
-
getStartLinePointX
public double getStartLinePointX()Returns the x coordinate of the start point.- Returns:
- the x coordinate of the start point.
-
setStartLinePointX
public void setStartLinePointX(double v)Sets the x coordinate of the start point.- Parameters:
v- the value to set.
-
getStartLinePointY
public double getStartLinePointY()Returns the y coordinate of the start point.- Returns:
- the y coordinate of the start point.
-
setStartLinePointY
public void setStartLinePointY(double v)Sets the y coordinate of the start point.- Parameters:
v- the value to set.
-
getEndLinePointX
public double getEndLinePointX()Returns the x coordinate of the end point.- Returns:
- the x coordinate of the end point.
-
setEndLinePointX
public void setEndLinePointX(double v)Sets the x coordinate of the end point.- Parameters:
v- the value to set.
-
getEndLinePointY
public double getEndLinePointY()Returns the y coordinate of the end point.- Returns:
- the y coordinate of the end point.
-
setEndLinePointY
public void setEndLinePointY(double v)Sets the y coordinate of the end point.- Parameters:
v- the value to set.
-
getStartElementRef
Returns the elementRef of the end point.- Returns:
- the elementRef linkableTo pathway element.
-
setStartElementRef
Sets the elementRef for the start point.- Parameters:
elementRef- to link to.
-
getEndElementRef
Returns the elementRef of the end point.- Returns:
- the elementRef linkableTo pathway element.
-
setEndElementRef
Sets the elementRef for the end point.- Parameters:
elementRef- to link to.
-
getStartPoint2D
public java.awt.geom.Point2D getStartPoint2D()converts start point from MPoint to Point2D- Specified by:
getStartPoint2Din interfaceConnectorRestrictions- Returns:
- the start point.
-
getEndPoint2D
public java.awt.geom.Point2D getEndPoint2D()converts end point from MPoint to Point2D- Specified by:
getEndPoint2Din interfaceConnectorRestrictions- Returns:
- the end point.
-
getPoints2D
public java.util.List<java.awt.geom.Point2D> getPoints2D()converts all points from MPoint to Point2D -
getRotatedBounds
public java.awt.geom.Rectangle2D getRotatedBounds()Returns the rectangular bounds of this line pathway elements. This method simply callsgetBounds()because lines do not have property rotation.- Specified by:
getRotatedBoundsin interfaceGroupable- Returns:
- the rectangular bounds for this line pathway element.
-
getBounds
public java.awt.geom.Rectangle2D getBounds()Returns the rectangular bounds for this line pathway element. The bounds for a line is calculated from its ends points (first and last). -
getCenterX
public double getCenterX()Returns the center x coordinate of the bounding box around (start, end) this line pathway element.- Specified by:
getCenterXin interfaceGroupable- Returns:
- the center x coordinate.
-
setCenterX
public void setCenterX(double v)Sets the x position of the center of the line. This makes the line move as a whole- Specified by:
setCenterXin interfaceGroupable- Parameters:
v- the center x coordinate to set.
-
getCenterY
public double getCenterY()Returns the center y coordinate of the bounding box around (start, end) this line pathway element.- Specified by:
getCenterYin interfaceGroupable- Returns:
- the center y coordinate
-
setCenterY
public void setCenterY(double v)Sets the y position of the center of the line. This makes the line move as a whole.- Specified by:
setCenterYin interfaceGroupable- Parameters:
v- the center y coordinate to set.
-
getWidth
public double getWidth()Calculates and returns the width of the bounding box around (start, end) this line pathway element. -
getHeight
public double getHeight()Calculates and returns the height of the bounding box around (start, end) this line pathway element. -
getLeft
public double getLeft()Returns the left x coordinate of the bounding box around (start, end) this line pathway element. -
setLeft
public void setLeft(double v)Sets the position of the left side of the rectangular bounds of the line -
getTop
public double getTop()Returns the top y coordinate of the bounding box around (start, end) this line pathway element. -
setTop
public void setTop(double v)Sets the position of the top side of the rectangular bounds of the line -
getDirectionX
private int getDirectionX()returns the sign of end.x - start.x -
getDirectionY
private int getDirectionY()returns the sign of end.y - start.y -
toAbsoluteCoordinate
public java.awt.geom.Point2D toAbsoluteCoordinate(java.awt.geom.Point2D p)Description copied from interface:GroupableConverts a point to pathway coordinates (relative to the pathway).- Specified by:
toAbsoluteCoordinatein interfaceDrawable- Specified by:
toAbsoluteCoordinatein interfaceGroupable- Parameters:
p-- Returns:
-
toRelativeCoordinate
public java.awt.geom.Point2D toRelativeCoordinate(java.awt.geom.Point2D mp)Description copied from interface:GroupableConverts a point to shape coordinates (relative to the bounds of the object)- Specified by:
toRelativeCoordinatein interfaceDrawable- Specified by:
toRelativeCoordinatein interfaceGroupable- Parameters:
mp- a point in absolute model coordinates- Returns:
- the same point relative to the bounding box of this pathway element: -1,-1 meaning the top-left corner, 1,1 meaning the bottom right corner, and 0,0 meaning the center.
-
getConnectorShape
The Connector Shape for this line - the connector shape can calculate a Shape based on the connector type (straight, elbow or curved) and possibly way points -
getStartSide
public int getStartSide()Calculate on which side of a PathwayElement (SIDE_NORTH, SIDE_EAST, SIDE_SOUTH or SIDE_WEST) the start of this line is connected to. If the start is not connected to anything, returns SIDE_WEST- Specified by:
getStartSidein interfaceConnectorRestrictions- Returns:
- The side, one of the SIDE_* constants
-
getEndSide
public int getEndSide()Calculate on which side of a PathwayElement (SIDE_NORTH, SIDE_EAST, SIDE_SOUTH or SIDE_WEST) the end of this line is connected to. If the end is not connected to anything, returns SIDE_EAST- Specified by:
getEndSidein interfaceConnectorRestrictions- Returns:
- The side, one of the SIDE_* constants
-
getAttachedLineDirection
-
findAnchorSegment
-
almostPerfectAlignment
private boolean almostPerfectAlignment(int side)Check if either the line segment has less than or equal to 10 degree alignment with the side passed- Parameters:
side-- Returns:
- true if less or equal to 10 degree alignment else false
-
getClockwisePerpendicularSide
private int getClockwisePerpendicularSide(int side)Returns the Perpendicular for a SIDE_* constant (e.g. SIDE_EAST, SIDE_WEST) -
adjustWayPointPreferences
-
resetWayPointPreferences
public void resetWayPointPreferences() -
getWayPointPreferences
Get the preferred waypoints, to which the connector must draw it's path. The waypoints returned by this method are preferences and the connector shape may decide not to use them if they are invalid.- Specified by:
getWayPointPreferencesin interfaceConnectorRestrictions
-
getSide
private static int getSide(double x, double y, double cx, double cy)Get the side of the given pathway element to which the x and y coordinates connect- Parameters:
x- the x coordinatey- the y coordinatecx-cy- // e The element to find the side of- Returns:
- One of the SIDE_* constants
-
getSide
private static int getSide(double relX, double relY) -
getOppositeSide
private int getOppositeSide(int side)Returns the opposite for a SIDE_* constant (e.g. SIDE_EAST, SIDE_WEST) -
mayCross
public java.awt.geom.Rectangle2D mayCross(java.awt.geom.Point2D point)Check if the connector may cross this point Optionally, returns a shape that defines the boundaries of the area around this point that the connector may not cross. This method can be used for advanced connectors that route along other objects on the drawing- Specified by:
mayCrossin interfaceConnectorRestrictions- Parameters:
point- the point to check.- Returns:
- A shape that defines the boundaries of the area around this point that the connector may not cross. Returning null is allowed for implementing classes.
-
setPathwayModelTo
protected void setPathwayModelTo(PathwayModel pathwayModel) throws java.lang.IllegalArgumentException, java.lang.IllegalStateExceptionSets the pathway model for this pathway element. NB: Only set when a pathway model adds this pathway element. NB: This method is not used directly. It is called byPathwayModel.addPathwayObject(org.pathvisio.libgpml.model.PathwayObject).- Overrides:
setPathwayModelToin classPathwayObject- Parameters:
pathwayModel- the parent pathway model.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalStateException
-
terminate
protected void terminate()Terminates this LineElement. The pathway model, if any, is unset from this anchor.Links to all annotationRefs, citationRefs, and evidenceRefs are removed from this data node.- Overrides:
terminatein classPathwayElement
-
copyValuesFrom
Copies values from the given source pathway element.NB:
- GroupRef is not copied, but can be set later if the parent group and all other pathway element members are copied.
- Parameters:
src- the source pathway element.
-
getStaticPropertyKeys
Returns all static properties for this pathway object.- Overrides:
getStaticPropertyKeysin classPathwayElement- Returns:
- result the set of static property for this pathway object.
-
getStaticProperty
Returns static property value for given key.- Overrides:
getStaticPropertyin classPathwayElement- Parameters:
key- the key.- Returns:
- the static property value.
-
setStaticProperty
This works so that o.setNotes(x) is the equivalent of o.setProperty("Notes", x); Value may be null in some cases, e.g. graphRef- Overrides:
setStaticPropertyin classPathwayElement- Parameters:
key- the key.value- the property value.
-