© 2006-2007 ETH Zurich

org.ximtec.igesture.graphics
Class SwingTool

java.lang.Object
  extended by org.ximtec.igesture.graphics.SwingTool

public class SwingTool
extends Object

Static helper methods used by the swing application.

Version:
1.0 Nov 2006
Author:
Ueli Kurmann, igesture@uelikurmann.ch, Beat Signer, signer@inf.ethz.ch

Field Summary
static Dimension DIALOG_SIZE
           
static Dimension FRAME_PREFERRED_SIZE
           
static Dimension FRAME_SIZE
           
 
Constructor Summary
SwingTool()
           
 
Method Summary
static org.sigtec.graphix.widget.BasicDialog createDialog(String key, org.sigtec.graphix.GuiBundle guiBundle)
          Creates a new dialog with some default settings.
static GridBagConstraints createGridBagConstraint(int gridX, int gridY)
          Creates a new GridBagConstraints instance.
static GridBagConstraints createGridBagConstraint(int gridX, int gridY, int width, int height)
           
static GridBagConstraints createGridBagConstraint(int gridX, int gridY, int width, int height, int alignment)
          Creates a new GridBagConstraints instance.
static org.sigtec.graphix.widget.BasicInternalFrame createInternalFrame(String key, org.sigtec.graphix.GuiBundle guiBundle)
          Creates a new internal frame with some default settings.
static JMenu createMenu(String name, Action[] actions)
          Creates a JMenu
static JMenuItem createMenuItem(Action action, ImageIcon icon)
          Creates a new menu item with the given action.
static JPopupMenu createPopupMenu(Action[] actions)
          Creates a pop-up menu.
static ScrollableList createScrollableList(ListModel model, int height, int width)
          Returns a scrollable list.
static void initFrame(org.sigtec.graphix.widget.BasicInternalFrame frame)
          Initialises a frame..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIALOG_SIZE

public static final Dimension DIALOG_SIZE

FRAME_SIZE

public static final Dimension FRAME_SIZE

FRAME_PREFERRED_SIZE

public static final Dimension FRAME_PREFERRED_SIZE
Constructor Detail

SwingTool

public SwingTool()
Method Detail

createGridBagConstraint

public static GridBagConstraints createGridBagConstraint(int gridX,
                                                         int gridY,
                                                         int width,
                                                         int height,
                                                         int alignment)
Creates a new GridBagConstraints instance.

Parameters:
gridX - the x position.
gridY - the y position.
width - number of columns to span.
height - number of rows to span.
Returns:
the newly created GridBagConstraints instance.

createGridBagConstraint

public static GridBagConstraints createGridBagConstraint(int gridX,
                                                         int gridY,
                                                         int width,
                                                         int height)

createGridBagConstraint

public static GridBagConstraints createGridBagConstraint(int gridX,
                                                         int gridY)
Creates a new GridBagConstraints instance.

Parameters:
gridX - the x position.
gridY - the y position.
Returns:
the newly created GridBagConstraints instance.

createDialog

public static org.sigtec.graphix.widget.BasicDialog createDialog(String key,
                                                                 org.sigtec.graphix.GuiBundle guiBundle)
Creates a new dialog with some default settings.

Parameters:
key - the key of the dialogue to be created.
Returns:
dialogue configured with data from the GUI bundle.

createInternalFrame

public static org.sigtec.graphix.widget.BasicInternalFrame createInternalFrame(String key,
                                                                               org.sigtec.graphix.GuiBundle guiBundle)
Creates a new internal frame with some default settings.

Parameters:
key - the key of the internal frame to be created.
Returns:
internal frame configured with data from the GUI bundle.

initFrame

public static void initFrame(org.sigtec.graphix.widget.BasicInternalFrame frame)
Initialises a frame..

Parameters:
frame - the frame to be initialised.

createMenuItem

public static JMenuItem createMenuItem(Action action,
                                       ImageIcon icon)
Creates a new menu item with the given action.

Parameters:
action - the action to be used.
icon - the icon the icon to be used.
Returns:
a newly created menu item.

createMenu

public static JMenu createMenu(String name,
                               Action[] actions)
Creates a JMenu

Parameters:
name - the name of the menu.
actions - an array of actions.
Returns:
the newly created JMenu with the corresponding items.

createPopupMenu

public static JPopupMenu createPopupMenu(Action[] actions)
Creates a pop-up menu.

Parameters:
actions - an array of actions.
Returns:
the newly created pop-up menu.

createScrollableList

public static ScrollableList createScrollableList(ListModel model,
                                                  int height,
                                                  int width)
Returns a scrollable list.

Parameters:
model - the list model.
height - the height of the component.
width - the width of the component.
Returns:
a new scrollable list.

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.