com.tensegrity.skeleton.commands
Class DocumentCommand

java.lang.Object
  extended bycom.tensegrity.generic.command.BaseCommand
      extended bycom.tensegrity.skeleton.commands.CommonBaseCommand
          extended bycom.tensegrity.skeleton.commands.DocumentCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AbstractOpenCommand, CancelCommand, CloseAllCommand, CloseCommand, GraphDocumentCommand, NewDocumentCommand

public abstract class DocumentCommand
extends CommonBaseCommand

This abstract base class is responsible for all document-related commands and provides useful utility methods callable by derived classes.

Version:
$Id: DocumentCommand.java,v 1.26 2005/12/16 09:07:16 BurkhardWick Exp $
Author:
GillesIachelini

Constructor Summary
DocumentCommand(ApplicationFrame applicationFrame, java.lang.String command)
          Creates the DocumentCommand.
 
Method Summary
protected  Document getDocument()
          The method getDocument returns the current active Document or null.
protected  GraphApplication getGraphApplication()
          Returns the graph application this command is registered in ApplicationFrame instance.
protected  GraphDocument newGraphDocumentFromFactory(java.lang.String name, GraphApplication graphapplication, GraphController graphcontroller, VisualGraphView visualgraphview)
          This method invokes the newGraphDocument method in the document factory and can be overridden by subclasses to perform custom post-intialization work.
 
Methods inherited from class com.tensegrity.skeleton.commands.CommonBaseCommand
getApplicationFrame, getTitle, perform
 
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

DocumentCommand

public DocumentCommand(ApplicationFrame applicationFrame,
                       java.lang.String command)
Creates the DocumentCommand.

Parameters:
applicationFrame - Application context of this command.
command - the ID of this command.
Method Detail

getDocument

protected Document getDocument()
The method getDocument returns the current active Document or null.

Returns:
Document the current active Document or null.

getGraphApplication

protected GraphApplication getGraphApplication()
Returns the graph application this command is registered in ApplicationFrame instance.

Returns:
a GraphApplication instance.

newGraphDocumentFromFactory

protected GraphDocument newGraphDocumentFromFactory(java.lang.String name,
                                                    GraphApplication graphapplication,
                                                    GraphController graphcontroller,
                                                    VisualGraphView visualgraphview)
This method invokes the newGraphDocument method in the document factory and can be overridden by subclasses to perform custom post-intialization work.

Parameters:
name - name of the document.
graphapplication - reference to the application context.
graphcontroller - the GraphController instance that keeps the model.
visualgraphview - the visualgraph instance to show in the document.
Returns:
the created graph document instance.


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