com.tensegrity.application
Interface Application

All Known Subinterfaces:
GraphApplication
All Known Implementing Classes:
DefaultGraphApplication

public interface Application

Interface Application defines the responsibility for an application using the framework by providing a command registry, preferences, the internationalization and a keystroke provider. It also defines the application's entry point launch() and can be terminated using the shutDown() method.

Applications with a GUI are using ApplicationFrames to display it.

Version:
$Id: Application.java,v 1.23 2006/01/10 13:31:36 BurkhardWick Exp $
Author:
GillesIachelini, BurkhardWick

Method Summary
 Applet getApplet()
          Returns the applet if this application runs in an applet context or null if this is a standalone application.
 ApplicationFrame getApplicationFrame()
          Returns the active ApplicationFrame of this application.
 ApplicationFrame[] getApplicationFrames()
          Returns all ApplicationFrames of this application.
 CommandRegistry getCommandRegistry()
          Returns the CommandRegistry of this Application.
 java.lang.String getDefaultPreferencesFileName()
          Returns the file name that should be used for reading the default preferences
 java.lang.Class getDefaultPreferencesLoadClass()
          Returns the reference class that should be used to load the default preferences
 KeyStrokeProvider getKeyStrokeProvider()
          Returns the KeyStrokeProvider of this Application.
 java.util.Locale getLocale()
          Returns the currently set Locale.
 PreferenceHelp getPreferenceHelp()
          Returns a PreferenceHelp instance that can be used to perform common tasks involving preferences.
 Preferences getPreferences()
          Returns the Preferences instance used by this Application.
 java.lang.String getPreferencesFileName()
          Returns the file name that should be used for storing the preferences
 java.lang.String getTitle()
          Returns the name of this Application.
 UIManager getUIManager()
          Returns the UIManager of this Application.
 java.util.List getUIManagerResources()
          Returns a list with all resource bundles the UIManager should load at initialization time.
 boolean launch()
          Launches the application.
 void savePreferences()
          Saves the currently stored Preferences of this application.
 void setPreferenceHelp(PreferenceHelp preferenceHelp)
          Sets the PreferenceHelp instance that can be used to perform common tasks involving preferences.
 void setPreferences(Preferences preferences)
          Sets the Preferences instance used by this Application.
 void showError(java.lang.String errormessage)
          Asks the application to show an error message-box with the given text.
 boolean shutDown()
          Invoked when the Application should be shut down.
 

Method Detail

getPreferences

public Preferences getPreferences()
Returns the Preferences instance used by this Application.

Returns:
the Preferences instance of this Application.

Find more information in the class documentation


getPreferencesFileName

public java.lang.String getPreferencesFileName()
Returns the file name that should be used for storing the preferences

Returns:
the file name that should be used for storing the preferences

getDefaultPreferencesFileName

public java.lang.String getDefaultPreferencesFileName()
Returns the file name that should be used for reading the default preferences

Returns:
the file name that should be used for reading the default preferences

getDefaultPreferencesLoadClass

public java.lang.Class getDefaultPreferencesLoadClass()
Returns the reference class that should be used to load the default preferences

Returns:
the reference class that should be used to load the default preferences

getPreferenceHelp

public PreferenceHelp getPreferenceHelp()
Returns a PreferenceHelp instance that can be used to perform common tasks involving preferences.

Returns:
a PreferenceHelp instance that can be used to perform common tasks involving preferences.

setPreferenceHelp

public void setPreferenceHelp(PreferenceHelp preferenceHelp)
Sets the PreferenceHelp instance that can be used to perform common tasks involving preferences.

Parameters:
preferenceHelp - the PreferenceHelp instance that can be used to perform common tasks involving preferences.

setPreferences

public void setPreferences(Preferences preferences)
Sets the Preferences instance used by this Application.

Parameters:
preferences - the Preferences instance of this Application.

Find more information in the class documentation


savePreferences

public void savePreferences()
Saves the currently stored Preferences of this application. This method does nothing, if getPreferences() returns null.


getUIManager

public UIManager getUIManager()
Returns the UIManager of this Application.

Returns:
a reference to the currently used UIManager.

Find more information in the class documentation


getUIManagerResources

public java.util.List getUIManagerResources()
Returns a list with all resource bundles the UIManager should load at initialization time.

Returns:
a list with all resource bundles the UIManager should load at initialization time.

getKeyStrokeProvider

public KeyStrokeProvider getKeyStrokeProvider()
Returns the KeyStrokeProvider of this Application.

Returns:
the KeyStrokeProvider instance of this Application.

Find more information in the class documentation


getCommandRegistry

public CommandRegistry getCommandRegistry()
Returns the CommandRegistry of this Application.

Returns:
the CommandRegistry instance of this Application.

Find more information in the class documentation


getLocale

public java.util.Locale getLocale()
Returns the currently set Locale.

Returns:
the currently set Locale.

Find more information in the class documentation


getTitle

public java.lang.String getTitle()
Returns the name of this Application.

Returns:
the title of this Application.

Find more information in the class documentation


shutDown

public boolean shutDown()
Invoked when the Application should be shut down. Returns false if the shut down should be canceled, otherwise true. Usually this method does not return at all and ends with a System.exit(0) call.

Returns:
false if the shut down should be canceled.

Find more information in the class documentation


launch

public boolean launch()
Launches the application. If an applet is present, the application is launched as an applet.

Returns:
true if the launch was successful

Find more information in the class documentation


showError

public void showError(java.lang.String errormessage)
Asks the application to show an error message-box with the given text.

Parameters:
errormessage - the text to display as the error.

Find more information in the class documentation


getApplicationFrame

public ApplicationFrame getApplicationFrame()
Returns the active ApplicationFrame of this application.

Returns:
the active ApplicationFrame of this application.

Find more information in the class documentation


getApplicationFrames

public ApplicationFrame[] getApplicationFrames()
Returns all ApplicationFrames of this application.

Returns:
all ApplicationFrames of this application.

Find more information in the class documentation


getApplet

public Applet getApplet()
Returns the applet if this application runs in an applet context or null if this is a standalone application.

Returns:
the applet or null

Find more information in the class documentation



Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.