Graphics2D Actor API

g2d.graph
Class GraphItem

java.lang.Object
  extended by g2d.glyph.Identifiable
      extended by g2d.glyph.Attributable
          extended by g2d.glyph.Glyphish
              extended by 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

Field Summary
protected static boolean antiAliased
          Wether to draw with anti-aliasing or not.
protected  GlyphList glyphList
           
static Color HIGHLIGHT
           
static double HIGHLIGHT_OFFSET
           
 
Fields inherited from class g2d.glyph.Glyphish
DEBUG
 
Fields inherited from class g2d.glyph.Identifiable
uid
 
Constructor Summary
GraphItem()
           
GraphItem(GraphItem clone)
           
 
Method Summary
abstract  void dehighlight()
          Revert highlighting to previous state (if any).
abstract  double distanceTo(Point2D p)
          Calculate distance from this graph item to given point.
 Rectangle2D getBounds()
           
abstract  void highlight()
          Highlight this node or edge.
 boolean inside(Point2D p)
           
 boolean intersects(Rectangle2D rect)
           
 void paint(Graphics2D g2d)
           
 void transform(AffineTransform a)
           
 
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 g2d.glyph.Identifiable
getObject, getUID, setUID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

GraphItem

public GraphItem()

GraphItem

public GraphItem(GraphItem clone)
Method Detail

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

Graphics2D Actor API