|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.application.ApplicationFrame
com.tensegrity.skeleton.swt.SwtApplicationFrame
This is the SWT-based implementation of
ApplicationFrame.
A single constructor is provided for this class, which requires a valid
Display and parent
ExtendedShell as parameter.
Notice that at this point in time a single SWT-based MDIComponent
implementation is currently available and is returned by the getMDIComponent() method.
See SwtTabbedMDIComponent for more information.
The following Container are currently
available through this ApplicationFrame:
getNavigatorContainer()
(returns a SwtNavigatorContainer)
getRepositoryContainer()
(returns a SwtRepositoryContainer)
getAttributeEditorContainer()
(returns a SwtAttributeTreeContainer)
getLayoutToolsContainer()
(returns a SwtLayoutToolsContainer)
OutlinerContainer is available,
therefore getOutlinerContainer() returns null.
It is the application developer's responsability to organize the layout of
the MDI Component and of the containers. The launch task
SwtInitGUILaunchTask sets a default
layout but is intended to be extended by application developers wishing to
customize it. It allows them to modify the layout of the application
Shell as well as the layout data of all
Containers.
Notice that a good understanding of layouts in SWT is required in order to
modify the default layout.
Refer to
http://www.eclipse.org/articles/Understanding%20Layouts/Understanding%20Layouts.htm
for more information regarding layouts in SWT.
In order to avoid having the splashscreen beeing displayed, which is
typically the case for Eclipse Plug-ins, one should overwrite
the getSplashScreenImage() method and make it return null.
null.
One should call the exit() method before terminating the application
(that is, before the parent
ExtendedShell is closed). This method
handles the closing of documents and ensures that preferences are saved as
well as releasing locally held resources.
| Nested Class Summary | |
class |
SwtApplicationFrame.NavigatorUpdater
The NavigatorUpdater is an Observer which updates
the Navigator of an ApplicationFrame. |
| Field Summary | |
static org.eclipse.jface.resource.ColorRegistry |
colorRegistry
ColorRegistry used in order to efficiently manage Colors in the plug-in |
protected org.eclipse.swt.widgets.Display |
display
This is the |
protected SwtLayoutToolsContainer |
layoutTools
The LayoutTools of this application. |
protected MDIDelegate |
mdicomponent
instance variable for the opened graph views |
protected ExtendedShell |
shell
When being in application(non-applet-) mode, this instance represents the outer Shell instance. |
| Fields inherited from class com.tensegrity.application.ApplicationFrame |
application, EAST, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, TYPE_CLONED_DOCUMENT, TYPE_LOADED_DOCUMENT, TYPE_NEW_DOCUMENT, UNDEFINED, WEST |
| Constructor Summary | |
SwtApplicationFrame(org.eclipse.swt.widgets.Display display,
ExtendedShell frame)
Deprecated. Use SwtApplicationFrame(GraphApplication, Display, ExtendedShell) instead! |
|
SwtApplicationFrame(GraphApplication application,
org.eclipse.swt.widgets.Display display,
ExtendedShell frame)
Creates a SwtApplicationFrame based on the given
and .
|
|
| Method Summary | |
void |
applyEvList()
Tells the component to apply its UIItemEvaluationList. |
void |
configureDocumentView(Document document,
int documenttype)
This method is called from .
|
void |
configureEmptyDocument(Document document)
Does nothing. |
void |
configureNewDocument(Document document)
This method performs post-creation configuration of the passed document. |
protected boolean |
doValidateDocument(GraphDocument document)
This method is called, whenever a document is opened. |
boolean |
dropDocument(java.io.File file)
|
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()
Returns null since Applets are not relevant in the SWT-context. |
protected org.eclipse.swt.graphics.Image |
getApplicationIconImage()
Returns null. |
AttributeEditorContainer |
getAttributeEditorContainer()
This method creates and returns the internal instance of SwtAttributeTreeContainer which is currently the only
SWT-based implementation of the AttributeEditorContainer
interface. |
Container |
getCustomContainer()
At the current state of development of the SWT part of the library this method inherited from ApplicationFrame is not relevant and
therefore always returns null. |
org.eclipse.swt.widgets.Display |
getDisplay()
Returns the Display used within this SWT
application |
Frame |
getFrame()
Returns either the awt.Frame of this ApplicationFrame or null if this ApplicationFrame is running as Applet. |
protected GraphApplication |
getGraphApplication()
Returns the GraphApplication.
|
GraphDocumentReader |
getGraphDocumentReader()
Returns the GraphDocumentReader to use for reading documents. |
GraphDocumentWriter |
getGraphDocumentWriter()
Returns a GraphDocumentWriter instance |
JPopupMenuSourceWithUpdateUI |
getGraphPanelPopupMenuSource()
Returns the local
|
protected LaunchTask[] |
getLauncherTasks()
Returns all the LaunchTasks to be executed while starting the
application. |
int |
getLayoutConstraint(Container container)
At the current state of development of the SWT part of the library this method inherited from ApplicationFrame is not relevant and
therefore always returns 0. |
LayoutToolsContainer |
getLayoutToolsContainer()
Returns the LayoutToolsContainer of this Application
or null if no such Container is used. |
MDIComponent |
getMDIComponent()
Returns the MDIComponent of the this
ApplicationFrame. |
MenuBar |
getMenuBar()
Returns the MenuBar of this ApplicationFrame. |
NavigatorContainer |
getNavigatorContainer()
Returns the NavigatorContainer of this Application
or null if no such Container is used. |
OutlinerContainer |
getOutlinerContainer()
Is intended to return the ObjectTreeContainer of this
Application but since there is currently no such component
for SWT applications, it returns null. |
SwtPreferenceHelper |
getPreferenceHelper()
Returns the preference helper of this application. |
RepositoryContainer |
getRepositoryContainer()
Creates and returns an instance of SwtRepositoryContainer. |
java.lang.String |
getResourceName()
Deprecated. Use ApplicationFrame.getResourceNames() instead. |
protected org.eclipse.swt.graphics.Image |
getSplashScreenImage()
Returns Tensegrity's default splashscreen image. |
StatusBar |
getStatusBar()
At this point in time no status bar is provided by the framework for SWT applications therefore this method returns null. |
ToolBar[] |
getToolBars()
Returns the ToolBar instances used within this ApplicationFrame,
the default one being at index 0 of the returned array. |
void |
init()
Initializes the ApplicationFrame. |
protected void |
initServices()
Utility method called from the constructor of this SwtApplicationFrame. |
void |
installEvList()
Creates a new UIItemEvaluationList |
boolean |
isApplet()
Returns false since we do not have applets within the SWT context. |
protected void |
launchTasks()
Retrieves all the launcher tasks for this application and starts them. |
Document |
newDocument()
Sublcasses may override it to specify the creation of new documents. |
Document |
openDocument(java.io.File file)
This method is responsible to load a document from a specified file location. |
Document |
openDocument(java.io.InputStream is,
java.lang.String name)
This method is responsible to load a document from a specified input stream. |
protected void |
postLaunch()
This method will be invoked right after the last launch task has been executed. |
void |
saveDocument_org(Document document,
java.io.File file)
|
void |
saveDocument(Document document,
java.io.File file)
This method is responsible to save a given document to a specified file location. |
void |
saveDocument(Document document,
java.io.OutputStream os)
This method is responsible to save a given document to a specified output stream. |
void |
savePreferences()
Saves the currently stored Preferences of this application. |
protected void |
setApplicationIcon()
The method setApplicationIcon sets the image icon at the internal
instance. |
void |
setGraphPanelPopupMenuSource(JPopupMenuSourceWithUpdateUI graphPanelPopupMenuSource)
Sets the local
|
void |
setPreferenceHelper(SwtPreferenceHelper helper)
Sets the preference helper of this application. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static org.eclipse.jface.resource.ColorRegistry colorRegistry
ColorRegistry used in order to efficiently manage Colors in the plug-in
protected SwtLayoutToolsContainer layoutTools
protected ExtendedShell shell
protected org.eclipse.swt.widgets.Display display
protected MDIDelegate mdicomponent
| Constructor Detail |
public SwtApplicationFrame(org.eclipse.swt.widgets.Display display,
ExtendedShell frame)
SwtApplicationFrame(GraphApplication, Display, ExtendedShell) instead!
SwtApplicationFrame based on the given Display
and ExtendedShell.
Note that this constructor internally calls the initServices() method.
display - the Display used for the SWT
applicationframe - the ExtendedShell to place this application
into.
public SwtApplicationFrame(GraphApplication application,
org.eclipse.swt.widgets.Display display,
ExtendedShell frame)
SwtApplicationFrame based on the given Display
and ExtendedShell.
Note that this constructor internally calls the initServices() method.
application - The graph application this application frame
belongs todisplay - the Display used for the SWT
applicationframe - the ExtendedShell to place this application
into.| Method Detail |
public final org.eclipse.swt.widgets.Display getDisplay()
Display used within this SWT
application
Display used within this SWT
applicationprotected void initServices()
public void configureNewDocument(Document document)
SwtGraphPaneland VisualGraphView
are initialized as follow:
#getSwtGraphPanelPopupMenuSource().
SwtGraphPanel.setAutoScale(boolean)is set to false.
VisualGraphView#setCutflags(int)is set to
VisualGraphView#CUT_FLAG_IGNORE_CHAINS.
VisualGraphView.enableUndoRedo()
configureEmptyDocument(Document)
and configureNewDocument(Document).
configureNewDocument in class ApplicationFramedocument - The document to configure.ApplicationFrame.configureNewDocument(com.tensegrity.gui.document.Document),
SwtNewDocumentCommand,
OpenCommand,
CloneDocumentCommandpublic void configureEmptyDocument(Document document)
configureNewDocument(Document).
configureEmptyDocument in class ApplicationFramedocument - The document to configureApplicationFrame.configureEmptyDocument(com.tensegrity.gui.document.Document)
public void configureDocumentView(Document document,
int documenttype)
configureNewDocument(Document).
The passed document's SwtGraphPaneland VisualGraphView
are initialized as follow:
#getSwtGraphPanelPopupMenuSource().
SwtGraphPanel.setAutoScale(boolean)is set to false.
VisualGraphView#setCutflags(int)is set to
VisualGraphView#CUT_FLAG_IGNORE_CHAINS.
VisualGraphView.enableUndoRedo()
GraphDocument s the LayoutController
is set up.
configureDocumentView in class ApplicationFramedocument - The document to configuredocumenttype - A constant describing the source of this document,
one of these constants:
ApplicationFrame.TYPE_NEW_DOCUMENT
ApplicationFrame.TYPE_CLONED_DOCUMENT
ApplicationFrame.TYPE_LOADED_DOCUMENTApplicationFrame.configureDocumentView(com.tensegrity.gui.document.Document,
int)public Container getCustomContainer()
ApplicationFrame is not relevant and
therefore always returns null.
getCustomContainer in class ApplicationFramenull.public Frame getFrame()
ApplicationFramenull if this ApplicationFrame is running as Applet.
getFrame in class ApplicationFramenull.public int getLayoutConstraint(Container container)
ApplicationFrame is not relevant and
therefore always returns 0.
getLayoutConstraint in class ApplicationFramecontainer - A container to retrieve the layout constraint for.
ApplicationFrame.getLayoutConstraint(com.tensegrity.gui.container.Container)public MDIComponent getMDIComponent()
ApplicationFrameMDIComponent of the this
ApplicationFrame.
getMDIComponent in class ApplicationFrameMDIComponent of the this
ApplicationFrame.public MenuBar getMenuBar()
ApplicationFrame
getMenuBar in class ApplicationFramepublic StatusBar getStatusBar()
null.
getStatusBar in class ApplicationFramenull.ApplicationFrame.getStatusBar()public void init()
init in class ApplicationFrameprotected void launchTasks()
getSplashScreenImage() method and make it return
null.
getLauncherTasks()protected void postLaunch()
public boolean isApplet()
false since we do not have applets within the SWT context.
isApplet in class ApplicationFramefalseprotected LaunchTask[] getLauncherTasks()
LaunchTasks to be executed while starting the
application. Subclasses may either alter this list or use their
custom versions of Task implementations.
LaunchTasks containing the following tasks in
the specified order:
LoadGeometriesLaunchTaskLoadStylesLaunchTaskSwtLoadRulesLaunchTaskLoadElementsLaunchTaskSwtLoadPreferencesLaunchTaskSwtCommandLaunchTaskSwtFileMenuLaunchTaskSwtEditMenuLaunchTaskSwtViewMenuLaunchTaskSwtToolsMenuLaunchTaskSwtGraphPanelPopupMenuLaunchTaskSwtToolBarLaunchTaskSwtRepositoryLaunchTaskSwtInitMDIComponentLaunchTaskSwtNavigatorLaunchTaskSwtAttributeTreeLaunchTaskSwtLayoutToolsLaunchTaskSwtSetPreferencesLaunchTaskSwtInitGUILaunchTaskpublic Document newDocument()
newDocument in class ApplicationFramenullApplicationFrame.newDocument()protected GraphApplication getGraphApplication()
Returns the GraphApplication.
GraphApplication.
public Document openDocument(java.io.InputStream is,
java.lang.String name)
ApplicationFrame
openDocument in class ApplicationFrameis - the input stream to load the document from.name - the name for the loaded document
public void saveDocument(Document document,
java.io.OutputStream os)
ApplicationFrame
saveDocument in class ApplicationFramedocument - the document to save.os - the OutputStream to save the document to.public Document openDocument(java.io.File file)
ApplicationFrameApplicationFrame.openDocument(InputStream, String).
openDocument in class ApplicationFramefile - the location to load the document from.
public GraphDocumentReader getGraphDocumentReader()
ApplicationFrame
getGraphDocumentReader in class ApplicationFramepublic GraphDocumentWriter getGraphDocumentWriter()
Returns a GraphDocumentWriter instance
getGraphDocumentWriter in class ApplicationFrame
public void saveDocument(Document document,
java.io.File file)
ApplicationFrameApplicationFrame.saveDocument(Document, OutputStream).
saveDocument in class ApplicationFramedocument - the document to save.file - the location to save the document to.
public void saveDocument_org(Document document,
java.io.File file)
public boolean exit()
ApplicationFrame
exit in class ApplicationFramepublic AttributeEditorContainer getAttributeEditorContainer()
SwtAttributeTreeContainer which is currently the only
SWT-based implementation of the AttributeEditorContainer
interface.
getAttributeEditorContainer in class ApplicationFrameSwtAttributeTreeContainer.com.tensegrity.application.Application#getAttributeEditorContainer()public LayoutToolsContainer getLayoutToolsContainer()
ApplicationFrameLayoutToolsContainer of this Application
or null if no such Container is used.
getLayoutToolsContainer in class ApplicationFrameLayoutToolsContainer of this Application
or null.public NavigatorContainer getNavigatorContainer()
ApplicationFrameNavigatorContainer of this Application
or null if no such Container is used.
getNavigatorContainer in class ApplicationFrameNavigatorContainer of this Application
or null.public OutlinerContainer getOutlinerContainer()
ObjectTreeContainer of this
Application but since there is currently no such component
for SWT applications, it returns null.
getOutlinerContainer in class ApplicationFramenull.com.tensegrity.application.Application#getOutlinerContainer()public RepositoryContainer getRepositoryContainer()
SwtRepositoryContainer.
getRepositoryContainer in class ApplicationFrameSwtRepositoryContainer.com.tensegrity.application.Application#getRepositoryContainer()public java.lang.String getResourceName()
ApplicationFrame.getResourceNames() instead.
getResourceName in class ApplicationFramepublic boolean dropDocument(java.io.File file)
public void applyEvList()
EvaluableUIItemEvaluationList.
public void installEvList()
Evaluable.installEvList()protected final void setApplicationIcon()
Decorations
instance.
protected org.eclipse.swt.graphics.Image getApplicationIconImage()
null. Subclasses may override this method to
specify their own icon. If this method is not specified by a subclass,
the frame will use the java standard icon.
null.protected org.eclipse.swt.graphics.Image getSplashScreenImage()
null if no splashscreen should be
displayed, which is typically the case for Eclipse plug-ins.
public ToolBar[] getToolBars()
ApplicationFrameToolBar instances used within this ApplicationFrame,
the default one being at index 0 of the returned array.
getToolBars in class ApplicationFrameToolBar instances used within this
ApplicationFrame.public JPopupMenuSourceWithUpdateUI getGraphPanelPopupMenuSource()
Returns the local JPopupMenuSourceWithUpdateUI
getGraphPanelPopupMenuSource in class ApplicationFrameJPopupMenuSourceWithUpdateUIpublic void setGraphPanelPopupMenuSource(JPopupMenuSourceWithUpdateUI graphPanelPopupMenuSource)
Sets the local JPopupMenuSourceWithUpdateUI
setGraphPanelPopupMenuSource in class ApplicationFramegraphPanelPopupMenuSource - the JPopupMenuSourceWithUpdateUI to setpublic Applet getApplet()
null since Applets are not relevant in the SWT-context.
getApplet in class ApplicationFramenull.ApplicationFrame.getApplet()protected boolean doValidateDocument(GraphDocument document)
openDocument(File) method calls this method to allow a
validation of the document. Subclasses may override this method to apply
a detailed validation process on the given document.
document - the Document instance to validate
true to indicate a successful validation,
false otherwise.public void savePreferences()
ApplicationFrame.getPreferences() returns null.
savePreferences in class ApplicationFramepublic SwtPreferenceHelper getPreferenceHelper()
public void setPreferenceHelper(SwtPreferenceHelper helper)
helper - the PreferenceHelper to set.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||