|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.command.BaseCommand
com.tensegrity.skeleton.commands.CommonBaseCommand
com.tensegrity.skeleton.swt.commands.SwtCommonBaseCommand
com.tensegrity.skeleton.swt.commands.SwtNewDocumentCommand
This command, to be used within applications in a SWT context, creates a new
GraphDocument and adds it to the
MDIComponent. Most of the new
GraphDocument configuration is
delegated to the application's ApplicationFrame.
Once created, the new GraphDocument
is configured through a call to the
SwtApplicationFrame.configureNewDocument(Document)
method.
Also, if a SwtPreferenceHelper
can be retrieved from the SwtApplicationFrame
the preferred ruler and grid settings are applied on the new
GraphDocument.
Overwrite the getDocumentName() method in order to customize the
default name of the newly created
GraphDocument.
| Constructor Summary | |
SwtNewDocumentCommand(ApplicationFrame applicationFrame,
java.lang.String command)
Creates a new SwtNewDocumentCommand. |
|
| Method Summary | |
protected VisualGraphView |
createDefaultVisualGraph(GraphController controller)
Creates and returns a new given
the passed . |
protected java.lang.String |
getDocumentName()
Returns a default document name. |
protected GraphDocument |
newDocument()
This routine creates a new (see
) then creates and returns a
corresponding .
|
protected GraphDocument |
newDocument(java.lang.String name,
GraphController controller,
VisualGraphView visualgraphview)
Creates and returns a new GraphDocument.
|
protected GraphDocument |
newDocument(VisualGraphView visualgraphview)
This methods creates a new GraphDocument. |
protected VisualGraphView |
newVisualGraphView()
This routine creates a new from the
instance then creates and
returns the associated .
|
protected VisualGraphView |
newVisualGraphView(Graph graph)
Creates and returns a new given
the passed .
|
void |
perform(java.lang.Object args)
This method creates a new Document, configures it (See
)
then adds it to the application MDIComponent. |
| Methods inherited from class com.tensegrity.skeleton.swt.commands.SwtCommonBaseCommand |
getGraphApplication, newGraphDocumentFromFactory |
| Methods inherited from class com.tensegrity.skeleton.commands.CommonBaseCommand |
getApplicationFrame, getTitle |
| Methods inherited from class com.tensegrity.generic.command.BaseCommand |
getDescription, getId, getPerformDescription, isEnabled, setEnabled |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SwtNewDocumentCommand(ApplicationFrame applicationFrame,
java.lang.String command)
SwtNewDocumentCommand.
applicationFrame - Application context for this command.command - the ID of this command.| Method Detail |
public void perform(java.lang.Object args)
Document, configures it (See
ApplicationFrame.configureNewDocument(Document))
then adds it to the application MDIComponent.
perform in interface Commandperform in class CommonBaseCommandCommand.perform(java.lang.Object)protected GraphDocument newDocument()
This routine creates a new (see
VisualGraphView) then creates and returns a
corresponding newVisualGraphView().
GraphDocument
GraphDocument
protected GraphDocument newDocument(java.lang.String name,
GraphController controller,
VisualGraphView visualgraphview)
GraphDocument.
This method delegates its call to
SwtCommonBaseCommand.newGraphDocumentFromFactory(String, GraphApplication, GraphController, VisualGraphView)
name - the initial name for the documentcontroller - the GraphController instance that keeps
the model.visualgraphview - the VisualGraphView instance to show in
the document.
GraphDocumentprotected GraphDocument newDocument(VisualGraphView visualgraphview)
GraphDocument. The name of
the document is retrieved from the getDocumentName() method.
This method will invoke the more general
newDocument(String, GraphController, VisualGraphView)
method.
visualgraphview - the VisualGraphView instance to show in
the document.
GraphDocumentprotected java.lang.String getDocumentName()
Returns a default document name. The name is automatically determined by the current suffix number which is incremented afterwards.
protected VisualGraphView newVisualGraphView()
This routine creates a new from the
Graph instance then creates and
returns the associated GraphModelFactory.
VisualGraphView
VisualGraphViewprotected VisualGraphView newVisualGraphView(Graph graph)
Creates and returns a new given
the passed VisualGRaphView.
See Graph.
createDefaultVisualGraph(GraphController)
graph - a Graph from which the return
VisualGraphView is returned.
VisualGraphViewprotected VisualGraphView createDefaultVisualGraph(GraphController controller)
Creates and returns a new given
the passed VisualGraphView. The view is
initialized with several default values. For instance, clipping is
enabled, select pasted elements is set to true, ports are enabled, loops
are allowed, the rule registry is set using the one provided by the
SwtApplicationFrame, default edge style and geometry are set.
GraphController
controller - the GraphController used to create the
returned VisualGraphView
VisualGraphView
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||