com.tensegrity.gui.swing.dock.util
Class GuiCommon

java.lang.Object
  extended bycom.tensegrity.gui.swing.dock.util.GuiCommon

public class GuiCommon
extends java.lang.Object

Docking framework.

Author:
srutz

Method Summary
static java.lang.String abbreviatedString(java.lang.String s, int n)
          Abbreviates a string to n characters.
static boolean attemptLookAndFeel(java.lang.String klassname)
          Tries to set the given look and feel.
static void centerToParent(java.awt.Component c, java.awt.Component parent)
          Centers to parent.
static void centerToScreen(java.awt.Component c)
          Centers to screen.
static void configureDisposeOnEscape(javax.swing.JDialog dialog)
          Configures dispose on escape press.
static void configureDisposeOnEscape(javax.swing.JFrame frame)
          Configures dispose on escape press.
static void expandAll(javax.swing.JTree tree, boolean expand)
          Expands all nodes in a JTree.
static void expandAll(javax.swing.JTree tree, javax.swing.tree.TreePath parent, boolean expand)
          Expands all nodes in a JTree.
static java.awt.Component[] findChildrenOfClass(java.awt.Container c, java.lang.Class clazz)
          Finds children assignable to the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

centerToParent

public static final void centerToParent(java.awt.Component c,
                                        java.awt.Component parent)
Centers to parent.

Parameters:
c - the Component to center.
parent - the parent.

centerToScreen

public static final void centerToScreen(java.awt.Component c)
Centers to screen.

Parameters:
c - the Component to center.

configureDisposeOnEscape

public static final void configureDisposeOnEscape(javax.swing.JDialog dialog)
Configures dispose on escape press.

Parameters:
dialog - the dialog to configure.

configureDisposeOnEscape

public static final void configureDisposeOnEscape(javax.swing.JFrame frame)
Configures dispose on escape press.

Parameters:
frame - the frame to configure.

findChildrenOfClass

public static final java.awt.Component[] findChildrenOfClass(java.awt.Container c,
                                                             java.lang.Class clazz)
Finds children assignable to the given class.

Parameters:
c - the root of the search.
clazz - the clazz that must be assignable to.
Returns:
an array of found components.

expandAll

public static final void expandAll(javax.swing.JTree tree,
                                   boolean expand)
Expands all nodes in a JTree.

Parameters:
tree - the tree to expand
expand - whether to expand or collapse.

expandAll

public static final void expandAll(javax.swing.JTree tree,
                                   javax.swing.tree.TreePath parent,
                                   boolean expand)
Expands all nodes in a JTree.

Parameters:
tree - the tree to expand
parent - current search root.
expand - whether to expand or collapse.

abbreviatedString

public static final java.lang.String abbreviatedString(java.lang.String s,
                                                       int n)
Abbreviates a string to n characters.

Parameters:
s - the string to abbreviate.
n - the number of characters.
Returns:
the abbreviated string.

attemptLookAndFeel

public static boolean attemptLookAndFeel(java.lang.String klassname)
Tries to set the given look and feel.

Parameters:
klassname - LnF classname.
Returns:
whether setting the LnF succeeded or not.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.