org.PingOO.DLAI.lib.PWidget
Class DefaultPTreeModel
java.lang.Object
|
+--javax.swing.tree.DefaultTreeModel
|
+--org.PingOO.DLAI.lib.PWidget.DefaultPTreeModel
- Direct Known Subclasses:
- DirectoryTreeModel
- public class DefaultPTreeModel
- extends javax.swing.tree.DefaultTreeModel
The default model for a PTree.
A model is an abstract version of a tree.
- Since:
- PingOO 2.0
- Version:
- 2.0
- Author:
- Fabrice Bouyé (bouye@cur-archamps.fr)
- See Also:
DefaultTreeModel, Serialized Form
|
Field Summary |
protected boolean |
autoSort
Indicates if this model automatically sort the directory component when a new one is inserted. |
| Fields inherited from class javax.swing.tree.DefaultTreeModel |
asksAllowsChildren,
listenerList,
root |
|
Constructor Summary |
DefaultPTreeModel(javax.swing.tree.DefaultMutableTreeNode root)
Creates a tree in which any node can have children. |
DefaultPTreeModel(javax.swing.tree.DefaultMutableTreeNode root,
boolean askAllowChildre)
Creates a tree in which any node can have children. |
DefaultPTreeModel(javax.swing.tree.DefaultMutableTreeNode root,
boolean askAllowChildre,
boolean autoSort)
Creates a tree in which any node can have children. |
|
Method Summary |
void |
insertNodeInto(javax.swing.tree.MutableTreeNode newChild,
javax.swing.tree.MutableTreeNode parent)
Invoked this to insert newChild in parents children.
|
void |
insertNodeInto(javax.swing.tree.MutableTreeNode newChild,
javax.swing.tree.MutableTreeNode parent,
int index)
Invoked this to insert newChild at location index in parents children.
|
void |
insertNodeInto(javax.swing.tree.MutableTreeNode newChild,
javax.swing.tree.MutableTreeNode parent,
int index,
boolean doSort)
Invoked this to insert newChild at location index in parents children.
|
boolean |
setAutoSort()
|
void |
setAutoSort(boolean value)
|
void |
sortNode(javax.swing.tree.DefaultMutableTreeNode node)
|
void |
sortTree()
|
void |
sortTree(javax.swing.tree.DefaultMutableTreeNode node)
|
| Methods inherited from class javax.swing.tree.DefaultTreeModel |
addTreeModelListener,
asksAllowsChildren,
fireTreeNodesChanged,
fireTreeNodesInserted,
fireTreeNodesRemoved,
fireTreeStructureChanged,
getChild,
getChildCount,
getIndexOfChild,
getPathToRoot,
getPathToRoot,
getRoot,
isLeaf,
nodeChanged,
nodesChanged,
nodeStructureChanged,
nodesWereInserted,
nodesWereRemoved,
readObject,
reload,
reload,
removeNodeFromParent,
removeTreeModelListener,
setAsksAllowsChildren,
setRoot,
valueForPathChanged,
writeObject |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
autoSort
protected boolean autoSort
- Indicates if this model automatically sort the directory component when a new one is inserted.
DefaultPTreeModel
public DefaultPTreeModel(javax.swing.tree.DefaultMutableTreeNode root)
- Creates a tree in which any node can have children.
- Parameters:
root - A tree node object that is the root of the tree
DefaultPTreeModel
public DefaultPTreeModel(javax.swing.tree.DefaultMutableTreeNode root,
boolean askAllowChildre)
- Creates a tree in which any node can have children.
- Parameters:
root - A tree node object that is the root of the treeaskAllowChildrea - A boolean, false if any node can have children, true if each node is asked to see if it can have children
DefaultPTreeModel
public DefaultPTreeModel(javax.swing.tree.DefaultMutableTreeNode root,
boolean askAllowChildre,
boolean autoSort)
- Creates a tree in which any node can have children.
- Parameters:
root - A tree node object that is the root of the treeaskAllowChildrea - A boolean, false if any node can have children, true if each node is asked to see if it can have childrenautoSort - If true the model will automatically sort the nodes when inserting a new one.
insertNodeInto
public void insertNodeInto(javax.swing.tree.MutableTreeNode newChild,
javax.swing.tree.MutableTreeNode parent)
- Invoked this to insert newChild in parents children.
This will then message nodesWereInserted to create the appropriate event.
This is the preferred way to add children as it will create the appropriate event.
- Parameters:
newChild - parent -
insertNodeInto
public void insertNodeInto(javax.swing.tree.MutableTreeNode newChild,
javax.swing.tree.MutableTreeNode parent,
int index)
- Invoked this to insert newChild at location index in parents children.
This will then message nodesWereInserted to create the appropriate event.
This is the preferred way to add children as it will create the appropriate event.
- Parameters:
newChild - parent - index - - Overrides:
- insertNodeInto in class javax.swing.tree.DefaultTreeModel
insertNodeInto
public void insertNodeInto(javax.swing.tree.MutableTreeNode newChild,
javax.swing.tree.MutableTreeNode parent,
int index,
boolean doSort)
- Invoked this to insert newChild at location index in parents children.
This will then message nodesWereInserted to create the appropriate event.
This is the preferred way to add children as it will create the appropriate event.
- Parameters:
newChild - parent - index - doSort -
setAutoSort
public void setAutoSort(boolean value)
setAutoSort
public boolean setAutoSort()
sortTree
public void sortTree()
sortTree
public void sortTree(javax.swing.tree.DefaultMutableTreeNode node)
sortNode
public void sortNode(javax.swing.tree.DefaultMutableTreeNode node)