|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.programix.gui.GuiTools
public class GuiTools
| Field Summary | |
|---|---|
static Font |
NUMBER_FONT
|
static GridLayout |
ONE_CELL_GRID
|
| Method Summary | |
|---|---|
static void |
centerOnScreen(Window window)
Centers the specified window on the screen. |
static void |
centerOnTop(Window topWindow,
Window bottomWindow)
Centers topWindow over bottomWindow. |
static void |
clearGlobalFocus()
Removes focus from all components which allows keyboard navigation to still work. |
static JLabel |
createCenteredOpaqueLabel(String text)
|
static Border |
createCompoundBorder(Border outerBorder,
Border middleBorder,
Border innerBorder)
Combines 3 borders into 1 border. |
static ImageIcon |
createIcon(String imageResourceLocation)
Creates an ImageIcon from the data stored in the specified resource. |
static Border |
createSandwichBorder(int outerThickness,
int innerThickness,
Border middleBorder)
Creates an empty border for the outer border and an empty border for the inner border and then sandwiches the middle border in between. |
static JLabel |
createScaledLabel(String text,
double scale)
|
static TexturePaint |
createTexturePaint(String imageResourceLocation)
Creates a TexturePaint from the data stored in the specified resource. |
static Rectangle |
ensureOnScreen(Window window)
If necessary, window is shrunk and/or moved so that no part of it hangs off the edges of the screen. |
static Component[] |
getAllComponents(Container con)
Gets all the components contained (recursively). |
static FocusListener |
getSelectAllFocusListener()
Returns a sharable FocusListener that can be any to any
sublcass of JTextComponent. |
static Rectangle |
getUsableScreenBounds(Window window)
Returns the usable screen bounds for the screen where this window is currently residing. |
static Dimension |
getUsableScreenSize(Window window)
Returns the usable screen size for the screen where this window is currently residing. |
static void |
packAndCenterOnScreen(Window window)
Packs the specified window to get its preferred size, then centers it on the screen. |
static void |
packAndCenterOnTop(Window topWindow,
Window bottomWindow)
Packs the topWindow and then centers it over bottomWindow. |
static Component |
scaleFont(Component comp,
double scale)
|
static Font |
scaleFont(Font font,
double scale)
|
static void |
selectAllOnFocus(JTextComponent comp)
Adds a FocusListener to the specified JTextComponent
that selects all of the text when focus is gained. |
static void |
setAutoScrollToFocus(JScrollPane sp)
|
static void |
setEmptyBorder(JComponent target,
int thickness)
|
static void |
setPreferredColumnSizes(JTable table)
|
static void |
setPreferredColumnSizes(JTable table,
int minPrefWidth,
int maxPrefWidth,
int padding,
int maxRowsToExamine)
|
static void |
setPreferredSizeToLargest(JComponent[] comp)
|
static void |
setQualityHints(Graphics g)
|
static JScrollPane |
setScrollBackingStore(JScrollPane sp)
Forces viewport of scrollpane to use a backing store instead of the default "blit" that causes crud to show up on some screens. |
static void |
setSizeAndCenterOnScreen(Window window,
int width,
int height)
Sets the specified window to the specified size, then centers it on the screen. |
static void |
setSizeToMax(Window window)
Resizes and/or moves the specified window so that it fills all of the usable screen. |
static void |
useWindowDecorations()
Sets the look and feel hint for JFrame and JDialog that the entire window should try to use custom decorations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Font NUMBER_FONT
public static final GridLayout ONE_CELL_GRID
| Method Detail |
|---|
public static Rectangle getUsableScreenBounds(Window window)
public static Dimension getUsableScreenSize(Window window)
public static Rectangle ensureOnScreen(Window window)
window - the window to be moved and/or reduced in size.
public static void centerOnScreen(Window window)
public static void packAndCenterOnScreen(Window window)
public static void setSizeAndCenterOnScreen(Window window,
int width,
int height)
public static void setSizeToMax(Window window)
public static void centerOnTop(Window topWindow,
Window bottomWindow)
ensureOnScreen(Window) (as a result, the top window will always
be entirely on the visible screen—even at the sacrifice of
centering it over the bottom window).
public static void packAndCenterOnTop(Window topWindow,
Window bottomWindow)
ensureOnScreen(Window) (as a result, the top window will always
be entirely on the visible screen—even at the sacrifice of
centering it over the bottom window).
public static void useWindowDecorations()
JFrame.setDefaultLookAndFeelDecorated(boolean),
JDialog.setDefaultLookAndFeelDecorated(boolean)public static void clearGlobalFocus()
public static JLabel createScaledLabel(String text,
double scale)
public static JLabel createCenteredOpaqueLabel(String text)
public static Font scaleFont(Font font,
double scale)
public static Component scaleFont(Component comp,
double scale)
public static void setQualityHints(Graphics g)
public static JScrollPane setScrollBackingStore(JScrollPane sp)
public static void selectAllOnFocus(JTextComponent comp)
FocusListener to the specified JTextComponent
that selects all of the text when focus is gained. When the focus
is lost, none of the text remains selected.
public static FocusListener getSelectAllFocusListener()
FocusListener that can be any to any
sublcass of JTextComponent.
public static void setPreferredSizeToLargest(JComponent[] comp)
public static void setPreferredColumnSizes(JTable table,
int minPrefWidth,
int maxPrefWidth,
int padding,
int maxRowsToExamine)
public static void setPreferredColumnSizes(JTable table)
public static void setAutoScrollToFocus(JScrollPane sp)
public static Border createSandwichBorder(int outerThickness,
int innerThickness,
Border middleBorder)
public static Border createCompoundBorder(Border outerBorder,
Border middleBorder,
Border innerBorder)
public static void setEmptyBorder(JComponent target,
int thickness)
public static Component[] getAllComponents(Container con)
public static ImageIcon createIcon(String imageResourceLocation)
throws ImageTools.ImageNotFoundException,
ImageTools.ImageException
Equivalent to:
return new ImageIcon(
ImageTools.createImageFromResource(imageResourceLocation));
The exceptions declared to be thrown from this method are subclasses
of RuntimeException, so callers are not required to
catch them.
ImageTools.ImageNotFoundException
ImageTools.ImageException
public static TexturePaint createTexturePaint(String imageResourceLocation)
throws ImageTools.ImageNotFoundException,
ImageTools.ImageException
Equivalent to:
return new ImageIcon(
ImageTools.createImageFromResource(imageResourceLocation));
BufferedImage image =
ImageTools.createImageFromResource(imageResourceLocation);
return new TexturePaint(image, new Rectangle2D.Double(0, 0,
image.getWidth(), image.getHeight()));
The exceptions declared to be thrown from this method are subclasses
of RuntimeException, so callers are not required to
catch them.
ImageTools.ImageNotFoundException
ImageTools.ImageException
|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||