|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.common.swing.GuiUtil
public class GuiUtil
Various Gui Utilities.
Distribution Licence: JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA The copyright to this program is held by it's authors. |
Licence
Field Summary | |
---|---|
private static Logger |
log
The log stream |
Constructor Summary | |
---|---|
private |
GuiUtil()
Prevent Instansiation |
Method Summary | |
---|---|
static void |
centerWindow(Window win)
Move the specified window to the centre of the screen. |
static void |
enforceMinimumSize(Component comp,
int min_width,
int min_height)
Set the size of a component |
static Dialog |
getDialog(Component com)
Find the parent Frame |
static Frame |
getFrame(Component parent)
Find the parent Frame. |
static ImageIcon |
getIcon(String name)
Returns the Icon associated with the name from the resources. |
static String |
getText(Component comp)
Attempts to get the text from a generic Component. |
static Window |
getWindow(Component com)
Find the parent window. |
static void |
maximizeWindow(Window win)
Maximize the specified window. |
static void |
restrainedPack(Window win,
float maxx,
float maxy)
A more restricted version of pack() when the component is being pack()ed for the first time. |
static void |
restrainedRePack(Window win)
A more restricted version of pack() for component responding to live component tweaks. |
static int |
setSize(Window win,
Dimension requestedDim)
Set the size of the window, but no bigger than the screen. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger log
Constructor Detail |
---|
private GuiUtil()
Method Detail |
---|
public static ImageIcon getIcon(String name)
name
- Name of the icon file i.e., help16.gif
public static Window getWindow(Component com)
com
- a component to find the frame of.
public static Frame getFrame(Component parent)
parent
- a component to find the frame of.
public static Dialog getDialog(Component com)
com
- a component to find the frame of.
public static void centerWindow(Window win)
win
- The window to be movedpublic static int setSize(Window win, Dimension requestedDim)
On platforms that allow docking of other windows, this routine does not take that into account for sizes that are near that of the screen. For example, on Windows XP, the user may have a task bar showing permanently on one side of the screen and another application's toolbar on another side of the screen. If the requested size of the window is less than the screen size in a particular dimension, it will not be able to adjust for it.
For that reason, either have the application significantly smaller than the screen size or maximize the window.
win
- the window to resizerequestedDim
- how wide and tall to make the window, if possible
public static void maximizeWindow(Window win)
win
- The window to be movedpublic static void restrainedRePack(Window win)
win
- The window to be packedpublic static void restrainedPack(Window win, float maxx, float maxy)
win
- The window to be packedmaxx
- The maximum fraction (0.0 to 1.0) of the screen to be taken
up horizontally (-1 means no restrictions to the horizontal alterations)maxy
- The maximum fraction (0.0 to 1.0) of the screen to be taken
up vertically (-1 means no restrictions to the vertical alterations)restrainedRePack(Window)
public static void enforceMinimumSize(Component comp, int min_width, int min_height)
public static String getText(Component comp)
comp
- The object containing the needed text.
|
Copyright ? 2003-2004 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |