org.homeunix.thecave.moss.swing
Interface StandardWindow

All Superinterfaces:
StandardContainer
All Known Implementing Classes:
AboutFrame, AccountEditorDialog, AccountTypeEditorDialog, AccountTypeListFrame, BackupManagerDialog, BuddiLanguageEditor, BudgetCategoryEditorDialog, CustomDateDialog, HiddenMossFrame, LanguageEditor, MainFrame, MossAssociatedDocumentFrame, MossDialog, MossDocumentFrame, MossFrame, MossProgressDialog, MossStatusDialog, PreferencesFrame, ScheduledTransactionEditorDialog, ScheduledTransactionListFrame, TransactionFrame

public interface StandardWindow
extends StandardContainer

An interface which defines several helper functions to a standard container (frame, dialog, etc). This helps to ensure that the container is set up properly, as well as defining clear methods for modifying this object at a later point in time (content change, etc). If you choose to follow the MVC convention, it is recommended that classes which implement this interface do so in two parts: a View portion, and a Controller portion. One of these classes would be abstract, while the other is not; when the non abstract class is instantiated, it would call apropriate methods from its abstract counterpart to create a functional GUI. Each of these methods returns a StandardContainer, which allows the chaining together of methods. StandardContainer also implements ActionListener, to provide a common section for placing listeners in.

Author:
wolson

Method Summary
 java.lang.Object closeWindow()
          The method used to close the window.
 void initPostPack()
          A method which is called after the pack() method in openWindow, but before the setVisible(true).
 void openWindow()
          The method which is run when the window is opened.
 void openWindow(java.awt.Dimension dimension, java.awt.Point position)
          The method which is run when the window is opened.
 void requestFocusInApplication()
          Request that this frame gets focus.
 
Methods inherited from interface org.homeunix.thecave.moss.swing.StandardContainer
clear, init, updateButtons, updateContent
 

Method Detail

openWindow

void openWindow()
                throws WindowOpenException
The method which is run when the window is opened. First calls init(), then updateContents(), then updateButtons(). Finally, it packs the frame and sets it visible.

Throws:
WindowOpenException - If there was a problem opening the window. Usually this is due to the same window being opened already (as determined by the key, in AbstractFrame derived windows.)

openWindow

void openWindow(java.awt.Dimension dimension,
                java.awt.Point position)
                throws WindowOpenException
The method which is run when the window is opened. First calls init(), then updateContents(), then updateButtons(). Finally, it packs the frame and sets it visible. The window is positioned according to the dimension and positioning values given.

Throws:
WindowOpenException - If there was a problem opening the window. Usually this is due to the same window being opened already (as determined by the key, in AbstractFrame derived windows.)

closeWindow

java.lang.Object closeWindow()
The method used to close the window. Can return an object if desired; if you don't need to return anything to the calling method, just return null.

Returns:

initPostPack

void initPostPack()
A method which is called after the pack() method in openWindow, but before the setVisible(true). This allows you to do some initialization based on the post-packed size of components.


requestFocusInApplication

void requestFocusInApplication()
Request that this frame gets focus. This is more strong than the requestFocusInWindow() method, and should succeed more often. The default implementation is to call setVisible(true), followed by requestFocusInWindow().