public class JGraphLocation extends ComponentLocation
JGraph
(a coordinate or item index).
This class provides an example of a ComponentLocation
extension.
Note that all bounds information must be converted to screen coordinates
with JGraph.toScreen(Point2D)
or
JGraph.toScreen(Rectangle2D)
before use in actions.CENTER
Constructor and Description |
---|
JGraphLocation() |
JGraphLocation(int index) |
JGraphLocation(Point where) |
Modifier and Type | Method and Description |
---|---|
protected String |
badFormat(String encoded) |
boolean |
equals(Object o)
Returns whether the given object is an equivalent
ComponentLocation . |
Rectangle |
getBounds(Component c)
Return the bounds of this location.
|
protected Rectangle |
getCellBounds(JGraph graph,
Object o)
Return the bounds of the cell in screen coordinates.
|
Point |
getPoint(Component c)
Return a concrete point for the abstract location.
|
protected Point |
indexToPoint(JGraph graph,
int index)
Convert the given object index into a screen coordinate.
|
ComponentLocation |
parse(String encoded)
Convert the given encoding into the proper location.
|
protected Point |
toScreen(JGraph graph,
int x,
int y) |
protected Rectangle |
toScreen(JGraph graph,
Rectangle2D rect) |
String |
toString() |
encodeIndex, encodeValue, isIndex, isValue, parseIndex, parseValue
public JGraphLocation()
public JGraphLocation(int index)
public JGraphLocation(Point where)
protected String badFormat(String encoded)
badFormat
in class ComponentLocation
protected Rectangle getCellBounds(JGraph graph, Object o)
protected Point indexToPoint(JGraph graph, int index)
public Point getPoint(Component c)
getPoint
in class ComponentLocation
public Rectangle getBounds(Component c)
getBounds
in class ComponentLocation
public boolean equals(Object o)
ComponentLocation
ComponentLocation
.equals
in class ComponentLocation
public String toString()
toString
in class ComponentLocation
public ComponentLocation parse(String encoded)
ComponentLocation
parse
in class ComponentLocation
protected Rectangle toScreen(JGraph graph, Rectangle2D rect)
Abbot is hosted on