|
Jadex 0.96-beta1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjadex.util.SGUI
public class SGUI
Static helper class with useful gui related methods.
Field Summary | |
---|---|
static String |
AUTO_ADJUST
This property can be set on components to be automatically adjusted to equal sizes. |
Constructor Summary | |
---|---|
SGUI()
|
Method Summary | |
---|---|
static void |
adjustComponentSizes(Container parent)
Adjust all marked components to equal sizes according to their miminum, maximum, and preferred sizes. |
static void |
adjustComponentSizes(JComponent[] components)
Adjust components to equal sizes according to their miminum, maximum, and preferred sizes. |
static Point |
calculateMiddlePosition(Window win)
Calculate the middle position of a window relativ to |
static Point |
calculateMiddlePosition(Window outer,
Window win)
Calculate the middle position of a window relativ to |
static Action |
createAction(String name,
Icon icon,
ActionListener listener)
Create an action. |
static JMenuBar |
createMenuBar(Action[] actions)
Create a menu bar, given a list of actions. |
static JToolBar |
createToolBar(String name,
Action[] actions)
Create a tool bar, given a list of actions. |
static Window |
getWindowParent(Component comp)
Get the window parent if any. |
static Object |
makeIcon(Class baseclass,
String imgloc)
Utility method that creates a UIDefaults.LazyValue that creates an ImageIcon for the specified gifFile filename. |
static void |
renderObject(Graphics g,
Component comp,
double cellw,
double cellh,
int x,
int y,
int gridwidth)
Render an object on a grid. |
static void |
showMessageDialog(Component parent,
Object message,
String title,
int msgtype)
Show an non-model message dialog. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String AUTO_ADJUST
Constructor Detail |
---|
public SGUI()
Method Detail |
---|
public static JMenuBar createMenuBar(Action[] actions)
actions
- The actions (null is mapped to separator).
public static JToolBar createToolBar(String name, Action[] actions)
name
- The name of the toolbar.actions
- The actions (null is mapped to separator).
public static Action createAction(String name, Icon icon, ActionListener listener)
name
- The name.icon
- The path to the icon.listener
- The action listener.
public static Object makeIcon(Class baseclass, String imgloc)
gifFile
filename.
public static void renderObject(Graphics g, Component comp, double cellw, double cellh, int x, int y, int gridwidth)
g
- The graphics object.comp
- The object to render.cellw
- The cell width.cellh
- The cell height.public static Point calculateMiddlePosition(Window win)
public static Point calculateMiddlePosition(Window outer, Window win)
public static Window getWindowParent(Component comp)
comp
- The component.
public static void showMessageDialog(Component parent, Object message, String title, int msgtype)
public static void adjustComponentSizes(JComponent[] components)
public static void adjustComponentSizes(Container parent)
AUTO_ADJUST
property
to an arbitrary value.
|
Jadex 0.96-beta1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.