g2d.graph
Class GraphItem
java.lang.Object
g2d.glyph.Identifiable
g2d.glyph.Attributable
g2d.glyph.Glyphish
g2d.graph.GraphItem
- All Implemented Interfaces:
- KeyListener, MouseListener, MouseMotionListener, EventListener
- Direct Known Subclasses:
- IOPEdge, IOPNode
public abstract class GraphItem
- extends Glyphish
Methods common to nodes and edges in a graph.
Both 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.
- Author:
- linda
| Methods inherited from class g2d.glyph.Glyphish |
keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, rotate, rotate, scale, setKeyAction, setMouseAction, shear, translate, unsetMouseAction |
| Methods inherited from class g2d.glyph.Attributable |
_getAttribute, _setAttribute, getAttribute, getAttributeAsBoolean, getAttributeAsByte, getAttributeAsChar, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsShort, getAttributeAsString, getKeys, getStaticAttribute, getStaticKeys, isAttribute, isStaticAttribute, removeAllAttributes, removeAllStaticAttributes, removeAttribute, removeStaticAttribute, setAttribute, setStaticAttribute, showAttributes |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
antiAliased
protected static boolean antiAliased
- Wether to draw with anti-aliasing or not.
HIGHLIGHT_OFFSET
public static double HIGHLIGHT_OFFSET
HIGHLIGHT
public static Color HIGHLIGHT
glyphList
protected GlyphList glyphList
GraphItem
public GraphItem()
GraphItem
public GraphItem(GraphItem clone)
distanceTo
public abstract double distanceTo(Point2D p)
- Calculate distance from this graph item to given point.
- Parameters:
p - Point to compute distance to
- Returns:
- distance to point
highlight
public abstract void highlight()
- Highlight this node or edge.
dehighlight
public abstract void dehighlight()
- Revert highlighting to previous state (if any).
transform
public void transform(AffineTransform a)
- Specified by:
transform in class Glyphish
inside
public boolean inside(Point2D p)
- Specified by:
inside in class Glyphish
intersects
public boolean intersects(Rectangle2D rect)
- Specified by:
intersects in class Glyphish
getBounds
public Rectangle2D getBounds()
- Specified by:
getBounds in class Glyphish
paint
public void paint(Graphics2D g2d)
- Specified by:
paint in class Glyphish