public final class OptionalDependencies extends Object
widget-swing
module).Modifier and Type | Method and Description |
---|---|
static MutableTreeNode |
copy(TreeNode node)
Returns a copy of the tree starting at the given node.
|
static DefaultMutableTreeNode |
createTreeNode(String name,
Object object,
boolean allowsChildren)
Creates an initially empty tree node.
|
static void |
format(TreeModel tree,
Appendable buffer,
String lineSeparator)
Writes a graphical representation of the specified tree model in the given buffer.
|
static void |
format(TreeNode node,
Appendable buffer,
String lineSeparator)
Writes a graphical representation of the specified tree in the given buffer.
|
static void |
show(TreeModel tree,
String title)
Display the given tree in a Swing frame.
|
static void |
show(TreeNode node,
String title)
Display the given tree in a Swing frame.
|
static String |
toString(TreeModel tree)
Returns a graphical representation of the specified tree model.
|
static String |
toString(TreeNode node)
Returns a graphical representation of the specified tree.
|
static MutableTreeNode |
xmlToSwing(Node node)
Creates a Swing root tree node from a XML root tree node.
|
public static DefaultMutableTreeNode createTreeNode(String name, Object object, boolean allowsChildren)
name
- The value to be returned by TreeNode#toString
.object
- The user object to be returned by the tree node. May or may not be the same
than name
.allowsChildren
- if children are allowed.public static MutableTreeNode xmlToSwing(Node node)
toString(TreeNode)
, this method provides a convenient way to print the content of a XML
document for debugging purpose.
This method should not be defined here, since this class is about optional dependencies.
It should be defined in org.geotools.gui.swing.tree.Trees
instead. However we put it
here (for now) because it is used in some module that don't want to depend on widgets.
public static MutableTreeNode copy(TreeNode node)
tree
- The tree to copy (may be null
).null
if the tree was null.public static void format(TreeModel tree, Appendable buffer, String lineSeparator) throws IOException
This method should not be defined here, since this class is about optional dependencies.
It should be defined in org.geotools.gui.swing.tree.Trees
instead. However we put it
here (for now) because it is used in some module that don't want to depend on widgets.
tree
- The tree to format.buffer
- Where to format the tree.lineSeparator
- The line separator, or null
for the system default.IOException
- if an error occured while writting in the given buffer.public static void format(TreeNode node, Appendable buffer, String lineSeparator) throws IOException
This method should not be defined here, since this class is about optional dependencies.
It should be defined in org.geotools.gui.swing.tree.Trees
instead. However we put it
here (for now) because it is used in some module that don't want to depend on widgets.
node
- The root node of the tree to format.buffer
- Where to format the tree.lineSeparator
- The line separator, or null
for the system default.IOException
- if an error occured while writting in the given buffer.public static String toString(TreeModel tree)
This method should not be defined here, since this class is about optional dependencies.
It should be defined in org.geotools.gui.swing.tree.Trees
instead. However we put it
here (for now) because it is used in some module that don't want to depend on widgets.
tree
- The tree to format.null
if it doesn't contain any node.public static String toString(TreeNode node)
This method should not be defined here, since this class is about optional dependencies.
It should be defined in org.geotools.gui.swing.tree.Trees
instead. However we put it
here (for now) because it is used in some module that don't want to depend on widgets.
node
- The root node of the tree to format.null
if it doesn't contain any node.public static void show(TreeNode node, String title)
tree
- The tree to display in a Swing frame.title
- The frame title, or null
if none.Copyright © 1996–2019 Geotools. All rights reserved.