Class OptionalDependencies
widget-swing
module).- Since:
- 2.0
- Author:
- Martin Desruisseaux (IRD)
-
Method Summary
Modifier and TypeMethodDescriptionstatic MutableTreeNode
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
Display the given tree in a Swing frame.static void
Display the given tree in a Swing frame.static String
Returns a graphical representation of the specified tree model.static String
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.
-
Method Details
-
createTreeNode
public static DefaultMutableTreeNode createTreeNode(String name, Object object, boolean allowsChildren) Creates an initially empty tree node.- Parameters:
name
- The value to be returned byTreeNode#toString
.object
- The user object to be returned by the tree node. May or may not be the same thanname
.allowsChildren
- if children are allowed.
-
xmlToSwing
Creates a Swing root tree node from a XML root tree node. Together withtoString(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. -
copy
Returns a copy of the tree starting at the given node.- Parameters:
node
- The tree to copy (may benull
).- Returns:
- A mutable copy of the given tree, or
null
if the tree was null. - Since:
- 2.5
-
format
public static void format(TreeModel tree, Appendable buffer, String lineSeparator) throws IOException Writes a graphical representation of the specified tree model in the given buffer.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.- Parameters:
tree
- The tree to format.buffer
- Where to format the tree.lineSeparator
- The line separator, ornull
for the system default.- Throws:
IOException
- if an error occured while writting in the given buffer.- Since:
- 2.5
-
format
public static void format(TreeNode node, Appendable buffer, String lineSeparator) throws IOException Writes a graphical representation of the specified tree in the given buffer.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.- Parameters:
node
- The root node of the tree to format.buffer
- Where to format the tree.lineSeparator
- The line separator, ornull
for the system default.- Throws:
IOException
- if an error occured while writting in the given buffer.- Since:
- 2.5
-
toString
Returns a graphical representation of the specified tree model. This representation can be printed to the standard output stream (for example) if it uses a monospaced font and supports unicode.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.- Parameters:
tree
- The tree to format.- Returns:
- A string representation of the tree, or
null
if it doesn't contain any node.
-
toString
Returns a graphical representation of the specified tree. This representation can be printed to the standard output stream (for example) if it uses a monospaced font and supports unicode.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.- Parameters:
node
- The root node of the tree to format.- Returns:
- A string representation of the tree, or
null
if it doesn't contain any node.
-
show
Display the given tree in a Swing frame. This is a convenience method for debugging purpose only.- Parameters:
node
- The tree to display in a Swing frame.title
- The frame title, ornull
if none.- Since:
- 2.5
-
show
Display the given tree in a Swing frame. This is a convenience method for debugging purpose only.- Parameters:
tree
- The tree to display in a Swing frame.title
- The frame title, ornull
if none.- Since:
- 2.5
-