com.tensegrity.application
Class ApplicationFrame

java.lang.Object
  extended bycom.tensegrity.application.ApplicationFrame
All Implemented Interfaces:
DocumentListener, Evaluable, EventListenerTag
Direct Known Subclasses:
SwingApplicationFrame, SwtApplicationFrame

public abstract class ApplicationFrame
extends java.lang.Object
implements DocumentListener, Evaluable

Class ApplicationFrame represents an abstract implementation representing a GUI of an Application. Although its entire responsibility cannot be summed up by standard interfaces alone, we can show how its methods fall into six distinct categories.

Instances are usually created by the Application implementation which is the preferred way. It is still possible to create them without an own Application implementation in which case a default is created completely transparent for the user.

An ApplicationFrame is responsible for returning information about the runtime environment. Because an instance can be used in either an Application or Applet context, client code needs to be able to determine its environment at runtime and call the correct methods.

All the main GUI components are managed by the application frame. The following methods are used to retrieve them or update their status:

All of the important Container objects of a graph application are managed by the ApplicationFrame and returned to objects that request them.

Instances of open documents are handled by implementations of the central MDIComponent container.

The methods which deal with this gui responsibility are shown below:

The ApplicationFrame class also provides a set of methods that deal directly and indirectly with creating and configuring documents, which are shown here:

Finally, an ApplicationFrame exposes a set of methods that allow client code to load and save graph and generic documents, as shown here.

AttributeEditors are using translators to display localized texts for the names of attributes and values of EnumConstraints. All Translators are created using a pool, so translators can share resources. The following methods are used to get a reference to the pool of translators or one of the default translators used for the main attribute editor, the preference table or the layout attributes editor. Any of these methods may return null in which case no translator is used for the corresponding editor or no translator at all in case getAttributeEditorTranslatorPool() returns null.

Version:
$Id: ApplicationFrame.java,v 1.84 2006/05/08 12:40:44 MichaelKegel Exp $
Author:
GillesIachelini, BurkhardWick

Field Summary
protected  Application application
           
static int EAST
           
static int NORTH
           
static int NORTHEAST
           
static int NORTHWEST
           
static int SOUTH
           
static int SOUTHEAST
           
static int SOUTHWEST
           
static int TYPE_CLONED_DOCUMENT
          A constant identifying a cloned document.
static int TYPE_LOADED_DOCUMENT
          A constant identifying a loaded document.
static int TYPE_NEW_DOCUMENT
          A constant identifying a new document.
static int UNDEFINED
           
static int WEST
           
 
Constructor Summary
ApplicationFrame(Application application)
          Constructs a new ApplicationFrame instance.
 
Method Summary
protected  void addKeyCommand(VisualGraphView visualgraphview, java.lang.String commandId)
          This method retrieves the KeyStroke corresponding to the passed commandId using the KeyStrokeProvider class and adds it to the passed VisualGraphView.
 void addPostLaunchTask(java.lang.Runnable postLaunchTask)
          Adds a Runnable that is processed when calling runPostLaunchTasks() which should be done after the application is on screen.
abstract  void configureDocumentView(Document document, int documenttype)
          Configures the view of a document.
abstract  void configureEmptyDocument(Document document)
          Configures a newly created document.
abstract  void configureNewDocument(Document document)
          This method should be overridden in order to perform a post-creation configuration of the passed document.
 void documentAdded(DocumentEvent documentevent)
          Invoked after a document was added to the mdicomponent.
 void documentModelChanged(DocumentEvent documentevent)
          Invoked after a document's model has changed.
 void documentPreAdd(DocumentEvent documentevent)
          Invoked when a document is about to be added to a mdicomponent.
 void documentPreRemove(DocumentEvent documentevent)
          Invoked when a document is about to be removed from a mdicomponent.
 void documentRemoved(DocumentEvent documentevent)
          Invoked after a document was removed from the mdicomponent.
 void documentSelected(DocumentEvent documentevent)
          Invoked after a document was selected in the mdicomponent.
 void documentUnselected(DocumentEvent documentevent)
          Invoked after a document was unselected in the mdicomponent.
 boolean exit()
          Cleanup method that is called when the application will be closed to free all resources from the application frame and store all contained documents, etc.
 Applet getApplet()
          Deprecated. use Application.getApplet()
 Application getApplication()
          Returns the application this application frame belongs to.
