public class ViewHelper extends Object
Constructor and Description |
---|
ViewHelper() |
Modifier and Type | Method and Description |
---|---|
static Point2D |
getIntersection(Rectangle bounds,
Point target) |
static Point |
getIntersection(Rectangle box,
Point point,
boolean intersect,
float width)
Get the bounding box point to connect a box with an external point.
|
static org.ginsim.core.graph.view.PointList |
getModifiedPoints(NodeAttributesReader nodeReader,
EdgeAttributesReader edgeReader,
Edge<?> edge,
List<Point> modifiedPoints) |
static List<Point> |
getMovingPoints(MovingEdgeType type,
int movex,
int movey,
NodeAttributesReader nreader,
EdgeAttributesReader ereader,
Edge<?> edge)
Get the routing points for an edge which is affected by a move preview.
|
static List<Point> |
getPoints(NodeAttributesReader nodeReader,
EdgeAttributesReader edgeReader,
Edge<?> edge)
Route an edge: add automated intermediate points if needed, compute the points on the nodes bounding boxes.
|
static org.ginsim.core.graph.view.PointList |
getPoints(Rectangle srcBounds,
Rectangle targetBounds,
List<Point> middlePoints,
int w) |
static Rectangle |
getRectangle(int x1,
int y1,
int x2,
int y2)
Get a rectangle given its two angle points.
|
static Rectangle |
getRectangle(Point lastPoint,
Point draggedPoint)
Get a rectangle given its two angle points.
|
static double |
getRotationAngle(int dx,
int dy)
Get the rotation angle between a vector and the horizontal axis.
|
static void |
trimPoints(Edge edge,
List<Point> points,
NodeAttributesReader nreader,
EdgeAttributesReader ereader)
Remove the first and last points if they are inside the source and target bounding box
|
public static final Font GRAPHFONT
public static org.ginsim.core.graph.view.PointList getPoints(Rectangle srcBounds, Rectangle targetBounds, List<Point> middlePoints, int w)
public static Point getIntersection(Rectangle box, Point point, boolean intersect, float width)
box
- point
- intersect
- width
- public static List<Point> getPoints(NodeAttributesReader nodeReader, EdgeAttributesReader edgeReader, Edge<?> edge)
nodeReader
- edgeReader
- edge
- public static List<Point> getMovingPoints(MovingEdgeType type, int movex, int movey, NodeAttributesReader nreader, EdgeAttributesReader ereader, Edge<?> edge)
type
- movex
- movey
- nreader
- ereader
- edge
- public static org.ginsim.core.graph.view.PointList getModifiedPoints(NodeAttributesReader nodeReader, EdgeAttributesReader edgeReader, Edge<?> edge, List<Point> modifiedPoints)
public static void trimPoints(Edge edge, List<Point> points, NodeAttributesReader nreader, EdgeAttributesReader ereader)
nreader
- ereader
- edge
- public static double getRotationAngle(int dx, int dy)
dx
- dy
- public static Rectangle getRectangle(Point lastPoint, Point draggedPoint)
lastPoint
- draggedPoint
- public static Rectangle getRectangle(int x1, int y1, int x2, int y2)
x1
- y1
- x2
- y2
- Copyright © 2005–2020. All rights reserved.