public class BasicTree extends WWObjectImpl implements Tree, PreRenderable
Tree
control.Modifier and Type | Field and Description |
---|---|
protected java.util.Set<TreePath> |
expandedNodes |
protected TreeLayout |
layout |
protected TreeModel |
model |
Constructor and Description |
---|
BasicTree()
Create an empty tree.
|
Modifier and Type | Method and Description |
---|---|
void |
collapsePath(TreePath path)
Collapse a path in the tree.
|
void |
expandPath(TreePath path)
Expand a path in the tree.
|
double |
getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point.
|
TreeLayout |
getLayout()
Get the tree layout.
|
TreeModel |
getModel()
Get the tree model.
|
TreeNode |
getNode(TreePath path)
Locate a node in the tree.
|
boolean |
isNodeExpanded(TreeNode node)
Is a node expanded?
|
boolean |
isPathExpanded(TreePath path)
Is a path expanded in the tree?
|
void |
makeVisible(TreePath path)
Make a node in the tree visible in the rendered tree.
|
void |
pick(DrawContext dc,
java.awt.Point pickPoint)
Executes a pick of the ordered renderable.
|
void |
preRender(DrawContext dc) |
void |
render(DrawContext dc)
Causes this
Renderable to render itself using the provided draw context. |
void |
setLayout(TreeLayout layout)
Set the tree layout.
|
void |
setModel(TreeModel model)
Set the tree model.
|
void |
togglePath(TreePath path)
Expand a collapsed path, or collapse an expanded path.
|
onMessage, propertyChange
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
protected java.util.Set<TreePath> expandedNodes
protected TreeLayout layout
protected TreeModel model
public void collapsePath(TreePath path)
collapsePath
in interface Tree
path
- Path to collapse.public void expandPath(TreePath path)
expandPath
in interface Tree
path
- Path to expand.public double getDistanceFromEye()
getDistanceFromEye
in interface OrderedRenderable
public TreeLayout getLayout()
getLayout
in interface Tree
Tree.setLayout(TreeLayout)
public TreeModel getModel()
getModel
in interface Tree
Tree.setModel(TreeModel)
public boolean isNodeExpanded(TreeNode node)
isNodeExpanded
in interface Tree
node
- Node to test.public boolean isPathExpanded(TreePath path)
isPathExpanded
in interface Tree
path
- Path to test.public void makeVisible(TreePath path)
makeVisible
in interface Tree
path
- Path to make visible.public void pick(DrawContext dc, java.awt.Point pickPoint)
pick
in interface OrderedRenderable
dc
- the current draw context.pickPoint
- the pick point.public void preRender(DrawContext dc)
preRender
in interface PreRenderable
public void render(DrawContext dc)
Renderable
to render itself using the provided draw context.render
in interface Renderable
dc
- the DrawContext
to be usedDrawContext
public void setLayout(TreeLayout layout)
setLayout
in interface Tree
layout
- New layout.Tree.getLayout()
public void setModel(TreeModel model)
setModel
in interface Tree
model
- New tree model.Tree.getModel()
public void togglePath(TreePath path)
togglePath
in interface Tree
path
- Path to operate on. If the node defined by path
is expanded, it will be collapsed. If it is
collapsed it will be expanded.