de.sciss.app
Interface Application

All Known Implementing Classes:
AbstractApplication, BasicApplication

public interface Application

The Application interface is an attempt to create common classes and interfaces (the package de.sciss.app) which can be shared by different programmes, such as Meloncillo or FScape, without having to make adjustments in different places each time a modification is made. This interface describes the most prominent methods needed for a general GUI based application.

Version:
0.10, 20-May-05
Author:
Hanns Holger Rutz

Method Summary
 void addComponent(java.lang.Object key, java.lang.Object component)
          Adds a newly created component (e.g. a specific frame) to the application.
 java.awt.datatransfer.Clipboard getClipboard()
          Returns the clipboard used by the application.
 java.lang.Object getComponent(java.lang.Object key)
          Retrieves a specific component (such as a GUI frame) of the application.
 DocumentHandler getDocumentHandler()
           
 GraphicsHandler getGraphicsHandler()
           
 java.lang.String getMacOSCreator()
          Returns the four character Mac OS specific creator code as registered on the Apple Developer Connection.
 net.roydesign.app.Application getMRJApplication()
          Returns an instance of MRJAdapter's Application class which will deal with basic platform dependent GUI operations such as providing a Quit or Preferences menu item, handling file open requests from the system etc.
 java.lang.String getName()
          Returns the application's name.
 java.lang.String getResourceString(java.lang.String key)
          Returns a localized string for a given key.
 java.lang.String getResourceString(java.lang.String key, java.lang.String defaultValue)
          Returns a localized string for a given key.
 java.util.prefs.Preferences getSystemPrefs()
          Returns the applications system wide preferences.
 java.util.prefs.Preferences getUserPrefs()
          Returns the applications user specific preferences.
 double getVersion()
          Returns the application programme version.
 WindowHandler getWindowHandler()
           
 void quit()
          Forces to application to quit.
 void removeComponent(java.lang.Object key)
          Unregisters a component, for example when a frame has been disposed.
 

Method Detail

getSystemPrefs

java.util.prefs.Preferences getSystemPrefs()
Returns the applications system wide preferences.

Returns:
the root node of the application's global preferences
See Also:
Preferences.systemNodeForPackage( Class )

getUserPrefs

java.util.prefs.Preferences getUserPrefs()
Returns the applications user specific preferences.

Returns:
the root node of the application's preferences from the current user's local folder
See Also:
Preferences.userNodeForPackage( Class )

getVersion

double getVersion()
Returns the application programme version.

Returns:
current application version

getName

java.lang.String getName()
Returns the application's name.

Returns:
the application's name

getMacOSCreator

java.lang.String getMacOSCreator()
Returns the four character Mac OS specific creator code as registered on the Apple Developer Connection. This creator code can be used to tag files with the corresponding application. This method will return the code independant of the running operating system.

Returns:
the creator code for this application or null if there hasn't been registered any code.
See Also:
MRJAdapter.setFileCreator( java.io.File, java.lang.String )

getClipboard

java.awt.datatransfer.Clipboard getClipboard()
Returns the clipboard used by the application.

Returns:
the clipboard used by the application
See Also:
Toolkit.getSystemClipboard()

getComponent

java.lang.Object getComponent(java.lang.Object key)
Retrieves a specific component (such as a GUI frame) of the application.

Parameters:
key - agreed upon idenfier for the component, e.g. a string or class
Returns:
the requested component or null if absent or unknown

addComponent

void addComponent(java.lang.Object key,
                  java.lang.Object component)
Adds a newly created component (e.g. a specific frame) to the application. Adding means making it known to other components which can retrieve this object by calling the getComponent method.

Parameters:
key - agreed upon idenfier for the component, e.g. a string or class
component - the component to be registered

removeComponent

void removeComponent(java.lang.Object key)
Unregisters a component, for example when a frame has been disposed. This will reomve the component from the internal dictionary.

Parameters:
key - agreed upon idenfier for the component to be removed, e.g. a string or class

getDocumentHandler

DocumentHandler getDocumentHandler()

getWindowHandler

WindowHandler getWindowHandler()

getGraphicsHandler

GraphicsHandler getGraphicsHandler()

getMRJApplication

net.roydesign.app.Application getMRJApplication()
Returns an instance of MRJAdapter's Application class which will deal with basic platform dependent GUI operations such as providing a Quit or Preferences menu item, handling file open requests from the system etc.

Returns:
the Application class providing access to common menu items and system events registration

getResourceString

java.lang.String getResourceString(java.lang.String key)
Returns a localized string for a given key. If the key is not found, returns a warning text and the key name.

Parameters:
key - a key into the application's main string recource file
Returns:
the localized text
See Also:
ResourceBundle.getString( String )

getResourceString

java.lang.String getResourceString(java.lang.String key,
                                   java.lang.String defaultValue)
Returns a localized string for a given key. If the key is not found, returns the given default string.

Parameters:
key - a key into the application's main string recource file
defaultValue - the text to return if the key is not in the dictionary
Returns:
the localized text
See Also:
ResourceBundle.getString( String )

quit

void quit()
Forces to application to quit. The application will perform necessary cleanup such as flushing the preferences.