org.jgraph.example
Class IconExample.InvisiblePortView

java.lang.Object
  extended by org.jgraph.graph.AbstractCellView
      extended by org.jgraph.graph.PortView
          extended by org.jgraph.example.IconExample.InvisiblePortView
All Implemented Interfaces:
java.io.Serializable, org.jgraph.graph.CellView
Enclosing class:
IconExample

public class IconExample.InvisiblePortView
extends org.jgraph.graph.PortView

This "invisible port" is the same size as the icon on the icon/description vertex. We do this by navigating up the tree to get the CellView, then the CustomCell to get the actual icon height/width. Keep in mind that we are also changing the location of the port such that it is in the same place as the icon displayed on the screen. The port renderer is designed so that it doesn't paint anything.

Author:
Dean Mao
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jgraph.graph.PortView
allowPortMagic, renderer, SIZE
 
Fields inherited from class org.jgraph.graph.AbstractCellView
cellEditor
 
Constructor Summary
IconExample.InvisiblePortView(java.lang.Object cell)
           
 
Method Summary
 java.awt.geom.Rectangle2D getBounds()
           
 java.awt.geom.Point2D getLocation(org.jgraph.graph.EdgeView edge)
           
 org.jgraph.graph.CellViewRenderer getRenderer()
           
 
Methods inherited from class org.jgraph.graph.PortView
getHandle, getLocation, getLocation, getParentView, getPortSize, setPortSize
 
Methods inherited from class org.jgraph.graph.AbstractCellView
changeAttributes, childUpdated, getAllAttributes, getAttributes, getBounds, getCell, getCenterPoint, getChildViews, getDescendantViews, getEditor, getPerimeterPoint, getRendererComponent, intersects, isLeaf, refresh, removeFromParent, scale, setAttributes, setBounds, setCell, translate, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IconExample.InvisiblePortView

public IconExample.InvisiblePortView(java.lang.Object cell)
Method Detail

getBounds

public java.awt.geom.Rectangle2D getBounds()
Specified by:
getBounds in interface org.jgraph.graph.CellView
Overrides:
getBounds in class org.jgraph.graph.PortView

getRenderer

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

getLocation

public java.awt.geom.Point2D getLocation(org.jgraph.graph.EdgeView edge)
Overrides:
getLocation in class org.jgraph.graph.PortView