public abstract class GraphItem extends Glyphish
Subgraphs, nodes and edges are lists of glyphs in their
manifestation. However, instead of exposing this
glyph list as the superclass of either, this
abstract class encapsulates the glyph list used
for manifestation and exposes in its interface
only the Glyphish
class.
Modifier and Type | Field and Description |
---|---|
protected static boolean |
antiAliased
Whether to draw with anti-aliasing or not.
|
static java.util.Comparator<GraphItem> |
COMPARATOR |
java.lang.Integer |
gid |
GlyphList |
glyphList |
static java.awt.Color |
HIGHLIGHT |
static int |
HIGHLIGHT_OFFSET |
protected boolean |
highlighted
Keeps track of the highlighted state.
|
Modifier and Type | Method and Description |
---|---|
void |
dehighlight()
Revert highlighting to previous state (if any).
|
abstract double |
distanceTo(java.awt.geom.Point2D p)
Calculate distance from this graph item to given point.
|
java.awt.geom.Rectangle2D |
getBounds() |
int |
gid() |
void |
highlight()
Highlight this node or edge.
|
boolean |
inside(java.awt.geom.Point2D p) |
boolean |
intersects(java.awt.geom.Rectangle2D rect) |
boolean |
isHighlighted()
For establishing the state of higlighting.
|
boolean |
isSelected() |
void |
paint(java.awt.Graphics2D g2d) |
void |
setSelected(boolean selected) |
void |
transform(java.awt.geom.AffineTransform a) |
keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, rotate, rotate, scale, setKeyAction, setMouseAction, shear, translate, unsetMouseAction
_getAttribute, _setAttribute, getAttribute, getAttributeAsBoolean, getAttributeAsByte, getAttributeAsChar, getAttributeAsClosure, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsShort, getAttributeAsString, getKeys, getStaticAttribute, getStaticKeys, isAttribute, isStaticAttribute, removeAllAttributes, removeAllStaticAttributes, removeAttribute, removeStaticAttribute, setAttribute, setStaticAttribute, showAttributes, showAttributes
public final java.lang.Integer gid
public static java.util.Comparator<GraphItem> COMPARATOR
protected static boolean antiAliased
public static int HIGHLIGHT_OFFSET
public static java.awt.Color HIGHLIGHT
public GlyphList glyphList
protected boolean highlighted
public GraphItem()
public GraphItem(GraphItem clone)
public int gid()
public abstract double distanceTo(java.awt.geom.Point2D p)
p
- Point to compute distance topublic boolean isSelected()
public void setSelected(boolean selected)
public void highlight()
public void dehighlight()
public boolean isHighlighted()
public void transform(java.awt.geom.AffineTransform a)
public boolean intersects(java.awt.geom.Rectangle2D rect)
intersects
in class Glyphish