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, parseValuepublic JGraphLocation()
public JGraphLocation(int index)
public JGraphLocation(Point where)
protected String badFormat(String encoded)
badFormat in class ComponentLocationprotected Rectangle getCellBounds(JGraph graph, Object o)
protected Point indexToPoint(JGraph graph, int index)
public Point getPoint(Component c)
getPoint in class ComponentLocationpublic Rectangle getBounds(Component c)
getBounds in class ComponentLocationpublic boolean equals(Object o)
ComponentLocationComponentLocation.equals in class ComponentLocationpublic String toString()
toString in class ComponentLocationpublic ComponentLocation parse(String encoded)
ComponentLocationparse in class ComponentLocationprotected Rectangle toScreen(JGraph graph, Rectangle2D rect)
Abbot is hosted on