abstract  AttributeEditorContainer getAttributeEditorContainer()
          Returns either the AttributeEditorContainer or null if no such Container is used by this Application.
 AttributeEditorTranslator getAttributeEditorTranslator()
          Returns the AttributeEditorTranslator this application is using for editing attributes in the main attribute editor.
 AttributeEditorTranslatorPool getAttributeEditorTranslatorPool()
          Returns the AttributeEditorTranslatorPool this application is using.
 java.lang.String getAutomaticLayoutContextName()
          Deprecated. This method is no longer used by the framework
 CommandRegistry getCommandRegistry()
          Deprecated. use Application.getCommandRegistry() instead!
protected  com.tensegrity.application.ApplicationFrame.CompositeViewListener getCompositeViewListener()
           
abstract  Container getCustomContainer()
          Deprecated. use getCustomContainers() instead!
 Container[] getCustomContainers()
          Returns an array of custom not yet specified types of Containers.
 LayoutController getDefaultLayoutController()
          Deprecated. use GraphApplication.getDefaultLayoutController()
 DocumentDropContext getDocumentDropContext()
          Returns the Document drop context to be used when files are dropped into the frame.
 DragContext getDragContext()
          Deprecated. use GraphApplication.getDragContext()
abstract  Frame getFrame()
          Returns either the awt.Frame of this ApplicationFrame or null if this ApplicationFrame is running as Applet.
abstract  GraphDocumentReader getGraphDocumentReader()
          Returns the GraphDocumentReader to use for reading documents.
abstract  GraphDocumentWriter getGraphDocumentWriter()
          Returns the GraphDocumentWriter to use for writing documents.
abstract  JPopupMenuSourceWithUpdateUI getGraphPanelPopupMenuSource()
          Returns a popup menu instance for this application's graph panels.
 KeyStrokeProvider getKeyStrokeProvider()
          Deprecated. use Application.getKeyStrokeProvider() instead!
abstract  int getLayoutConstraint(Container container)
          This method returns a layout constraint for a specific container.
 AttributeEditorTranslator getLayoutEditorTranslator()
          Returns the AttributeEditorTranslator this application is using for editing attributes in the layout attributes editor.
abstract  LayoutToolsContainer getLayoutToolsContainer()
          Returns the LayoutToolsContainer of this Application or null if no such Container is used.
 java.util.Locale getLocale()
          Deprecated. use Application.getLocale()
abstract  MDIComponent getMDIComponent()
          Returns the MDIComponent of the this ApplicationFrame.
abstract  MenuBar getMenuBar()
          Returns the MenuBar of this ApplicationFrame.
abstract  NavigatorContainer getNavigatorContainer()
          Returns the NavigatorContainer of this Application or null if no such Container is used.
abstract  OutlinerContainer getOutlinerContainer()
          Returns the OutlinerContainer of this Application or null if no such Container is used.
 AttributeEditorTranslator getPreferenceAttributeEditorTranslator()
          Returns the AttributeEditorTranslator this application is using for editing preferences.
 Preferences getPreferences()
          Deprecated. use Application.getPreferences() instead!
abstract  RepositoryContainer getRepositoryContainer()
          Returns the RepositoryContainer of this Application or null if no such Container is used.
 java.lang.String getResourceName()
          Deprecated. Use getResourceNames() instead!
 java.util.List getResourceNames()
          Returns a list of paths to resource files using the syntax of resource bundles.
 Frame getRootFrame()
          Returns the root frame of this application.
 RuleRegistry getRuleRegistry()
          Deprecated. use GraphApplication.getRuleRegistry()
