|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.doolin.gui.swing.SwingUtils
public class SwingUtils
Several utility methods for dealing with Swing.
| Nested Class Summary | |
|---|---|
static class |
SwingUtils.ClassComponentPredicate
Checks the class of a component |
| Field Summary | |
|---|---|
static int |
XOR_STROKE_WIDTH
Width of the stroke when drawing a shape |
| Method Summary | ||
|---|---|---|
static void |
copyToolbar(JToolBar targetBar,
JToolBar sourceBar)
Copies items of a tool bar to another tool bar |
|
static
|
createWindow(Class<T> windowClass,
Component parent)
Creates an instance of a frame or a dialog |
|
static void |
drawGrayShape(JComponent component,
Rectangle shape)
Draws a shape for a component |
|
static void |
drawXORShape(JComponent component,
Rectangle shape)
Draws an XOR shape in a component |
|
static Component |
findComponentInTree(Container parent,
com.google.common.base.Predicate<Component> predicate)
Recursively descends the parent container, applies the predicate to each component and returns the first one the predicate has returned true for. |
|
static void |
setTableColumnWidth(JTable table,
int column,
ValueUnit width,
boolean resizable)
Set the width of a column |
|
static Image |
toImage(Icon icon)
Creates an image from an icon. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int XOR_STROKE_WIDTH
drawXORShape(JComponent, Rectangle),
Constant Field Values| Method Detail |
|---|
public static void copyToolbar(JToolBar targetBar,
JToolBar sourceBar)
targetBar - Target tool barsourceBar - Source tool bar
public static <T> T createWindow(Class<T> windowClass,
Component parent)
T - Type of windowwindowClass - Class of Window to createparent - Parent component (can be null)
public static void drawGrayShape(JComponent component,
Rectangle shape)
component - Component to draw the shape intoshape - Shape to drawdrawXORShape(JComponent, Rectangle)
public static void drawXORShape(JComponent component,
Rectangle shape)
component - Component to draw the shape intoshape - Shape to draw
public static Component findComponentInTree(Container parent,
com.google.common.base.Predicate<Component> predicate)
true for.
parent - Parent containerpredicate - Test predicate
null
public static void setTableColumnWidth(JTable table,
int column,
ValueUnit width,
boolean resizable)
table - Tablecolumn - Column to setwidth - Width to setresizable - true if the column can be resizedpublic static Image toImage(Icon icon)
ImageIcon are accepted.
icon - Icon
null if not appliable.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||