Class AbstractTreeTableModel

java.lang.Object
org.jppf.ui.treetable.AbstractTreeTableModel
All Implemented Interfaces:
Serializable, TreeModel, TreeTableModel
Direct Known Subclasses:
AbstractJPPFTreeTableModel, FileSystemModel

public abstract class AbstractTreeTableModel extends Object implements TreeTableModel, Serializable
An abstract implementation of the TreeTableModel interface, handling the list of listeners.
Version:
%I% %G%
Author:
Philip Milne
See Also:
  • Field Details

    • root

      protected transient Object root
      The tree root.
    • listenerList

      protected transient EventListenerList listenerList
      The list of event listeners for this tree table model.
  • Constructor Details

    • AbstractTreeTableModel

      public AbstractTreeTableModel(Object root)
      Initialize this model with the specified tree root.
      Parameters:
      root - the root of the tree.
  • Method Details

    • getRoot

      public Object getRoot()
      Specified by:
      getRoot in interface TreeModel
    • isLeaf

      public boolean isLeaf(Object node)
      Specified by:
      isLeaf in interface TreeModel
    • valueForPathChanged

      public void valueForPathChanged(TreePath path, Object newValue)
      Specified by:
      valueForPathChanged in interface TreeModel
    • getIndexOfChild

      public int getIndexOfChild(Object parent, Object child)
      Specified by:
      getIndexOfChild in interface TreeModel
    • addTreeModelListener

      public void addTreeModelListener(TreeModelListener l)
      Specified by:
      addTreeModelListener in interface TreeModel
    • removeTreeModelListener

      public void removeTreeModelListener(TreeModelListener l)
      Specified by:
      removeTreeModelListener in interface TreeModel
    • fireTreeNodesChanged

      protected void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children)
      Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
      Parameters:
      source - the source of the event.
      path - the path of the parent node whose children have changed.
      childIndices - the indices of the children that changed.
      children - an array of the children that changed.
      See Also:
    • fireTreeNodesInserted

      protected void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
      Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
      Parameters:
      source - the source of the event.
      path - the path of the parent node whose children have changed.
      childIndices - the indices of the children that were inserted.
      children - an array of the children that were inserted.
      See Also:
    • fireTreeNodesRemoved

      protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
      Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
      Parameters:
      source - the source of the event.
      path - the path of the parent node whose children have changed.
      childIndices - the indices of the children that were removed.
      children - an array of the children that were removed.
      See Also:
    • fireTreeStructureChanged

      protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
      Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.
      Parameters:
      source - the source of the event.
      path - the path of the parent node whose children have changed.
      childIndices - the indices of the children that have changed.
      children - an array of the children that changed.
      See Also:
    • getColumnClass

      public Class<?> getColumnClass(int column)
      Description copied from interface: TreeTableModel
      Returns the type for column number column.
      Specified by:
      getColumnClass in interface TreeTableModel
      Parameters:
      column - the column number.
      Returns:
      the type of the column.
    • isCellEditable

      public boolean isCellEditable(Object node, int column)
      By default, make the column with the Tree in it the only editable one. Making this column editable causes the JTable to forward mouse and keyboard events in the Tree column to the underlying JTree. Indicates whether the the value for node node, at column number column is editable.
      Specified by:
      isCellEditable in interface TreeTableModel
      Parameters:
      node - the node to check.
      column - the column where the value is.
      Returns:
      true if the cell is editable, false otherwise.
    • setValueAt

      public void setValueAt(Object aValue, Object node, int column)
      Description copied from interface: TreeTableModel
      Sets the value for node node, at column number column.
      Specified by:
      setValueAt in interface TreeTableModel
      Parameters:
      aValue - the value to set.
      node - the node for which to set the value.
      column - the column where the value is to be set.
    • getColumnTooltip

      public String getColumnTooltip(int column)
      Description copied from interface: TreeTableModel
      Returns the tooltip for column number column.
      Specified by:
      getColumnTooltip in interface TreeTableModel
      Parameters:
      column - the column number.
      Returns:
      the name of the column as a string.