org.jgraph.example
Class JGraphIconView

java.lang.Object
  extended by org.jgraph.graph.AbstractCellView
      extended by org.jgraph.graph.VertexView
          extended by org.jgraph.example.JGraphIconView
All Implemented Interfaces:
java.io.Serializable, org.jgraph.graph.CellView

public class JGraphIconView
extends org.jgraph.graph.VertexView

The cell view modifies the center point of the vertex such that it is relative to the icon rather than the entire vertex. The perimeter

Author:
Dean Mao
See Also:
Serialized Form

Nested Class Summary
static class JGraphIconView.DescriptionTextArea
          This JComponent only displays html renderered text as the lower part of the icon/description duo.
static class JGraphIconView.IconDisplay
          This JComponent only displays an icon as the upper part of the icon/description duo.
static class JGraphIconView.IconRenderer
          This is a combination renderer that displays both an icon and a description under the icon.
static class JGraphIconView.MultiLinedEditor
           
 
Nested classes/interfaces inherited from class org.jgraph.graph.VertexView
org.jgraph.graph.VertexView.SizeHandle
 
Field Summary
 
Fields inherited from class org.jgraph.graph.VertexView
defaultBounds, defaultCursors, renderer, xCursors, yCursors
 
Fields inherited from class org.jgraph.graph.AbstractCellView
cellEditor
 
Constructor Summary
JGraphIconView()
           
JGraphIconView(java.lang.Object cell)
           
 
Method Summary
 java.awt.geom.Point2D getCenterPoint()
          The center point of the vertex should be in the middle of the icon instead of the middle of the icon/description duo.
 org.jgraph.graph.GraphCellEditor getEditor()
           
 java.awt.geom.Point2D getPerimeterPoint(java.awt.geom.Point2D source, java.awt.geom.Point2D p)
          We don't want to calculate a perimeter point around the entire vertex.
 org.jgraph.graph.CellViewRenderer getRenderer()
           
 boolean isMouseOver()
          The mouse over boolean is here so that we could potentially render the icon differently when the mouse is hovering above the vertex.
 void setMouseOver(boolean isMouseOver)
           
 
Methods inherited from class org.jgraph.graph.VertexView
getBounds, getCachedBounds, getHandle, getPerimeterPoint, setCachedBounds, update
 
Methods inherited from class org.jgraph.graph.AbstractCellView
changeAttributes, childUpdated, getAllAttributes, getAttributes, getBounds, getCell, getCenterPoint, getChildViews, getDescendantViews, getParentView, getRendererComponent, intersects, isLeaf, refresh, removeFromParent, scale, setAttributes, setBounds, setCell, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGraphIconView

public JGraphIconView()

JGraphIconView

public JGraphIconView(java.lang.Object cell)
Method Detail

getEditor

public org.jgraph.graph.GraphCellEditor getEditor()
Specified by:
getEditor in interface org.jgraph.graph.CellView
Overrides:
getEditor in class org.jgraph.graph.AbstractCellView

isMouseOver

public boolean isMouseOver()
The mouse over boolean is here so that we could potentially render the icon differently when the mouse is hovering above the vertex.

Returns:
whether or not the mouse is over the vertex

setMouseOver

public void setMouseOver(boolean isMouseOver)

getCenterPoint

public java.awt.geom.Point2D getCenterPoint()
The center point of the vertex should be in the middle of the icon instead of the middle of the icon/description duo. The reason we must calculate this is so that edges know where to point. We want to make the edges look like they are pointing to an icon from an icon.

Overrides:
getCenterPoint in class org.jgraph.graph.VertexView

getPerimeterPoint

public java.awt.geom.Point2D getPerimeterPoint(java.awt.geom.Point2D source,
                                               java.awt.geom.Point2D p)
We don't want to calculate a perimeter point around the entire vertex. Only the perimeter around the icon will be calculated. This calculation is generic for elliptical perimeters.

Overrides:
getPerimeterPoint in class org.jgraph.graph.VertexView

getRenderer

public org.jgraph.graph.CellViewRenderer getRenderer()
Overrides:
getRenderer in class org.jgraph.graph.VertexView