|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jeta.open.gui.utils.JETAToolbox
public class JETAToolbox
Some common utility functions for GUI stuff.
Field Summary | |
---|---|
static String |
APPLICATION_FRAME
|
static String |
WINDOWS_LF
|
Constructor Summary | |
---|---|
JETAToolbox()
|
Method Summary | |
---|---|
static void |
addItems(JComboBox cbox,
Object[] items)
Adds an array or collection of items to a combo box |
static int |
calculateAverageTextWidth(Component comp,
int numCharacters)
Calculates the width of an average string of text. |
static void |
calculateReasonableComponentSize(Dimension d)
Sets the size of the dimension to some reasonable value. |
static void |
centerFrame(Window frame,
float xpctWidth,
float ypctWidth)
This method centers and sizes a frame window on the screen. |
static void |
centerWindow(Window frame)
This method centers a window window on the screen. |
static void |
centerWindowChangeWidth(Window frame,
float xpctWidth)
This method centers a window window and changes the width on the screen. |
static void |
copyToClipboard(String str)
Copies to the clipboard the given string |
static Dialog |
createDialog(Class dlgclass,
Component owner,
boolean bModal)
This method creates a dialog of the type class. |
static int |
getFrameBorderThickness()
|
static int |
getTitleBarHeight()
|
static JETADialog |
invokeDialog(JETAPanel view,
Component owner,
String title)
Creates and displays a model JETADialog using the given view as the content pane. |
static JETADialog |
invokeDialog(JETAPanel view,
Component owner,
String title,
JComponent initialFocus)
Creates and displays a model JETADialog using the given view as the content pane. |
static boolean |
isAquaLookAndFeel()
Returns true if running OS X Aqua look and feel. |
static boolean |
isOSX()
|
static boolean |
isWindows()
|
static boolean |
isWindowsLookAndFeel()
|
static void |
setReasonableWindowSize(Component window,
Dimension d)
Sets the size of the given window to the passed in dimension. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String APPLICATION_FRAME
public static final String WINDOWS_LF
Constructor Detail |
---|
public JETAToolbox()
Method Detail |
---|
public static void addItems(JComboBox cbox, Object[] items)
public static int calculateAverageTextWidth(Component comp, int numCharacters)
comp
- the component whose font metrics will determine the widthnumCharacters
- the number of characters to use to calculate the lengthpublic static void calculateReasonableComponentSize(Dimension d)
d
- the dimension of the window to setpublic static void centerFrame(Window frame, float xpctWidth, float ypctWidth)
public static void centerWindow(Window frame)
public static void centerWindowChangeWidth(Window frame, float xpctWidth)
public static void copyToClipboard(String str)
public static Dialog createDialog(Class dlgclass, Component owner, boolean bModal)
dlgclass
- the class of the dialog we want to createowner
- the owner of the new dialog. This object can be indirectly an
owner. For example, you can pass in a JPanel as the owner.
This method will detect this and get the appropriate owner of
the JPanelbModal
- true if you want the dialog to be modalpublic static int getFrameBorderThickness()
public static int getTitleBarHeight()
public static JETADialog invokeDialog(JETAPanel view, Component owner, String title)
public static JETADialog invokeDialog(JETAPanel view, Component owner, String title, JComponent initialFocus)
view
- the main content panel for the dialogtitle
- the dialog's titleinitialFocus
- the component that will have the initial focuspublic static boolean isAquaLookAndFeel()
public static boolean isOSX()
public static boolean isWindows()
public static boolean isWindowsLookAndFeel()
public static void setReasonableWindowSize(Component window, Dimension d)
window
- the window whose size we are settingd
- the dimension of the window to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |