Package 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.
    • 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 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
      • 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.