Documentation of 'org.jgraph.graph.DefaultGraphSelectionModel' Java class
DefaultGraphSelectionModel
org.jgraph.graph

Class DefaultGraphSelectionModel

    • Constructor Summary

      Constructors 
      Constructor and Description
      DefaultGraphSelectionModel(JGraph graph)
      Constructs a DefaultGraphSelectionModel for the specified graph.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addGraphSelectionListener(GraphSelectionListener x)
      Adds x to the list of listeners that are notified each time the set of selected TreePaths changes.
      void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
      Adds a PropertyChangeListener to the listener list.
      void addSelectionCell(java.lang.Object cell)
      Adds the specified cell to the current selection
      void addSelectionCells(java.lang.Object[] cells)
      Adds cells to the current selection.
      void clearSelection()
      Empties the current selection.
      java.lang.Object clone()
      Returns a clone of this object with the same selection.
      java.util.EventListener[] getListeners(java.lang.Class listenerType)
      Returns an array of all the listeners of the given type that were added to this model.
      java.lang.Object[] getSelectables()
      Returns the cells that are currently selectable.
      java.lang.Object getSelectionCell()
      Returns the first cell in the selection.
      java.lang.Object[] getSelectionCells()
      Returns the cells in the selection.
      int getSelectionCount()
      Returns the number of paths that are selected.
      int getSelectionMode()
      Returns the selection mode, one of SINGLE_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION or CONTIGUOUS_TREE_SELECTION.
      boolean isCellSelected(java.lang.Object cell)
      Returns true if the cell, cell, is in the current selection.
      boolean isChildrenSelectable()
      Returns true if the selection model allows the selection of children.
      boolean isChildrenSelected(java.lang.Object cell)
      Returns true if the cell, cell, has selected children.
      boolean isSelectionEmpty()
      Returns true if the selection is currently empty.
      void removeGraphSelectionListener(GraphSelectionListener x)
      Removes x from the list of listeners that are notified each time the set of selected TreePaths changes.
      void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
      Removes a PropertyChangeListener from the listener list.
      void removeSelectionCell(java.lang.Object cell)
      Removes the specified cell from the selection.
      void removeSelectionCells(java.lang.Object[] cells)
      Removes the specified cells from the selection.
      void setChildrenSelectable(boolean flag)
      Sets if the selection model allows the selection of children.
      void setSelectionCell(java.lang.Object cell)
      Selects the specified cell.
      void setSelectionCells(java.lang.Object[] cells)
      Sets the selection to cells.
      void setSelectionMode(int mode)
      Sets the selection mode, which must be one of SINGLE_TREE_SELECTION,
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SELECTION_MODE_PROPERTY

        public static final java.lang.String SELECTION_MODE_PROPERTY
        Property name for selectionMode.
        See Also:
        Constant Field Values
      • SELECTED

        public static final int SELECTED
        Value that represents selected state in cellStates.
        See Also:
        Constant Field Values
      • UNSELECTED

        public static final java.lang.Integer UNSELECTED
        Object value that represents the unselected state in cellStates.
    • Constructor Detail

      • DefaultGraphSelectionModel

        public DefaultGraphSelectionModel(JGraph graph)
        Constructs a DefaultGraphSelectionModel for the specified graph.
    • Method Detail

      • setSelectionMode

        public void setSelectionMode(int mode)
        Sets the selection mode, which must be one of SINGLE_TREE_SELECTION,
        Specified by:
        setSelectionMode in interface GraphSelectionModel
      • getSelectionMode

        public int getSelectionMode()
        Returns the selection mode, one of SINGLE_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION or CONTIGUOUS_TREE_SELECTION.
        Specified by:
        getSelectionMode in interface GraphSelectionModel
      • setChildrenSelectable

        public void setChildrenSelectable(boolean flag)
        Sets if the selection model allows the selection of children.
        Specified by:
        setChildrenSelectable in interface GraphSelectionModel
      • isChildrenSelectable

        public boolean isChildrenSelectable()
        Returns true if the selection model allows the selection of children.
        Specified by:
        isChildrenSelectable in interface GraphSelectionModel
      • setSelectionCell

        public void setSelectionCell(java.lang.Object cell)
        Selects the specified cell.
        Specified by:
        setSelectionCell in interface GraphSelectionModel
        Parameters:
        cell - the cell to select
      • setSelectionCells

        public void setSelectionCells(java.lang.Object[] cells)
        Sets the selection to cells. If this represents a change the GraphSelectionListeners are notified. Potentially paths will be held by this object; in other words don't change any of the objects in the array once passed in.
        Specified by:
        setSelectionCells in interface GraphSelectionModel
        Parameters:
        cells - new selection
      • addSelectionCell

        public void addSelectionCell(java.lang.Object cell)
        Adds the specified cell to the current selection
        Specified by:
        addSelectionCell in interface GraphSelectionModel
        Parameters:
        cell - the cell to add to the current selection
      • addSelectionCells

        public void addSelectionCells(java.lang.Object[] cells)
        Adds cells to the current selection.
        Specified by:
        addSelectionCells in interface GraphSelectionModel
        Parameters:
        cells - the cells to be added to the current selection
      • removeSelectionCell

        public void removeSelectionCell(java.lang.Object cell)
        Removes the specified cell from the selection.
        Specified by:
        removeSelectionCell in interface GraphSelectionModel
        Parameters:
        cell - the cell to remove from the current selection
      • removeSelectionCells

        public void removeSelectionCells(java.lang.Object[] cells)
        Removes the specified cells from the selection.
        Specified by:
        removeSelectionCells in interface GraphSelectionModel
        Parameters:
        cells - the cells to remove from the current selection
      • getSelectables

        public java.lang.Object[] getSelectables()
        Returns the cells that are currently selectable. The array is ordered so that the top-most cell appears first.
        Specified by:
        getSelectables in interface GraphSelectionModel
      • getSelectionCell

        public java.lang.Object getSelectionCell()
        Returns the first cell in the selection. This is useful if there if only one item currently selected.
        Specified by:
        getSelectionCell in interface GraphSelectionModel
      • getSelectionCells

        public java.lang.Object[] getSelectionCells()
        Returns the cells in the selection. This will return null (or an empty array) if nothing is currently selected.
        Specified by:
        getSelectionCells in interface GraphSelectionModel
      • isCellSelected

        public boolean isCellSelected(java.lang.Object cell)
        Returns true if the cell, cell, is in the current selection.
        Specified by:
        isCellSelected in interface GraphSelectionModel
      • isChildrenSelected

        public boolean isChildrenSelected(java.lang.Object cell)
        Returns true if the cell, cell, has selected children.
        Specified by:
        isChildrenSelected in interface GraphSelectionModel
      • clearSelection

        public void clearSelection()
        Empties the current selection. If this represents a change in the current selection, the selection listeners are notified.
        Specified by:
        clearSelection in interface GraphSelectionModel
      • getListeners

        public java.util.EventListener[] getListeners(java.lang.Class listenerType)
        Returns an array of all the listeners of the given type that were added to this model.
        Returns:
        all of the objects receiving listenerType notifications from this model
        Since:
        1.3
      • addPropertyChangeListener

        public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
        Adds a PropertyChangeListener to the listener list. The listener is registered for all properties.

        A PropertyChangeEvent will get fired when the selection mode changes.

        Specified by:
        addPropertyChangeListener in interface GraphSelectionModel
        Parameters:
        listener - the PropertyChangeListener to be added
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
        Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.
        Specified by:
        removePropertyChangeListener in interface GraphSelectionModel
        Parameters:
        listener - the PropertyChangeListener to be removed
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns a clone of this object with the same selection. This method does not duplicate selection listeners and property listeners.
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException - never thrown by instances of this class

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.