Jadex 0.941

jadex.util
Class SGUI

java.lang.Object
  extended byjadex.util.SGUI

public class SGUI
extends Object

Static helper class with useful gui related methods.


Constructor Summary
SGUI()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SGUI

public SGUI()
Method Detail

createMenuBar

public static JMenuBar createMenuBar(Action[] actions)
Create a menu bar, given a list of actions.

Parameters:
actions - The actions (null is mapped to separator).
Returns:
A menu bar with a menu containing the actions.

createToolBar

public static JToolBar createToolBar(String name,
                                     Action[] actions)
Create a tool bar, given a list of actions.

Parameters:
name - The name of the toolbar.
actions - The actions (null is mapped to separator).
Returns:
A tool bar containing the actions.

createAction

public static Action createAction(String name,
                                  Icon icon,
                                  ActionListener listener)
Create an action.

Parameters:
name - The name.
icon - The path to the icon.
listener - The action listener.
Returns:
The action.

makeIcon

public static Object makeIcon(Class baseclass,
                              String imgloc)
Utility method that creates a UIDefaults.LazyValue that creates an ImageIcon for the specified gifFile filename.


renderObject

public static void renderObject(Graphics g,
                                Component comp,
                                double cellw,
                                double cellh,
                                int x,
                                int y,
                                int gridwidth)
Render an object on a grid.

Parameters:
g - The graphics object.
comp - The object to render.
cellw - The cell width.
cellh - The cell height.

calculateMiddlePosition

public static Point calculateMiddlePosition(Window win)
Calculate the middle position of a window relativ to


calculateMiddlePosition

public static Point calculateMiddlePosition(Window outer,
                                            Window win)
Calculate the middle position of a window relativ to


getWindowParent

public static Window getWindowParent(Component comp)
Get the window parent if any.

Parameters:
comp - The component.
Returns:
The window if any.

Jadex 0.941

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.