abstract  StatusBar getStatusBar()
          Returns The StatusBar of the ApplicationFrame.
 java.lang.String getTitle()
          Returns the title for this application frame that is used for the frame title.
abstract  ToolBar[] getToolBars()
          Returns the ToolBar instances used within this ApplicationFrame, the default one being at index 0 of the returned array.
 UIManager getUIManager()
          Deprecated. use Application.getUIManager() instead!
 java.util.HashMap getUiMap()
          Returns the HashMap to collect all the language-switch affected controls.
abstract  void init()
          Initializes the ApplicationFrame.
protected  void installClipboard(VisualGraphView vgv)
          Configures the VisualGraphView to use the clipboard mode that has been set in the preferences.
protected  void installInteractionSettings(VisualGraphView vgv)
          Configures the VisualGraphView to use the interaction settings that have been set in the preferences.
protected  void installKeyboardCommands(VisualGraphView vgv)
          This protected method is used in order to add to the passed VisualGraphView mappings between KeyStrokes and BaseCommandes.
protected  void installLayoutController(GraphApplication gapp, VisualGraphView vgv)
          Configures the given VisualGraphView instance in case no LayoutController is associated to use a copy of the LayoutController assigned to the given GraphApplication and marked as default LayoutController.
protected  void installListeners()
          Should be called by the implementation after the GUI has been initialized to install some default listeners.
 boolean isApplet()
          Returns true if this ApplicationFrame is used in an AppletContext.
abstract  Document newDocument()
          Creates a new Document.
abstract  Document openDocument(java.io.File file)
          This method is responsible to load a document from a specified file location.
abstract  Document openDocument(java.io.InputStream is, java.lang.String name)
          This method is responsible to load a document from a specified input stream.
 boolean registerDragRepresentation(VisualGraphView vgv)
          Override this method to register the drag representation for fixing Interactable instances.
 boolean registerHighlightRepresentation(VisualGraphView vgv)
          Override this method to register the highlight representation for fixing Interactable instances.
 boolean removePostLaunchTask(java.lang.Runnable postLaunchTask)
          Removed a Runnable from the list that is processed when calling runPostLaunchTasks() which should be done after the application is on screen.
 void runPostLaunchTasks()
          Processes all added PostLaunchTasks
abstract  void saveDocument(Document document, java.io.File file)
          This method is responsible to save a given document to a specified file location.
abstract  void saveDocument(Document document, java.io.OutputStream os)
          This method is responsible to save a given document to a specified output stream.
abstract  void savePreferences()
          Stores the current settings of the application frame to the preferences
 void setAutomaticLayoutContextName(java.lang.String layoutContextName)
          Deprecated. This method is no longer used by the framework
