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(java.awt.Point where) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
badFormat(java.lang.String encoded) |
boolean |
equals(java.lang.Object o)
Returns whether the given object is an equivalent
ComponentLocation . |
java.awt.Rectangle |
getBounds(java.awt.Component c)
Return the bounds of this location.
|
protected java.awt.Rectangle |
getCellBounds(JGraph graph,
java.lang.Object o)
Return the bounds of the cell in screen coordinates.
|
java.awt.Point |
getPoint(java.awt.Component c)
Return a concrete point for the abstract location.
|
protected java.awt.Point |
indexToPoint(JGraph graph,
int index)
Convert the given object index into a screen coordinate.
|
ComponentLocation |
parse(java.lang.String encoded)
Convert the given encoding into the proper location.
|
protected java.awt.Point |
toScreen(JGraph graph,
int x,
int y) |
protected java.awt.Rectangle |
toScreen(JGraph graph,
java.awt.geom.Rectangle2D rect) |
java.lang.String |
toString() |
encodeIndex, encodeValue, isIndex, isValue, parseIndex, parseValue
public JGraphLocation()
public JGraphLocation(int index)
public JGraphLocation(java.awt.Point where)
protected java.lang.String badFormat(java.lang.String encoded)
badFormat
in class ComponentLocation
protected java.awt.Rectangle getCellBounds(JGraph graph, java.lang.Object o)
protected java.awt.Point indexToPoint(JGraph graph, int index)
public java.awt.Point getPoint(java.awt.Component c)
getPoint
in class ComponentLocation
public java.awt.Rectangle getBounds(java.awt.Component c)
getBounds
in class ComponentLocation
public boolean equals(java.lang.Object o)
ComponentLocation
ComponentLocation
.equals
in class ComponentLocation
public java.lang.String toString()
toString
in class ComponentLocation
public ComponentLocation parse(java.lang.String encoded)
ComponentLocation
parse
in class ComponentLocation
protected java.awt.Point toScreen(JGraph graph, int x, int y)
protected java.awt.Rectangle toScreen(JGraph graph, java.awt.geom.Rectangle2D rect)
Abbot is hosted on