- 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 classThrown when an invalid move is attempted. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDemote(Collection<TreePath> pPaths) booleancanMoveDown(Collection<TreePath> pPaths) booleancanMoveUp(Collection<TreePath> pPaths) booleancanPromote(Collection<TreePath> pPaths) voiddemote(Collection<TreePath> pPaths) Move nodes one level further from the root.voidmoveDown(Collection<TreePath> pPaths) Move nodes one space lower (swap with successors).voidmoveUp(Collection<TreePath> pPaths) Move nodes one space higher (swap with predecessors).voidpromote(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
-