abstract  void setGraphPanelPopupMenuSource(JPopupMenuSourceWithUpdateUI graphPanelPopupMenuSource)
          Sets the popup menu instance for this application's graph panels.
 void setLocale(java.util.Locale locale)
          Sets the application locale, loads the text resources for the given locale and updates the gui.
 void setPreferences(Preferences preferences)
          Deprecated. use Application.setPreferences(Preferences) instead!
 void setRuleRegistry(RuleRegistry registry)
          Deprecated. use {@link GraphApplication#setRuleRegistry(RuleRegistry)
protected  void updateResources(java.util.Locale locale)
          Updates the text resources of the application for the given locale by (re)loading the resource bundles.
 void updateStatus(java.lang.Object caller, java.lang.Object obj)
          This method can be seen as the ultimate drain for update signals.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tensegrity.gui.Evaluable
applyEvList, installEvList
 

Field Detail

UNDEFINED

public static final int UNDEFINED
See Also:
Constant Field Values

NORTH

public static final int NORTH
See Also:
Constant Field Values

NORTHEAST

public static final int NORTHEAST
See Also:
Constant Field Values

EAST

public static final int EAST
See Also:
Constant Field Values

SOUTHEAST

public static final int SOUTHEAST
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
See Also:
Constant Field Values

SOUTHWEST

public static final int SOUTHWEST
See Also:
Constant Field Values

WEST

public static final int WEST
See Also:
Constant Field Values

NORTHWEST

public static final int NORTHWEST
See Also:
Constant Field Values

TYPE_NEW_DOCUMENT

public static final int TYPE_NEW_DOCUMENT
A constant identifying a new document. Used in configureDocumentView(Document, int)

See Also:
Constant Field Values

TYPE_LOADED_DOCUMENT

public static final int TYPE_LOADED_DOCUMENT
A constant identifying a loaded document. Used in configureDocumentView(Document, int)

See Also:
Constant Field Values

TYPE_CLONED_DOCUMENT

public static final int TYPE_CLONED_DOCUMENT
A constant identifying a cloned document. Used in configureDocumentView(Document, int)

See Also:
Constant Field Values

application

protected Application application
Constructor Detail

ApplicationFrame

public ApplicationFrame(Application application)
Constructs a new ApplicationFrame instance.

Method Detail

installListeners

protected final void installListeners()
Should be called by the implementation after the GUI has been initialized to install some default listeners.


init

public abstract void init()
Initializes the ApplicationFrame. Must be implemented and called before showing the ApplicationFrame!


getMenuBar

public abstract MenuBar getMenuBar()
Returns the MenuBar of this ApplicationFrame.

Returns:
an instance of the MenuBar interface.

Find more information in the class documentation


configureEmptyDocument

public abstract void configureEmptyDocument(Document document)
Configures a newly created document. Usually applies a set of document settings which depend on some defaults in the preferences.

Parameters:
document - The document to configure

Find more information in the class documentation


configureDocumentView

public abstract void configureDocumentView(Document document,
                                           int documenttype)
Configures the view of a document. Usually the document is a GraphDocument and the layout controller is assigned and some settings from the preferences are applied to it.

Parameters:
document - The document to configure
documenttype - A constant describing the source of this document, one of these constants: TYPE_NEW_DOCUMENT TYPE_CLONED_DOCUMENT TYPE_LOADED_DOCUMENT

Find more information in the class documentation


configureNewDocument

public abstract void configureNewDocument(Document document)
This method should be overridden in order to perform a post-creation configuration of the passed document.

Parameters:
document - newly created document to be configured.

Find more information in the class documentation


getGraphPanelPopupMenuSource

public abstract JPopupMenuSourceWithUpdateUI getGraphPanelPopupMenuSource()
Returns a popup menu instance for this application's graph panels.

Returns:
a pop up menu instance for this application's graph panels.

Find more information in the class documentation


setGraphPanelPopupMenuSource

public abstract void setGraphPanelPopupMenuSource(JPopupMenuSourceWithUpdateUI graphPanelPopupMenuSource)
Sets the popup menu instance for this application's graph panels.

Parameters:
graphPanelPopupMenuSource -

Find more information in the class documentation


getToolBars

public abstract ToolBar[] getToolBars()
Returns the ToolBar instances used within this ApplicationFrame, the default one being at index 0 of the returned array.

Returns:
array of ToolBar instances used within this ApplicationFrame.

Find more information in the class documentation


getMDIComponent

public abstract MDIComponent getMDIComponent()
Returns the MDIComponent of the this ApplicationFrame.

Returns:
the MDIComponent of the this ApplicationFrame.

Find more information in the class documentation


getStatusBar

public abstract StatusBar getStatusBar()
Returns The StatusBar of the ApplicationFrame.

Returns:
StatusBar

Find more information in the class documentation


getCustomContainer

public abstract Container getCustomContainer()
Deprecated. use getCustomContainers() instead!

Returns a custom not yet specified type of Container.

Returns:
a custom Container.

getCustomContainers

public Container[] getCustomContainers()
Returns an array of custom not yet specified types of Containers.

Returns:
an array of custom Containers.

Find more information in the class documentation


getFrame

public abstract Frame getFrame()
Returns either the awt.Frame of this ApplicationFrame or null if this ApplicationFrame is running as Applet.

Returns:
Frame either an instance of java.awt.Frame or null.

Find more information in the class documentation


getLayoutConstraint

public abstract int getLayoutConstraint(Container container)
This method returns a layout constraint for a specific container. The return value must be one of the predefined layout constants of this class.

Parameters:
container - A container to retrieve the layout constraint for.
Returns:
the constraint to be used for the parameter container.
See Also:
NORTH, NORTHEAST, NORTHWEST, EAST, WEST, SOUTH, SOUTHEAST, SOUTHWEST

Find more information in the class documentation


newDocument

public abstract Document newDocument()
Creates a new Document. Such a document might be empty or filled with certain default items. This may depend on the application we are currently running.

Returns:
The created document

Find more information in the class documentation


openDocument

public abstract Document openDocument(java.io.File file)
This method is responsible to load a document from a specified file location. Internally calls openDocument(InputStream, String).

Parameters:
file - the location to load the document from.
Returns:
the document that has been read.

Find more information in the class documentation


openDocument

public abstract Document openDocument(java.io.InputStream is,
                                      java.lang.String name)
This method is responsible to load a document from a specified input stream.

Parameters:
is - the input stream to load the document from.
name - the name for the loaded document
Returns:
the document that has been read.

Find more information in the class documentation


saveDocument

public abstract void saveDocument(Document document,
                                  java.io.File file)
This method is responsible to save a given document to a specified file location. Internally calls saveDocument(Document, OutputStream).

Parameters:
document - the document to save.
file - the location to save the document to.

Find more information in the class documentation


saveDocument

public abstract void saveDocument(Document document,
                                  java.io.OutputStream os)
This method is responsible to save a given document to a specified output stream.

Parameters:
document - the document to save.
os - the OutputStream to save the document to.

Find more information in the class documentation


isApplet

public boolean isApplet()
Returns true if this ApplicationFrame is used in an AppletContext.

Returns:
true, if this Application runs in AppletContext.

Find more information in the class documentation


getUiMap

public java.util.HashMap getUiMap()
Returns the HashMap to collect all the language-switch affected controls. This map is used during the initialization process of this ApplicationFrame to collect all the controls which should be affected by the language switch.

Returns:
a map of ui-items.

updateStatus

public void updateStatus(java.lang.Object caller,
                         java.lang.Object obj)
This method can be seen as the ultimate drain for update signals. Application Containers and Commands that need to send out an application-wide update event should invoke this method. The ApplicationFrame will then invoke an update on all non-caller Containers, Menus, ToolBars, etc.

Parameters:
caller - The caller of this method.
obj - an optional parameter to pass an object along. This could be the updated item for example.

Find more information in the class documentation


getGraphDocumentReader

public abstract GraphDocumentReader getGraphDocumentReader()
Returns the GraphDocumentReader to use for reading documents.

Returns:
the GraphDocumentReader to use for reading documents.

Find more information in the class documentation


getGraphDocumentWriter

public abstract GraphDocumentWriter getGraphDocumentWriter()
Returns the GraphDocumentWriter to use for writing documents.

Returns:
the GraphDocumentWriter to use for writing documents.

Find more information in the class documentation


getRootFrame

public Frame getRootFrame()
Returns the root frame of this application.

Returns:
the root frame of this application.

Find more information in the class documentation


setAutomaticLayoutContextName

public void setAutomaticLayoutContextName(java.lang.String layoutContextName)
Deprecated. This method is no longer used by the framework

Sets the layout-context name to use for automatic layout.

All public string-constants defined in GraphLayoutController are possible. Also other values if appropriate layout-contexts were defined previously. Legal values are:

Please note that this layoutContext is used globally.

The default value for the automatic LayoutContext name is "_Hierarchical left to right" as defined in GraphLayoutController.HierarchicalToRight.

Parameters:
layoutContextName - the name of the layout context as String.

getAutomaticLayoutContextName

public java.lang.String getAutomaticLayoutContextName()
Deprecated. This method is no longer used by the framework

Returns the current layout-context name that is used when automatic layout is enabled.

Returns:
the current layout-context name for automatic layout.

installLayoutController

protected void installLayoutController(GraphApplication gapp,
                                       VisualGraphView vgv)
Configures the given VisualGraphView instance in case no LayoutController is associated to use a copy of the LayoutController assigned to the given GraphApplication and marked as default LayoutController.

Parameters:
gapp - the GraphApplication to take the default LayoutController from
vgv - the VisualGraphView instance to configure

installInteractionSettings

protected void installInteractionSettings(VisualGraphView vgv)
Configures the VisualGraphView to use the interaction settings that have been set in the preferences.

Parameters:
vgv - The VisualGraphView to configure

registerDragRepresentation

public boolean registerDragRepresentation(VisualGraphView vgv)
Override this method to register the drag representation for fixing Interactable instances. In subclasses call super after you have registered the representations.

Parameters:
vgv - The VisualGraphView the representation should be registered to.
Returns:
true, if a representation has been successfully registered.

registerHighlightRepresentation

public boolean registerHighlightRepresentation(VisualGraphView vgv)
Override this method to register the highlight representation for fixing Interactable instances. In subclasses call super after you have registered the representations.

Parameters:
vgv - The VisualGraphView the representation should be registered to.
Returns:
true, if a representation has been successfully registered.

installClipboard

protected void installClipboard(VisualGraphView vgv)
Configures the VisualGraphView to use the clipboard mode that has been set in the preferences.

Parameters:
vgv - The VisualGraphView to configure

installKeyboardCommands

protected void installKeyboardCommands(VisualGraphView vgv)
This protected method is used in order to add to the passed VisualGraphView mappings between KeyStrokes and BaseCommandes.

Parameters:
vgv - the VisualGraphView to add the keyboards to.
See Also:
KeyStrokeProvider.getCommandIds()

addKeyCommand

protected void addKeyCommand(VisualGraphView visualgraphview,
                             java.lang.String commandId)
This method retrieves the KeyStroke corresponding to the passed commandId using the KeyStrokeProvider class and adds it to the passed VisualGraphView.

Parameters:
visualgraphview - the VisualGraphView to the keyboard command to.
commandId - the command to add.

getResourceName

public java.lang.String getResourceName()
Deprecated. Use getResourceNames() instead!

Returns the complete name for the resource file. This method returns an empty string. Subclasses should overwrite it to specify their custom resource file.

Returns:
the complete name of the resource file to be loaded using the syntax of a resource bundle

getResourceNames

public java.util.List getResourceNames()
Returns a list of paths to resource files using the syntax of resource bundles. By default this will return a list with just one item retrieved from the getResourceName() method.
Subclasses may overwrite it to add additional resource files (e.g. in a new implementation layer).

Returns:
A list of resource files containing Strings of resource files paths.

setLocale

public void setLocale(java.util.Locale locale)
Sets the application locale, loads the text resources for the given locale and updates the gui.

Parameters:
locale - The locale to switch to.

updateResources

protected void updateResources(java.util.Locale locale)
Updates the text resources of the application for the given locale by (re)loading the resource bundles.

Parameters:
locale - The locale to load the resources for.

getAttributeEditorTranslatorPool

public AttributeEditorTranslatorPool getAttributeEditorTranslatorPool()
Returns the AttributeEditorTranslatorPool this application is using. This may be null if no pool is used.

Returns:
the AttributeEditorTranslatorPool this application is using

Find more information in the class documentation


getPreferenceAttributeEditorTranslator

public AttributeEditorTranslator getPreferenceAttributeEditorTranslator()
Returns the AttributeEditorTranslator this application is using for editing preferences. This may be null if none is used.

Returns:
the AttributeEditorTranslator this application is using for editing preferences.

Find more information in the class documentation


getAttributeEditorTranslator

public AttributeEditorTranslator getAttributeEditorTranslator()
Returns the AttributeEditorTranslator this application is using for editing attributes in the main attribute editor. This may be null if none is used.

Returns:
the AttributeEditorTranslator this application is using for editing attributes in the main attribute editor.

Find more information in the class documentation


getLayoutEditorTranslator

public AttributeEditorTranslator getLayoutEditorTranslator()
Returns the AttributeEditorTranslator this application is using for editing attributes in the layout attributes editor. This may be null if none is used.

Returns:
the AttributeEditorTranslator this application is using for editing attributes in the layout attribute editor.

Find more information in the class documentation


getAttributeEditorContainer

public abstract AttributeEditorContainer getAttributeEditorContainer()
Returns either the AttributeEditorContainer or null if no such Container is used by this Application.

Returns:
the AttributeEditorContainer of this Application or null.

Find more information in the class documentation


getNavigatorContainer

public abstract NavigatorContainer getNavigatorContainer()
Returns the NavigatorContainer of this Application or null if no such Container is used.

Returns:
the NavigatorContainer of this Application or null.

Find more information in the class documentation


getLayoutToolsContainer

public abstract LayoutToolsContainer getLayoutToolsContainer()
Returns the LayoutToolsContainer of this Application or null if no such Container is used.

Returns:
the LayoutToolsContainer of this Application or null.

Find more information in the class documentation


getOutlinerContainer

public abstract OutlinerContainer getOutlinerContainer()
Returns the OutlinerContainer of this Application or null if no such Container is used.

Returns:
the OutlinerContainer of this Application or null.

Find more information in the class documentation


getRepositoryContainer

public abstract RepositoryContainer getRepositoryContainer()
Returns the RepositoryContainer of this Application or null if no such Container is used.

Returns:
the RepositoryContainer of this Application or null.

Find more information in the class documentation


getApplication

public Application getApplication()
Returns the application this application frame belongs to.

Returns:
the application this application frame belongs to.

getDocumentDropContext

public DocumentDropContext getDocumentDropContext()
Returns the Document drop context to be used when files are dropped into the frame. Returns null by default because subclasses have to define an implementation depending on the window toolkit they're using.

Returns:
the Document drop context to be used when files are dropped into the frame.

getTitle

public java.lang.String getTitle()
Returns the title for this application frame that is used for the frame title. The default is the name of the application. Subclasses can override this to return different values.

Returns:
the title for this application frame that is used for the frame title.

addPostLaunchTask

public void addPostLaunchTask(java.lang.Runnable postLaunchTask)
Adds a Runnable that is processed when calling runPostLaunchTasks() which should be done after the application is on screen.

Parameters:
postLaunchTask - The Runnable to add

removePostLaunchTask

public boolean removePostLaunchTask(java.lang.Runnable postLaunchTask)
Removed a Runnable from the list that is processed when calling runPostLaunchTasks() which should be done after the application is on screen.

Parameters:
postLaunchTask - The Runnable to remove
Returns:
true, if an item has been removed

runPostLaunchTasks

public void runPostLaunchTasks()
Processes all added PostLaunchTasks


exit

public boolean exit()
Cleanup method that is called when the application will be closed to free all resources from the application frame and store all contained documents, etc.

Returns:
true if the exit was successful, false if the shutdown should be canceled

savePreferences

public abstract void savePreferences()
Stores the current settings of the application frame to the preferences


getKeyStrokeProvider

public KeyStrokeProvider getKeyStrokeProvider()
Deprecated. use Application.getKeyStrokeProvider() instead!

See Also:
Application.getKeyStrokeProvider()

getUIManager

public UIManager getUIManager()
Deprecated. use Application.getUIManager() instead!

See Also:
Application.getUIManager()

getPreferences

public Preferences getPreferences()
Deprecated. use Application.getPreferences() instead!

See Also:
Application.getPreferences()

getCommandRegistry

public CommandRegistry getCommandRegistry()
Deprecated. use Application.getCommandRegistry() instead!

See Also:
Application.getCommandRegistry()

setPreferences

public void setPreferences(Preferences preferences)
Deprecated. use Application.setPreferences(Preferences) instead!

See Also:
Application.setPreferences(Preferences)

getDefaultLayoutController

public LayoutController getDefaultLayoutController()
Deprecated. use GraphApplication.getDefaultLayoutController()

See Also:
GraphApplication.getDefaultLayoutController()

getDragContext

public DragContext getDragContext()
Deprecated. use GraphApplication.getDragContext()

See Also:
GraphApplication.getDragContext()

getLocale

public java.util.Locale getLocale()
Deprecated. use Application.getLocale()

See Also:
Application.getLocale()

getApplet

public Applet getApplet()
Deprecated. use Application.getApplet()

See Also:
Application.getApplet()

Find more information in the class documentation


getRuleRegistry

public RuleRegistry getRuleRegistry()
Deprecated. use GraphApplication.getRuleRegistry()

See Also:
GraphApplication.getRuleRegistry()

Find more information in the class documentation


setRuleRegistry

public void setRuleRegistry(RuleRegistry registry)
Deprecated. use {@link GraphApplication#setRuleRegistry(RuleRegistry)

See Also:
GraphApplication.setRuleRegistry(RuleRegistry)

Find more information in the class documentation


documentPreAdd

public void documentPreAdd(DocumentEvent documentevent)
                    throws DocumentEventVetoException
Description copied from interface: DocumentListener
Invoked when a document is about to be added to a mdicomponent. If the implementor throws the declared exception then the documentevent will be veto'd and the corresponding action will not be commence.

Specified by:
documentPreAdd in interface DocumentListener
Parameters:
documentevent - the documentevent structure carrying information.
Throws:
DocumentEventVetoException - indicates that the documentevent is not desired.

documentAdded

public void documentAdded(DocumentEvent documentevent)
Description copied from interface: DocumentListener
Invoked after a document was added to the mdicomponent.

Specified by:
documentAdded in interface DocumentListener
Parameters:
documentevent - the documentevent structure carrying information.

documentPreRemove

public void documentPreRemove(DocumentEvent documentevent)
                       throws DocumentEventVetoException
Description copied from interface: DocumentListener
Invoked when a document is about to be removed from a mdicomponent. If the implementor throws the declared exception then the documentevent will be veto'd and the corresponding action will not be commence.

Specified by:
documentPreRemove in interface DocumentListener
Parameters:
documentevent - the documentevent structure carrying information.
Throws:
DocumentEventVetoException - indicates that the documentevent is not desired.

documentRemoved

public void documentRemoved(DocumentEvent documentevent)
Description copied from interface: DocumentListener
Invoked after a document was removed from the mdicomponent.

Specified by:
documentRemoved in interface DocumentListener
Parameters:
documentevent - the documentevent structure carrying information.

documentSelected

public void documentSelected(DocumentEvent documentevent)
Description copied from interface: DocumentListener
Invoked after a document was selected in the mdicomponent.

Specified by:
documentSelected in interface DocumentListener
Parameters:
documentevent - the documentevent structure carrying information.

documentUnselected

public void documentUnselected(DocumentEvent documentevent)
Description copied from interface: DocumentListener
Invoked after a document was unselected in the mdicomponent.

Specified by:
documentUnselected in interface DocumentListener
Parameters:
documentevent - the documentevent structure carrying information.

documentModelChanged

public void documentModelChanged(DocumentEvent documentevent)
Description copied from interface: DocumentListener
Invoked after a document's model has changed. This means the data behind the document has changed subtantially and needs to be rehashed.

Specified by:
documentModelChanged in interface DocumentListener
Parameters:
documentevent - the documentevent structure carrying information.

getCompositeViewListener

protected final com.tensegrity.application.ApplicationFrame.CompositeViewListener getCompositeViewListener()


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