|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.swing.tree.BasicTreeModelEventSource
dsto.dfc.swing.tree.AbstractDfcTreeModel
public abstract class AbstractDfcTreeModel
Base class for clients implementing DfcTreeModel.
Constructor Summary | |
---|---|
AbstractDfcTreeModel()
|
Method Summary | |
---|---|
void |
addEntry(Object parent,
Object entry,
int index)
Add a child to parent at a given index. |
boolean |
canAddEntry(Object parent,
Object entry,
int index)
Test if a child can be added at a given index. |
boolean |
canCopyEntry(Object entry)
Test if an entry may be copied into a transferable. |
boolean |
canMoveEntry(Object entry,
Object newParent,
int newIndex)
|
boolean |
canPasteEntry(Object parent,
int index,
Transferable transferable)
Test if a transferable may be pasted. |
boolean |
canRemoveEntry(Object entry)
Test if an entry may be removed. |
Transferable |
copyEntry(Object entry)
Copy an entry into a transferable. |
abstract Object |
getChild(Object parent,
int index)
|
abstract int |
getChildCount(Object parent)
|
abstract int |
getIndexOfChild(Object parent,
Object child)
|
abstract Object |
getParent(Object entry)
Get the parent for a given entry, or null if the entry is the root. |
Object[] |
getPathForEntry(Object entry)
Basic implementation using getRoot () and getParent (). |
abstract Object |
getRoot()
|
boolean |
isAncestor(Object ancestor,
Object entry)
|
abstract boolean |
isLeaf(Object entry)
|
boolean |
isMutable()
True if the tree can be changed. |
void |
moveEntry(Object entry,
Object newParent,
int newIndex)
Move a child from one location to another. |
void |
pasteEntry(Object parent,
int index,
Transferable transferable)
Paste transferable data into the tree. |
void |
removeEntry(Object entry)
Remove an entry and any children. |
void |
valueForPathChanged(TreePath path,
Object newValue)
|
Methods inherited from class dsto.dfc.swing.tree.BasicTreeModelEventSource |
---|
addTreeModelListener, dispose, fireTreeNodeChanged, fireTreeNodeInserted, fireTreeNodeRemoved, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, fireTreeStructureChanged, getTreeModelListenerCount, removeTreeModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.tree.TreeModel |
---|
addTreeModelListener, removeTreeModelListener |
Constructor Detail |
---|
public AbstractDfcTreeModel()
Method Detail |
---|
public boolean isAncestor(Object ancestor, Object entry)
public abstract Object getRoot()
getRoot
in interface TreeModel
public abstract Object getChild(Object parent, int index)
getChild
in interface TreeModel
public abstract int getChildCount(Object parent)
getChildCount
in interface TreeModel
public abstract boolean isLeaf(Object entry)
isLeaf
in interface TreeModel
public abstract int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel
public abstract Object getParent(Object entry)
DfcTreeModel
getParent
in interface DfcTreeModel
public Object[] getPathForEntry(Object entry)
getPathForEntry
in interface DfcTreeModel
public boolean isMutable()
DfcTreeModel
isMutable
in interface DfcTreeModel
public boolean canAddEntry(Object parent, Object entry, int index)
DfcTreeModel
canAddEntry
in interface DfcTreeModel
parent
- The parent entry.entry
- The child entry.index
- The index to add the child at. Use -1 to add child
at end.public void addEntry(Object parent, Object entry, int index) throws UnsupportedOperationException, IndexOutOfBoundsException
DfcTreeModel
addEntry
in interface DfcTreeModel
parent
- The parent entry.entry
- The child entry.index
- The index to add the child at. Use -1 to add child
at end.
UnsupportedOperationException
IndexOutOfBoundsException
public boolean canRemoveEntry(Object entry)
DfcTreeModel
canRemoveEntry
in interface DfcTreeModel
public void removeEntry(Object entry) throws UnsupportedOperationException
DfcTreeModel
removeEntry
in interface DfcTreeModel
UnsupportedOperationException
public boolean canMoveEntry(Object entry, Object newParent, int newIndex)
canMoveEntry
in interface DfcTreeModel
public void moveEntry(Object entry, Object newParent, int newIndex) throws UnsupportedOperationException, IndexOutOfBoundsException
DfcTreeModel
moveEntry
in interface DfcTreeModel
UnsupportedOperationException
IndexOutOfBoundsException
public boolean canPasteEntry(Object parent, int index, Transferable transferable)
DfcTreeModel
canPasteEntry
in interface DfcTreeModel
parent
- The parent entry to paste at.index
- The index of the new entry in parent (may be -1 to
add last).transferable
- The data to paste.public void pasteEntry(Object parent, int index, Transferable transferable) throws UnsupportedOperationException, UnsupportedFlavorException, CloneNotSupportedException, IOException
DfcTreeModel
pasteEntry
in interface DfcTreeModel
parent
- The parent entry to paste at.index
- The index of the new entry in parent (may be -1 to
add last).transferable
- The data to paste.
UnsupportedOperationException
UnsupportedFlavorException
CloneNotSupportedException
IOException
public boolean canCopyEntry(Object entry)
DfcTreeModel
canCopyEntry
in interface DfcTreeModel
entry
- The entry to copy.public Transferable copyEntry(Object entry) throws UnsupportedOperationException, CloneNotSupportedException
DfcTreeModel
copyEntry
in interface DfcTreeModel
entry
- The entry to copy.
UnsupportedOperationException
CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |