|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
com.threerings.swing.PrefsTree
public class PrefsTree
Provides a mechanism for Preferences-backed persistent storage of a tree of exportable
objects. Each internal node in the tree corresponds to a Preferences node underneath
the root passed to the constructor, and each leaf node corresponds to a property set in its
parent's Preferences node (with the value of the property being equal to the exported
bytes of the node's object). The tree displays the nodes in sorted order, and allows editing
the nodes' names and dragging and dropping nodes within the tree (adjusting names as necessary
to ensure uniqueness). To keep the contents of the tree synchronized with the preferences,
only use the removeNodeFromParent(com.threerings.swing.PrefsTreeNode) and insertNodeInto(com.threerings.swing.PrefsTreeNode, com.threerings.swing.PrefsTreeNode) methods to modify the
tree. Currently, the tree will not reflect external changes made to the preferences.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTree |
|---|
JTree.DropLocation, JTree.DynamicUtilTreeNode |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PrefsTree(Preferences prefs)
Creates a new preferences tree. |
|
| Method Summary | |
|---|---|
PrefsTreeNode |
getRootNode()
Returns a reference to the root node. |
PrefsTreeNode |
getSelectedNode()
Returns a reference to the selected node, if any. |
void |
insertNewNode(String name,
Object value)
Inserts a new node and starts editing it. |
void |
insertNodeInto(PrefsTreeNode node,
PrefsTreeNode parent)
Inserts the specified node and updates the underlying preferences accordingly. |
void |
removeNodeFromParent(PrefsTreeNode node)
Removes the specified node from its parent and updates the underlying preferences accordingly. |
void |
removeSelectedNode()
Removes the selected node and adjusts the selection sensibly. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PrefsTree(Preferences prefs)
| Method Detail |
|---|
public PrefsTreeNode getRootNode()
public PrefsTreeNode getSelectedNode()
public void insertNewNode(String name,
Object value)
public void removeSelectedNode()
public void removeNodeFromParent(PrefsTreeNode node)
public void insertNodeInto(PrefsTreeNode node,
PrefsTreeNode parent)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||