Package se.conciliate.extensions.store
Interface MTEdgePath
public interface MTEdgePath
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addControlPoint
(Point toAdd) Adds a control point to the edge.void
Clears the control points of the edge and sets a default set of valid control points between the two vertices.void
clearControlPoints
(double fromAngle, double toAngle) Clears the control points of the edge and sets a default set of valid control points between the two vertices.boolean
Returns true if the point is on the edge.Creates a shape for this edge.Returns the point where the breakdown decorator should be drawn.Returns a list of control points.Returns the first control point.getIntersections
(MTEdgePath path, int zorder) Returns the first control point.getOverlappingSegments
(MTEdgePath path, int zorder) Returns the bounds of the edge.Point[]
getSegment
(Point p) Returns the segment that is closest to point p.boolean
hasEqualRouter
(EdgeRouter other) Returns true if this edge path has a valid router and is the same router asother
boolean
Returns true if this edge path has a valid router, false otherwise.boolean
boolean
void
Moves the given control point and updates the edge.void
moveSegment
(List<Point> points, Point[] segment, Point[] newSegment, Point offset, List<Point[]> otherPoints) Moves the given segment and updates the edge.void
Removes the given control point from the list of control points.void
setControlPoints
(List<Point> points) Sets the list of control points.void
setIntersections
(List<IntersectionPoint> intersections) void
setOverlappingSegments
(List<OverlappingSegment> segments) void
snapLabelBoundsToPath
(Rectangle oldBounds) Snaps the bounds of the label (in the current language) to the edge as close as possible to old bounds.void
snapLabelBoundsToPath
(MTLanguage language, Rectangle oldBounds) Snaps the bounds of the label (for a given language) to the edge as close as possible to old bounds.void
Update the endpoints when the vertex bounds has changed.
-
Method Details
-
createShape
Shape createShape()Creates a shape for this edge. -
hasValidRouter
boolean hasValidRouter()Returns true if this edge path has a valid router, false otherwise. A router is invalid if it can no longer be found. This might happen if the router that the edge was created with is no longer available.- Returns:
- true if this edge path has a valid router, false otherwise
-
hasEqualRouter
Returns true if this edge path has a valid router and is the same router asother
- Returns:
- true if this edge path has a valid router and is the same router as other, false otherwise
-
contains
Returns true if the point is on the edge. -
getFirstControlPoint
Point getFirstControlPoint()Returns the first control point. -
getLastControlPoint
Point getLastControlPoint()Returns the first control point. -
isEndHidden
boolean isEndHidden() -
isStartHidden
boolean isStartHidden() -
getPathBounds
Rectangle getPathBounds()Returns the bounds of the edge. -
getControlPoints
Returns a list of control points. This list must not be modified. -
setControlPoints
Sets the list of control points. -
removeControlPoint
Removes the given control point from the list of control points. -
moveControlPoint
void moveControlPoint(List<Point> points, Point controlPoint, Point offset, List<Point[]> otherSegments) Moves the given control point and updates the edge.- Parameters:
points
- the list of control points to use for the calculation, or null if the edge's control points should be usedcontrolPoint
- the control point to moveoffset
- the distance the control point should move
-
moveSegment
void moveSegment(List<Point> points, Point[] segment, Point[] newSegment, Point offset, List<Point[]> otherPoints) Moves the given segment and updates the edge.- Parameters:
points
- the list of control points to use for the calculation, or null if the edge's control points should be usedsegment
- the segment that should be movednewSegment
- will be modified to point to the new segmentoffset
- the distance the segment should be moved
-
updateEndpoints
Update the endpoints when the vertex bounds has changed.- Parameters:
points
- the list of control points to use for the calculation, or null if the edge's control points should be usedoldFrom
- the shape of the from vertex before it changedoldNew
- the shape of the to vertex before it changed
-
getSegment
Returns the segment that is closest to point p. -
snapLabelBoundsToPath
Snaps the bounds of the label (in the current language) to the edge as close as possible to old bounds. The old bounds is not necessarily the current bounds of the label (for example when resizing we try to keep the bounds as close as possible to the bounds when the resize operation started).- Parameters:
oldBounds
- The old bounds of the label.
-
snapLabelBoundsToPath
Snaps the bounds of the label (for a given language) to the edge as close as possible to old bounds. The old bounds is not necessarily the current bounds of the label (for example when resizing we try to keep the bounds as close as possible to the bounds when the resize operation started).- Parameters:
language
- The language to update the bounds foroldBounds
- The old bounds of the label.
-
clearControlPoints
void clearControlPoints()Clears the control points of the edge and sets a default set of valid control points between the two vertices. -
clearControlPoints
void clearControlPoints(double fromAngle, double toAngle) Clears the control points of the edge and sets a default set of valid control points between the two vertices.- Parameters:
fromAngle
- The direction to start with at the "source" vertex.toAngle
- The direction to end with at the "target" vertex.
-
addControlPoint
Adds a control point to the edge. The implementation might have to add additional control points to keep the edge consistent.- Parameters:
toAdd
- The new point to add. The implementation should try to add the new point as close as possible totoAdd
.
-
setIntersections
-
setOverlappingSegments
-
getOverlappingSegments
-
getIntersections
-
getBreakdownLocation
Point getBreakdownLocation()Returns the point where the breakdown decorator should be drawn.
-