org.base.apps.util.view.swing
Class SwingUtil

java.lang.Object
  extended by org.base.apps.util.view.swing.SwingUtil

public class SwingUtil
extends Object

Utility Swing methods.

Author:
Kevan Simpson

Method Summary
static void collapse(JTree tree, TreePath path)
           
static void collapseAll(JTree tree)
           
static void display(JFrame frame, boolean exitOnClose)
          Packs, centers, and shows this frame, optionally adding close operation.
static void displayErrorDialog(String errMsg, Throwable t, String title)
          Displays an error dialog with the given message, title, and a stacktrace of the error, if passed.
static String encodeColor(Color c)
           
static void expand(JTree tree, TreePath path)
           
static void expandAll(JTree tree)
           
protected static void flexTree(JTree tree, TreePath parent, boolean expand)
           
static Color makeTransparent(Color c, float t)
          Returns a transparent version of the specified Color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

display

public static void display(JFrame frame,
                           boolean exitOnClose)
Packs, centers, and shows this frame, optionally adding close operation.

Parameters:
exitOnClose - true if frame should exit on close.

displayErrorDialog

public static void displayErrorDialog(String errMsg,
                                      Throwable t,
                                      String title)
Displays an error dialog with the given message, title, and a stacktrace of the error, if passed.

Parameters:
errMsg - The error message.
t - An option error, for which a stacktrace will be displayed.
title - The title on the dialog.

encodeColor

public static String encodeColor(Color c)

collapse

public static void collapse(JTree tree,
                            TreePath path)

collapseAll

public static void collapseAll(JTree tree)

expand

public static void expand(JTree tree,
                          TreePath path)

expandAll

public static void expandAll(JTree tree)

flexTree

protected static void flexTree(JTree tree,
                               TreePath parent,
                               boolean expand)

makeTransparent

public static Color makeTransparent(Color c,
                                    float t)
Returns a transparent version of the specified Color.

Parameters:
c - The given color.
t - The degree of transparency, between 0.0 and 1.0 inclusive.
Returns:
The transparent color.

Please visit Base Apps, hosted on Sourceforge.net.

Copyright 2011, Blue Agate Software Entity (BASE)