|
JGraph |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgraph.graph.AbstractCellView
org.jgraph.graph.PortView
public class PortView
The default implementation of a port view.
Field Summary | |
---|---|
protected CellView |
lastParent
Cache of the last valid parent. |
static PortRenderer |
renderer
Renderer for the class. |
protected static int |
size
Default size for all ports is 6. |
Fields inherited from class org.jgraph.graph.AbstractCellView |
---|
allAttributes, attributes, cell, cellEditor, childViews, graph, groupBounds, mapper, parent |
Constructor Summary | |
---|---|
PortView(Object cell,
JGraph graph,
CellMapper mapper)
Constructs a view that holds a reference to the specified cell, anchor and parent vertex. |
Method Summary | |
---|---|
Rectangle2D |
getBounds()
Returns the bounds for the port view. |
protected Point2D |
getEdgePoint(EdgeView view,
int index)
Returns the point of edge at index index . |
CellHandle |
getHandle(GraphContext context)
Returns null . |
Point2D |
getLocation(EdgeView edge)
Returns the point that the port represents with respect to edge . |
protected Point2D |
getNextPoint(EdgeView edge)
Returns the point that is closest to the port view on edge . |
CellView |
getParentView()
This method ensures a non-null value. |
CellViewRenderer |
getRenderer()
Returns a renderer for the class. |
protected boolean |
shouldInvokePortMagic(EdgeView edge)
Subclassers can override this to decide whether or not "port magic" should appear on a given edge. |
Methods inherited from class org.jgraph.graph.AbstractCellView |
---|
childUpdated, createLocalAttributeMap, getAllAttributes, getAttributes, getBounds, getCell, getChildViews, getDescendantViews, getEditor, getGraph, getMapper, getModel, getRendererComponent, intersects, isLeaf, refresh, removeFromParent, scale, setAttributes, setBounds, translate, update, updateAllAttributes, updateGroupBounds |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static int size
public static PortRenderer renderer
protected transient CellView lastParent
Constructor Detail |
---|
public PortView(Object cell, JGraph graph, CellMapper mapper)
cell
- reference to the cell in the modelanchor
- view of the parentanchor
- view of the anchor portMethod Detail |
---|
public CellView getParentView()
getParentView
in interface CellView
getParentView
in class AbstractCellView
public Rectangle2D getBounds()
getBounds
in interface CellView
getBounds
in class AbstractCellView
public CellViewRenderer getRenderer()
getRenderer
in class AbstractCellView
public CellHandle getHandle(GraphContext context)
null
.
getHandle
in interface CellView
getHandle
in class AbstractCellView
public Point2D getLocation(EdgeView edge)
edge
.edge
may be null
.
protected boolean shouldInvokePortMagic(EdgeView edge)
protected Point2D getNextPoint(EdgeView edge)
edge
.
Returns null
if edge
has less than 2
points.
protected Point2D getEdgePoint(EdgeView view, int index)
edge
at index index
.
Avoids calling getLocation
on the opposite port of
edge
(possible infinite recursion).
|
JGraph |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |