uk.ac.essex.common.gui
Interface ApplicationFrame

All Known Subinterfaces:
ButtonPanelFrame
All Known Implementing Classes:
ApplicationFrameImpl, ButtonPanelDesktopFrame, DefaultApplicationFrame, MultiFrameButtonPanelDesktop, MultiFrameDesktop, TabbedFrameDesktop

public interface ApplicationFrame

An application frame is an interface to extend the functionality of JFrame.
Date: Apr 5, 2002


Field Summary
static int BOTTOM
           
static int LEFT
           
static int RIGHT
           
static int TOP
           
 
Method Summary
 void addFrameListener(ApplicationFrameListener frameListener)
           
 void addJMenu(javax.swing.JMenu menuToAdd)
          Adds a JMenu to the menu bar
 void addToolBar(java.lang.String name, javax.swing.JToolBar toolBar)
           
 void addToToolBar(javax.swing.Action actionToAdd)
          Adds an action to the default tool bar
 void addToToolBar(java.lang.String name, javax.swing.Action actionToAdd)
          Adds an action to the named tool bar
 void addView(javax.swing.JPanel view, java.lang.String title)
          Update the GUI view on the data stored in File.
 void addViewChangeListener(ViewChangeListener viewChangeListener)
          Add a view change listener to this frame each time the view changes an event is fired calling the method fireViewChanged.
 void center()
          Centers the frame on screen
 void destroy()
           
 Application getApplication()
           
 javax.swing.JToolBar getDefaultToolBar()
           
 javax.swing.JFrame getFrame()
           
 javax.swing.JMenuBar getJMenuBar()
           
 javax.swing.JLabel getStatusBarLabel()
           
 boolean hasJMenuBar()
           
 void init()
           
 boolean isPersistent()
           
 void removeFrameListener(ApplicationFrameListener frameListener)
           
 void removeToolBar(java.lang.String name)
           
 void removeView(javax.swing.JPanel view)
          Remove a view
 void setJMenuBar(javax.swing.JMenuBar menuBar)
           
 void setPersistent(boolean persistent)
           
 void setProgress(java.lang.String label, float percentage)
          TODO: Should this be here or could we combine with setStatus(String, boolean) }??
 void setStatus(java.lang.String status, boolean isSticky)
          Sets the status message at the bottom of the GUI if the first argument is null it sets the staus message to "Ready" and ignores the second arg.
 void setTitle(java.lang.String title)
           
 

Field Detail

TOP

static final int TOP
See Also:
Constant Field Values

LEFT

static final int LEFT
See Also:
Constant Field Values

RIGHT

static final int RIGHT
See Also:
Constant Field Values

BOTTOM

static final int BOTTOM
See Also:
Constant Field Values
Method Detail

getApplication

Application getApplication()

init

void init()
          throws InitialisationException
Throws:
InitialisationException

destroy

void destroy()

getFrame

javax.swing.JFrame getFrame()
Returns:

getDefaultToolBar

javax.swing.JToolBar getDefaultToolBar()
Returns:
JToolBar - The tool bar for this frame

addToolBar

void addToolBar(java.lang.String name,
                javax.swing.JToolBar toolBar)
Parameters:
name -
toolBar -

removeToolBar

void removeToolBar(java.lang.String name)
Parameters:
name -

addToToolBar

void addToToolBar(javax.swing.Action actionToAdd)
Adds an action to the default tool bar

Parameters:
actionToAdd - - The action to put on the tool bar

addToToolBar

void addToToolBar(java.lang.String name,
                  javax.swing.Action actionToAdd)
Adds an action to the named tool bar

Parameters:
name - - The name of the toolbar to add to
actionToAdd - - The action to put on the tool bar
See Also:
addToolBar(java.lang.String, javax.swing.JToolBar)

getStatusBarLabel

javax.swing.JLabel getStatusBarLabel()
Returns:
JLabel - That is used for the text message on the status bar

getJMenuBar

javax.swing.JMenuBar getJMenuBar()
Returns:
JMenuBar - The menu bar for this frame

setJMenuBar

void setJMenuBar(javax.swing.JMenuBar menuBar)
Parameters:
menuBar -

hasJMenuBar

boolean hasJMenuBar()
Returns:

addView

void addView(javax.swing.JPanel view,
             java.lang.String title)
Update the GUI view on the data stored in File.

Parameters:
view - - A panel that is a view for the application

removeView

void removeView(javax.swing.JPanel view)
Remove a view

Parameters:
view - - The view to remove

addViewChangeListener

void addViewChangeListener(ViewChangeListener viewChangeListener)
Add a view change listener to this frame each time the view changes an event is fired calling the method fireViewChanged.

Parameters:
viewChangeListener -

setStatus

void setStatus(java.lang.String status,
               boolean isSticky)
Sets the status message at the bottom of the GUI if the first argument is null it sets the staus message to "Ready" and ignores the second arg.

Parameters:
status - - The String to display
isSticky - - Should the message be permanent or stay for 3 seconds then go

setProgress

void setProgress(java.lang.String label,
                 float percentage)
TODO: Should this be here or could we combine with setStatus(String, boolean) }??

Parameters:
label - - String to display on the progress bar
percentage - - Should be in the range 0 - 100 inclusive

center

void center()
Centers the frame on screen


isPersistent

boolean isPersistent()

setPersistent

void setPersistent(boolean persistent)

addFrameListener

void addFrameListener(ApplicationFrameListener frameListener)
Parameters:
frameListener -

removeFrameListener

void removeFrameListener(ApplicationFrameListener frameListener)
Parameters:
frameListener -

addJMenu

void addJMenu(javax.swing.JMenu menuToAdd)
Adds a JMenu to the menu bar

Parameters:
menuToAdd - - The menu to add

setTitle

void setTitle(java.lang.String title)