- All Superinterfaces:
TreeModel
- All Known Implementing Classes:
AbstractRearrangeableTreeModel
,DefaultRearrangeableTreeModel
Tree model in which nodes can be moved left, right, up and/or down.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Thrown when an invalid move is attempted. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDemote
(Collection<TreePath> pPaths) boolean
canMoveDown
(Collection<TreePath> pPaths) boolean
canMoveUp
(Collection<TreePath> pPaths) boolean
canPromote
(Collection<TreePath> pPaths) void
demote
(Collection<TreePath> pPaths) Move nodes one level further from the root.void
moveDown
(Collection<TreePath> pPaths) Move nodes one space lower (swap with successors).void
moveUp
(Collection<TreePath> pPaths) Move nodes one space higher (swap with predecessors).void
promote
(Collection<TreePath> pPaths) Move nodes one level closer to the root.Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged
-
Method Details
-
canPromote
-
canDemote
-
canMoveUp
-
canMoveDown
-
promote
Move nodes one level closer to the root. All children should be promoted along with the parent. If pPaths includes both a path and a sub-path, the former promotion occurs first.- A
- B
- C
- D
- E
- F
- G
Promote[AD] Promote [AD, ADF] - A
- B
- C
- D
- E
- F
- G
- A
- B
- C
- D
- E
- G
- F
- Parameters:
pPaths
- Paths to be moved.- Throws:
UnsupportedOperationException
- If implementor does not allow promotions.RearrangeableTreeModel.IllegalNodeMoveException
-
demote
Move nodes one level further from the root. If pPaths includes both a path and a sub-path, the former promotion occurs first.- Parameters:
pPaths
- Paths to be moved.- Throws:
UnsupportedOperationException
- If implementor does not allow promotions.RearrangeableTreeModel.IllegalNodeMoveException
-
moveUp
Move nodes one space higher (swap with predecessors).- Parameters:
pPaths
- Paths to be moved.- Throws:
UnsupportedOperationException
- If implementor does not allow promotions.RearrangeableTreeModel.IllegalNodeMoveException
-
moveDown
Move nodes one space lower (swap with successors).- Parameters:
pPaths
- Paths to be moved.- Throws:
UnsupportedOperationException
- If implementor does not allow promotions.RearrangeableTreeModel.IllegalNodeMoveException
-