Class PortView

    • 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.
      • lastParent

        protected transient CellView lastParent
        Cache of the last valid parent. //FIX: Better solution?
    • 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:
        getParentView in interface CellView
        Overrides:
        getParentView in class AbstractCellView
        Returns:
        the parent view 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 to edge and point, which is the nearest point to this port view on the edge. edge and point may be null.
      • shouldInvokePortMagic

        protected boolean shouldInvokePortMagic​(EdgeView edge)
        Subclassers can override this to decide whether or not "port magic" should appear on a given edge. (Port magic means the port tries to make the edge horizontal or vertical if the closest control point lies within the bounds of the parent vertex.)
      • getPortSize

        public int getPortSize()
        Returns:
        the port size
      • setPortSize

        public void setPortSize​(int size)
        Parameters:
        size - the port size to set