org.jgraph.graph
Class PortView
- java.lang.Object
-
- org.jgraph.graph.AbstractCellView
-
- org.jgraph.graph.PortView
-
- All Implemented Interfaces:
- java.io.Serializable, CellView
public class PortView extends AbstractCellView
The default implementation of a port view.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static booleanallowPortMagicControls if port magic should be allowed.static PortRendererrendererRenderer for the class.static intSIZEDefault size for all ports is 6.-
Fields inherited from class org.jgraph.graph.AbstractCellView
cellEditor
-
-
Constructor Summary
Constructors 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.geom.Rectangle2DgetBounds()Returns the bounds for the port view.CellHandlegetHandle(GraphContext context)Returnsnull.java.awt.geom.Point2DgetLocation()Shortcut method to getLocation(null, null)java.awt.geom.Point2DgetLocation(EdgeView edge)For backwards compatibility.java.awt.geom.Point2DgetLocation(EdgeView edge, java.awt.geom.Point2D nearest)Returns the point that the port represents with respect toedgeandpoint, which is the nearest point to this port view on the edge.CellViewgetParentView()This method ensures a non-null value.intgetPortSize()CellViewRenderergetRenderer()Returns a renderer for the class.voidsetPortSize(int size)-
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
-
-
-
-
Field Detail
-
SIZE
public static transient int SIZE
Default size for all ports is 6.
-
renderer
public static transient PortRenderer renderer
Renderer for the class.
-
allowPortMagic
public static boolean allowPortMagic
Controls if port magic should be allowed. Default is true. This is an easy switch to disable port magic for all instances of graphs.
-
-
Constructor Detail
-
PortView
public PortView()
Constructs an empty portview.
-
PortView
public PortView(java.lang.Object cell)
Constructs a view that holds a reference to the specified cell, anchor and parent vertex.- Parameters:
cell- reference to the cell in the model
-
-
Method Detail
-
getParentView
public CellView getParentView()
This method ensures a non-null value. If the super method returns null then the last valid parent is returned. Note: If a vertex is removed, all ports will be replaced in connected edges. The ports are replaced by the center point of the last valid vertex view.- Specified by:
getParentViewin interfaceCellView- Overrides:
getParentViewin classAbstractCellView- Returns:
- the parent view for this view
-
getBounds
public java.awt.geom.Rectangle2D getBounds()
Returns the bounds for the port view.- Specified by:
getBoundsin interfaceCellView- Overrides:
getBoundsin classAbstractCellView
-
getRenderer
public CellViewRenderer getRenderer()
Returns a renderer for the class.- Specified by:
getRendererin classAbstractCellView- Returns:
- the renderer instance for this view
-
getHandle
public CellHandle getHandle(GraphContext context)
Returnsnull.- Specified by:
getHandlein interfaceCellView- Specified by:
getHandlein classAbstractCellView- Parameters:
context- the context of this cell view (cells indirectly affected by it)- Returns:
- the cell handle for this view
-
getLocation
public java.awt.geom.Point2D getLocation()
Shortcut method to getLocation(null, null)
-
getLocation
public java.awt.geom.Point2D getLocation(EdgeView edge)
For backwards compatibility.
-
getLocation
public java.awt.geom.Point2D getLocation(EdgeView edge, java.awt.geom.Point2D nearest)
Returns the point that the port represents with respect toedgeandpoint, which is the nearest point to this port view on the edge.edgeandpointmay benull.
-
getPortSize
public int getPortSize()
- Returns:
- the port size
-
setPortSize
public void setPortSize(int size)
- Parameters:
size- the port size to set
-
-
DataMelt 3.0 © DataMelt by jWork.ORG