Package de.sciss.app
Interface Application
-
- All Known Implementing Classes:
AbstractApplication,BasicApplication
public interface ApplicationTheApplicationinterface is an attempt to create common classes and interfaces (the packagede.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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddComponent(java.lang.Object key, java.lang.Object component)Adds a newly created component (e.g.java.awt.datatransfer.ClipboardgetClipboard()Returns the clipboard used by the application.java.lang.ObjectgetComponent(java.lang.Object key)Retrieves a specific component (such as a GUI frame) of the application.DocumentHandlergetDocumentHandler()GraphicsHandlergetGraphicsHandler()java.lang.StringgetName()Returns the application's name.java.lang.StringgetResourceString(java.lang.String key)Returns a localized string for a given key.java.lang.StringgetResourceString(java.lang.String key, java.lang.String defaultValue)Returns a localized string for a given key.java.util.prefs.PreferencesgetSystemPrefs()Returns the applications system wide preferences.java.util.prefs.PreferencesgetUserPrefs()Returns the applications user specific preferences.doublegetVersion()Returns the application programme version.WindowHandlergetWindowHandler()voidquit()Forces to application to quit.voidremoveComponent(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
-
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
nullif 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 thegetComponentmethod.- Parameters:
key- agreed upon idenfier for the component, e.g. a string or classcomponent- 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()
-
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 filedefaultValue- 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.
-
-