public class GuiUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ABOVE
Place one component above another.
|
static int |
BELOW
Place one component below another.
|
static int |
BOTTOM_EDGES
Align bottom edges.
|
static int |
CENTER
Align centers.
|
static int |
LEFT
Place one component completely to the left of another.
|
static int |
LEFT_EDGES
Align left edges.
|
static int |
RIGHT
Place one component completely to the right of another.
|
static int |
RIGHT_EDGES
Align right edges.
|
static int |
TOP_EDGES
Align top edges.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
containsComponent(java.awt.Container parent,
java.awt.Component comp) |
static boolean |
containsMenuComponent(javax.swing.JMenu parent,
java.awt.Component comp) |
static java.awt.Component |
createBoxFiller() |
static javax.swing.JMenuItem |
createMenuItem(java.awt.event.ActionListener listener,
java.lang.String cmd,
java.lang.String toolTip) |
static javax.swing.border.TitledBorder |
createTitledPanelBorder(java.lang.String title) |
static java.awt.Rectangle |
getScreenBounds(java.awt.Component ref)
Gets the current screen bounds of a component.
|
static java.awt.Point |
getScreenLocation(java.awt.Component ref,
double xr,
double yr)
Gets the current screen location of a specified point within a reference
component.
|
static java.awt.Rectangle |
getVirtualScreenBounds() |
static int |
indexOfComponent(java.awt.Container parent,
java.awt.Component comp) |
static int |
indexOfMenuComponent(javax.swing.JMenu parent,
java.awt.Component comp) |
static javax.swing.ImageIcon |
loadIcon(java.lang.Object ref,
java.lang.String path) |
static void |
locateAbove(java.awt.Window win,
java.awt.Component ref)
Locates a window above the window containing a specified reference
component.
|
static void |
locateBelow(java.awt.Window win,
java.awt.Component ref)
Locates a window below the window containing a specified reference
component.
|
static void |
locateCenter(java.awt.Window win,
java.awt.Component ref)
Center a window on the window containing a specified
reference component.
|
static void |
locateHorizontally(java.awt.Window win,
java.awt.Component ref,
int location)
Sets the horizonal position of a window relative to another component.
|
static void |
locateLeft(java.awt.Window win,
java.awt.Component ref)
Locates a window to the left of the window containing a specified
reference component.
|
static void |
locateRelative(java.awt.Window win,
java.awt.Rectangle bounds,
double px,
double py,
double wx,
double wy)
Locates a window relative to a given set of screen bounds.
|
static void |
locateRight(java.awt.Window win,
java.awt.Component ref)
Locates a window to the right of the window containing a specified
reference component.
|
static void |
locateVertically(java.awt.Window win,
java.awt.Component ref,
int location)
Sets the vertical position of a window relative to another component.
|
static void |
repackComponentWindow(java.awt.Component c) |
static void |
setFixedHeight(java.awt.Component comp,
int h)
Sets the height of a component to a rigidly fixed value
|
static void |
setFixedSize(java.awt.Component comp,
java.awt.Dimension size)
Sets the size of a component to be a rigidly fixed as we possibly can.
|
static void |
setFixedSize(java.awt.Component comp,
int w,
int h)
Sets the size of a component to be a rigidly fixed as we possibly can.
|
static void |
setFixedWidth(java.awt.Component comp,
int w)
Sets the width of a component to a rigidly fixed value
|
static void |
setItalicFont(javax.swing.JComponent jcomp) |
public static final int CENTER
public static final int LEFT_EDGES
public static final int RIGHT_EDGES
public static final int LEFT
public static final int RIGHT
public static final int TOP_EDGES
public static final int BOTTOM_EDGES
public static final int ABOVE
public static final int BELOW
public static void setFixedSize(java.awt.Component comp, java.awt.Dimension size)
public static void setFixedSize(java.awt.Component comp, int w, int h)
public static void setFixedWidth(java.awt.Component comp, int w)
public static void setFixedHeight(java.awt.Component comp, int h)
public static java.awt.Component createBoxFiller()
public static java.awt.Point getScreenLocation(java.awt.Component ref, double xr, double yr)
ref
- reference componentxr
- normalized horizontal point locationyr
- normalized vertical point locationpublic static java.awt.Rectangle getScreenBounds(java.awt.Component ref)
public static void locateHorizontally(java.awt.Window win, java.awt.Component ref, int location)
LEFT
, RIGHT
, CENTER
,
LEFT_EDGES
, or RIGHT_EDGES
.
This placement may be altered in order to keep the window on the screen.win
- window to be locatedref
- reference componentlocation
- desired horizonal location of the window relative to the componentpublic static void locateVertically(java.awt.Window win, java.awt.Component ref, int location)
ABOVE
, BELOW
,
CENTER
, TOP_EDGES
, or
BOTTOM_EDGES
. This placement may be altered in
order to keep the window on the screen.win
- window to be locatedref
- reference componentlocation
- desired horizonal location of the window relative to the componentpublic static void locateRelative(java.awt.Window win, java.awt.Rectangle bounds, double px, double py, double wx, double wy)
public static void locateCenter(java.awt.Window win, java.awt.Component ref)
public static void locateRight(java.awt.Window win, java.awt.Component ref)
public static void locateLeft(java.awt.Window win, java.awt.Component ref)
public static void locateAbove(java.awt.Window win, java.awt.Component ref)
public static void locateBelow(java.awt.Window win, java.awt.Component ref)
public static java.awt.Rectangle getVirtualScreenBounds()
public static javax.swing.ImageIcon loadIcon(java.lang.Object ref, java.lang.String path)
public static int indexOfComponent(java.awt.Container parent, java.awt.Component comp)
public static boolean containsComponent(java.awt.Container parent, java.awt.Component comp)
public static int indexOfMenuComponent(javax.swing.JMenu parent, java.awt.Component comp)
public static boolean containsMenuComponent(javax.swing.JMenu parent, java.awt.Component comp)
public static void setItalicFont(javax.swing.JComponent jcomp)
public static void repackComponentWindow(java.awt.Component c)
public static javax.swing.border.TitledBorder createTitledPanelBorder(java.lang.String title)
public static javax.swing.JMenuItem createMenuItem(java.awt.event.ActionListener listener, java.lang.String cmd, java.lang.String toolTip)