public class PortView extends AbstractCellView
| Modifier and Type | Field and Description |
|---|---|
static boolean |
allowPortMagic
Controls if port magic should be allowed.
|
protected CellView |
lastParent
Cache of the last valid parent.
|
static PortRenderer |
renderer
Renderer for the class.
|
static int |
SIZE
Default size for all ports is 6.
|
allAttributes, attributes, cell, cellEditor, childViews, groupBounds, parent| Constructor and Description |
|---|
PortView()
Constructs an empty portview.
|
PortView(java.lang.Object cell)
Constructs a view that holds a reference to the specified cell, anchor
and parent vertex.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.geom.Rectangle2D |
getBounds()
Returns the bounds for the port view.
|
CellHandle |
getHandle(GraphContext context)
Returns
null. |
java.awt.geom.Point2D |
getLocation()
Shortcut method to getLocation(null, null)
|
java.awt.geom.Point2D |
getLocation(EdgeView edge)
For backwards compatibility.
|
java.awt.geom.Point2D |
getLocation(EdgeView edge,
java.awt.geom.Point2D nearest)
Returns the point that the port represents with respect to
edge and point, which is the nearest point
to this port view on the edge. |
CellView |
getParentView()
This method ensures a non-null value.
|
int |
getPortSize() |
CellViewRenderer |
getRenderer()
Returns a renderer for the class.
|
void |
setPortSize(int size) |
protected boolean |
shouldInvokePortMagic(EdgeView edge)
Subclassers can override this to decide whether or not "port magic"
should appear on a given edge.
|
changeAttributes, childUpdated, createAttributeMap, getAllAttributes, getAttributes, getBounds, getCell, getCellAttributes, getCenterPoint, getChildViews, getDescendantViews, getEditor, getPerimeterPoint, getRendererComponent, includeInGroupBounds, intersects, isLeaf, mergeAttributes, refresh, removeFromParent, scale, setAttributes, setBounds, setCell, translate, update, updateGroupBoundspublic static transient int SIZE
public static transient PortRenderer renderer
public static boolean allowPortMagic
protected transient CellView lastParent
public PortView()
public PortView(java.lang.Object cell)
cell - reference to the cell in the modelpublic CellView getParentView()
getParentView in interface CellViewgetParentView in class AbstractCellViewpublic java.awt.geom.Rectangle2D getBounds()
getBounds in interface CellViewgetBounds in class AbstractCellViewpublic CellViewRenderer getRenderer()
getRenderer in class AbstractCellViewpublic CellHandle getHandle(GraphContext context)
null.getHandle in interface CellViewgetHandle in class AbstractCellViewcontext - the context of this cell view (cells indirectly affected by
it)public java.awt.geom.Point2D getLocation()
public java.awt.geom.Point2D getLocation(EdgeView edge)
public java.awt.geom.Point2D getLocation(EdgeView edge, java.awt.geom.Point2D nearest)
edge and point, which is the nearest point
to this port view on the edge. edge and point
may be null.protected boolean shouldInvokePortMagic(EdgeView edge)
public int getPortSize()
public void setPortSize(int size)
size - the port size to setCopyright (C) 2001-2008 Gaudenz Alder. All rights reserved.