|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.util.gui.GuiUtilFns
public class GuiUtilFns
Class GuiUtilFns defines a set of various static utility methods for use in GUI applications.
Field Summary | |
---|---|
static int |
DEF_PAD_WIDTH
The default pad width for components that sometimes require it, such as 'JComboBox'. |
static char |
defaultWidthChar
The default width character, m. |
Method Summary | |
---|---|
static void |
ensureRowVisible(javax.swing.JTable tableObj,
int row)
Ensures that the specified table row is visible. |
static void |
ensureSelectionVisible(javax.swing.JTable tableObj)
Ensures that the current table selection is visible. |
static int |
getExtendedFrameState(java.awt.Frame frameObj)
Returns the "extended" state of the given frame. |
static int |
getFrameMaximizedBothValue()
Returns the value of Frame.MAXIMIZED_BOTH. |
static int |
getMaxCharWidth(java.awt.Component compObj)
Returns the maximum width, in pixels, of the default width character. |
static int |
getMaxCharWidth(java.awt.Component compObj,
char widthChar)
Returns the maximum width, in pixels, of the specified width character. |
static int |
getMaxCharWidth(java.awt.Component compObj,
java.lang.String specialChars,
boolean allowedFlag)
Returns the maximum width, in pixels, of an allowed character. |
static int |
getMaxCharWidth(java.awt.Component compObj,
com.isti.util.gui.textvalidator.TextValidator tv)
Returns the maximum width, in pixels, of an allowed character. |
static IstiNamedValue |
getMaxCharWidthValue(java.awt.Component compObj,
java.lang.String specialChars,
boolean allowedFlag)
Returns the maximum width, in pixels, of an allowed character. |
static java.awt.Rectangle |
getMaximumWindowBounds()
Returns the maximum bounds for centered windows. |
static java.lang.String |
getSpacerStrForWidth(int widthVal,
java.awt.Component compObj)
Generates a spacer string containing the maximum number of space characters that will fit within the given pixel width, using the given component. |
static java.lang.String |
getSpacerStrForWidth(int widthVal,
java.awt.Component compObj,
java.awt.Font fontObj)
Generates a spacer string containing the maximum number of space characters that will fit within the given pixel width, using the given component and font. |
static java.lang.String |
getSpacerStrForWidth(int widthVal,
java.awt.Component compObj,
java.awt.Font fontObj,
int defWidthVal)
Generates a spacer string containing the maximum number of space characters that will fit within the given pixel width, using the given component and font. |
static java.lang.String |
getSpacerStrForWidth(int widthVal,
java.awt.Component compObj,
int defWidthVal)
Generates a spacer string containing the maximum number of space characters that will fit within the given pixel width, using the given component. |
static java.lang.String |
getSpacerStrForWidth(int widthVal,
int spaceCharSize)
Generates a spacer string containing the maximum number of space characters that will fit within the given pixel width. |
static int |
getStringWidth(java.awt.Component compObj,
java.awt.Font fontObj,
java.lang.String str)
Returns the width, in pixels, of the given string. |
static int |
getStringWidth(java.awt.Component compObj,
java.awt.Font fontObj,
java.lang.String str,
int defWidthVal)
Returns the width, in pixels, of the given string. |
static int |
getStringWidth(java.awt.Component compObj,
java.lang.String str)
Returns the width, in pixels, of the given string. |
static int |
getStringWidth(java.awt.Component compObj,
java.lang.String str,
int defWidthVal)
Returns the width, in pixels, of the given string. |
static int |
getStringWidth(java.awt.Font fontObj,
java.lang.String str)
Returns the width, in pixels, of the given string. |
static int |
getStringWidth(java.awt.Font fontObj,
java.lang.String str,
int defWidthVal)
Returns the width, in pixels, of the given string. |
static int |
getStringWidth(java.lang.String str)
Returns the width, in pixels, of the given string. |
static int |
getStringWidth(java.lang.String str,
int defWidthVal)
Returns the width, in pixels, of the given string. |
static void |
initColumnSizes(javax.swing.JTable tableObj)
|
static boolean |
isFrameMaximized(java.awt.Frame frameObj)
Determines if the given frame is maximized (both horizontally and vertically). |
static boolean |
maximizeFrame(java.awt.Frame frameObj)
Sets the state of the given frame to "maximized" (both horizontally and vertically). |
static void |
setButtonsContentAreaFilled(java.awt.Container contObj,
boolean flgVal)
Calls the 'setContentAreaFilled()' method on all button objects held by the given container or any subcontainers of it. |
static void |
setEmptyJListWidth(javax.swing.JList listObj,
int widthVal)
Sets the fixed cell width that the given 'JList' is to have when its contents are empty. |
static boolean |
setExtendedFrameState(java.awt.Frame frameObj,
int stateVal)
Sets the "extended" state of the given frame. |
static boolean |
setPreferredSize(java.awt.Component compObj,
java.awt.Dimension dimObj)
Sets the preferred size of the given component to a constant value. |
static void |
setPreferredSize(java.awt.Component compObj,
int maxNumChars,
int maxCharWidth)
Set the preferred size for the component. |
static void |
setPreferredSize(java.awt.Component compObj,
int maxNumChars,
int maxCharWidth,
int padWidth)
Set the preferred size for the component. |
static void |
setPreferredSize(java.awt.Component compObj,
com.isti.util.gui.textvalidator.TextValidator tv)
Set the preferred size for the component. |
static void |
setPreferredSize(javax.swing.JComponent compObj,
int maxNumChars)
Set the preferred size for the component. |
static void |
setScrollPaneCentered(javax.swing.JScrollPane paneObj)
Sets the given scroll-pane to have its scroll-bars centered. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char defaultWidthChar
public static int DEF_PAD_WIDTH
Method Detail |
---|
public static void ensureSelectionVisible(javax.swing.JTable tableObj)
tableObj
- the table object.public static void ensureRowVisible(javax.swing.JTable tableObj, int row)
tableObj
- the table object.row
- the row index.public static int getMaxCharWidth(java.awt.Component compObj)
compObj
- the component to use.
public static int getMaxCharWidth(java.awt.Component compObj, char widthChar)
compObj
- the component to use.widthChar
- the width character.
public static int getMaxCharWidth(java.awt.Component compObj, java.lang.String specialChars, boolean allowedFlag)
compObj
- the component to use.specialChars
- the allowed (or not allowed) special characters.allowedFlag
- true to allow only the special characters, false to not
allow the special characters.
public static IstiNamedValue getMaxCharWidthValue(java.awt.Component compObj, java.lang.String specialChars, boolean allowedFlag)
compObj
- the component to use.specialChars
- the allowed (or not allowed) special characters.allowedFlag
- true to allow only the special characters, false to not
allow the special characters.
public static int getMaxCharWidth(java.awt.Component compObj, com.isti.util.gui.textvalidator.TextValidator tv)
compObj
- the component to use.tv
- the text validator.
public static int getStringWidth(java.awt.Component compObj, java.awt.Font fontObj, java.lang.String str, int defWidthVal)
compObj
- the component to use, or null to use a default
'JLabel' object.fontObj
- the font to use, or null to use the font from the
given component object.str
- the string to use.defWidthVal
- a default width value to be returned if an error
occurs while calculating the width.
public static int getStringWidth(java.awt.Component compObj, java.lang.String str, int defWidthVal)
compObj
- the component to use, or null to use a default
'JLabel' object.str
- the string to use.defWidthVal
- a default width value to be returned if an error
occurs while calculating the width.
public static int getStringWidth(java.awt.Font fontObj, java.lang.String str, int defWidthVal)
fontObj
- the font to use, or null to use the font from the
given component object.str
- the string to use.defWidthVal
- a default width value to be returned if an error
occurs while calculating the width.
public static int getStringWidth(java.awt.Component compObj, java.awt.Font fontObj, java.lang.String str)
compObj
- the component to use, or null to use a default
'JLabel' object.fontObj
- the font to use, or null to use the font from the
given component object.str
- the string to use.
public static int getStringWidth(java.awt.Font fontObj, java.lang.String str)
fontObj
- the font to use, or null to use the font from the
given component object.str
- the string to use.
public static int getStringWidth(java.awt.Component compObj, java.lang.String str)
compObj
- the component to use, or null to use a default
'JLabel' object.str
- the string to use.
public static int getStringWidth(java.lang.String str, int defWidthVal)
str
- the string to use.defWidthVal
- a default width value to be returned if an error
occurs while calculating the width.
public static int getStringWidth(java.lang.String str)
str
- the string to use.
public static java.lang.String getSpacerStrForWidth(int widthVal, int spaceCharSize)
widthVal
- the pixel width to use.spaceCharSize
- the size (in pixels) of a space character to use,
or 0 to use a default size.
public static java.lang.String getSpacerStrForWidth(int widthVal, java.awt.Component compObj, java.awt.Font fontObj, int defWidthVal)
widthVal
- the pixel width to use.compObj
- the component to use, or null to use a default
'JLabel' object.fontObj
- the font to use, or null to use the font from the
given component object.defWidthVal
- a default width value for the size of space
character in pixels (used if an error occurs while determining the
size).
public static java.lang.String getSpacerStrForWidth(int widthVal, java.awt.Component compObj, java.awt.Font fontObj)
widthVal
- the pixel width to use.compObj
- the component to use, or null to use a default
'JLabel' object.fontObj
- the font to use, or null to use the font from the
given component object.
public static java.lang.String getSpacerStrForWidth(int widthVal, java.awt.Component compObj, int defWidthVal)
widthVal
- the pixel width to use.compObj
- the component to use, or null to use a default
'JLabel' object.defWidthVal
- a default width value for the size of space
character in pixels (used if an error occurs while determining the
size).
public static java.lang.String getSpacerStrForWidth(int widthVal, java.awt.Component compObj)
widthVal
- the pixel width to use.compObj
- the component to use, or null to use a default
'JLabel' object.
public static void setScrollPaneCentered(javax.swing.JScrollPane paneObj)
paneObj
- the scroll-pane object to use.public static void setEmptyJListWidth(javax.swing.JList listObj, int widthVal)
listObj
- the 'JList' to use.widthVal
- the width value to use.public static int getExtendedFrameState(java.awt.Frame frameObj)
frameObj
- 'Frame' object to use.
public static boolean setExtendedFrameState(java.awt.Frame frameObj, int stateVal)
frameObj
- 'Frame' object to use.stateVal
- frame-state-bitmap value to use.
public static void initColumnSizes(javax.swing.JTable tableObj)
public static boolean isFrameMaximized(java.awt.Frame frameObj)
frameObj
- 'Frame' object to use.
public static boolean maximizeFrame(java.awt.Frame frameObj)
frameObj
- 'Frame' object to use.
public static int getFrameMaximizedBothValue()
public static java.awt.Rectangle getMaximumWindowBounds()
public static boolean setPreferredSize(java.awt.Component compObj, java.awt.Dimension dimObj)
compObj
- 'Component' object to use.dimObj
- The new preferred size, or null.
public static final void setPreferredSize(java.awt.Component compObj, int maxNumChars, int maxCharWidth)
compObj
- the component.maxNumChars
- the maximum number of characters.maxCharWidth
- the maximum character width.public static final void setPreferredSize(java.awt.Component compObj, int maxNumChars, int maxCharWidth, int padWidth)
compObj
- the component.maxNumChars
- the maximum number of characters.maxCharWidth
- the maximum character width.padWidth
- the pad width or 0 if none.public static final void setPreferredSize(javax.swing.JComponent compObj, int maxNumChars)
compObj
- the component.maxNumChars
- the maximum number of characters.public static final void setPreferredSize(java.awt.Component compObj, com.isti.util.gui.textvalidator.TextValidator tv)
compObj
- the component.tv
- the text validator.public static void setButtonsContentAreaFilled(java.awt.Container contObj, boolean flgVal)
contObj
- container to use.flgVal
- true for content filled; false for not.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |