org.gswing.gui.desktop
Class Desktop

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.gswing.gui.desktop.Desktop
All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, IViewerInvocation, IComponent, IDesktopManagement

public class Desktop
extends JFrame
implements WindowListener, IDesktopManagement, IComponent

The main frame in the GUI

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Desktop()
          Constructor.
 
Method Summary
 void add(JInternalFrame guiComponent)
          Add a component window to the desktop.
 void executeLengthyTask(Object source, String methodName, Object[] params, BoundedRangeModel model)
          Execute a method that could take some time.
 JDesktopPane getDesktopPane()
           
 JRootPane getRootPane()
           
 boolean initialise(IFramework framework)
          Set up desktop.
 void invokeInserter(JComponent parent, String constituency, char type, String parentConstituency)
          Display the inserter dialog.
 void remove(JInternalFrame guiComponent)
          Remove a component window from the desktop.
 void showResult(String constituency, char type)
          Display the result in the viewer dialog.
 void windowActivated(WindowEvent arg0)
           
 void windowClosed(WindowEvent arg0)
           
 void windowClosing(WindowEvent arg0)
          Before closing make sure to shutdown database connection.
 void windowDeactivated(WindowEvent arg0)
           
 void windowDeiconified(WindowEvent arg0)
           
 void windowIconified(WindowEvent arg0)
           
 void windowOpened(WindowEvent arg0)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

Desktop

public Desktop()
Constructor.

Method Detail

initialise

public boolean initialise(IFramework framework)
Set up desktop.

Specified by:
initialise in interface IComponent
Parameters:
framework - The gswing framework reference.
Returns:
True if component has been successfully initialised.

add

public void add(JInternalFrame guiComponent)
Description copied from interface: IDesktopManagement
Add a component window to the desktop.

Specified by:
add in interface IDesktopManagement
Parameters:
guiComponent - The component to be added.

remove

public void remove(JInternalFrame guiComponent)
Description copied from interface: IDesktopManagement
Remove a component window from the desktop.

Specified by:
remove in interface IDesktopManagement
Parameters:
guiComponent - The component to be removed.

invokeInserter

public void invokeInserter(JComponent parent,
                           String constituency,
                           char type,
                           String parentConstituency)
Description copied from interface: IDesktopManagement
Display the inserter dialog.

Specified by:
invokeInserter in interface IDesktopManagement
Parameters:
parent - The component that invoked this.
constituency - The name of the constituency to display.
type - The constituency type.
parentConstituency - The parent constituency.

showResult

public void showResult(String constituency,
                       char type)
Description copied from interface: IViewerInvocation
Display the result in the viewer dialog.

Specified by:
showResult in interface IViewerInvocation
Parameters:
constituency - The name of the constituency to display.
type - The constituency type.

executeLengthyTask

public void executeLengthyTask(Object source,
                               String methodName,
                               Object[] params,
                               BoundedRangeModel model)
Description copied from interface: IDesktopManagement
Execute a method that could take some time. The method is executed in a seperate thread allowing futher GUI processing. A progress bar is displayed in the GUI status bar.

Specified by:
executeLengthyTask in interface IDesktopManagement
Parameters:
source - The object that the method is to invoked on.
methodName - The name of the method to be invoked.
params - The method parameters.
model - The progress bar model.

getDesktopPane

public JDesktopPane getDesktopPane()
Specified by:
getDesktopPane in interface IDesktopManagement
Returns:
The desktop's JDesktopPane.

getRootPane

public JRootPane getRootPane()
Specified by:
getRootPane in interface RootPaneContainer
Specified by:
getRootPane in interface IDesktopManagement
Overrides:
getRootPane in class JFrame
Returns:
The desktop's JRootPane.

windowClosing

public void windowClosing(WindowEvent arg0)
Before closing make sure to shutdown database connection.

Specified by:
windowClosing in interface WindowListener

windowActivated

public void windowActivated(WindowEvent arg0)
Specified by:
windowActivated in interface WindowListener

windowClosed

public void windowClosed(WindowEvent arg0)
Specified by:
windowClosed in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent arg0)
Specified by:
windowDeactivated in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent arg0)
Specified by:
windowDeiconified in interface WindowListener

windowIconified

public void windowIconified(WindowEvent arg0)
Specified by:
windowIconified in interface WindowListener

windowOpened

public void windowOpened(WindowEvent arg0)
Specified by:
windowOpened in interface WindowListener


Copyright © 2008. All Rights Reserved.