com.tensegrity.skeleton.commands
Class GraphDocumentCommand

java.lang.Object
  extended bycom.tensegrity.generic.command.BaseCommand
      extended bycom.tensegrity.skeleton.commands.CommonBaseCommand
          extended bycom.tensegrity.skeleton.commands.DocumentCommand
              extended bycom.tensegrity.skeleton.commands.GraphDocumentCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AbstractInsertElementCommand, CloneDocumentCommand, DebugGraphCommand, EditDocumentSettingsCommand, EditGraphDocumentCommand, EditRuleConfigurationCommand, FindElementsCommand, FitToViewportCommand, FlipXCommand, FlipYCommand, ImportDocumentLayouts, InsertCustomAttributeCommand, NewViewCommand, PageSetupCommand, PrintCommand, PrintPreviewCommand, RuleEditorCommand, SaveVisualGraphCommand, ShowPropertiesCommand, SwtZoomGraphDocumentCommand, ToggleAntialiasCommand, ToggleAutomaticLayoutCommand, ToggleConnectModeCommand, ToggleFullscreenCommand, ViewGridCommand, ViewRulerCommand, ZoomGraphDocumentCommand

public abstract class GraphDocumentCommand
extends DocumentCommand

This abstract Command implementation is the base class for all commands that deal with GraphDocument instances.

This class extends the DocumentCommand in the manner in which it implements the method isEnabled(). The implementation for this method fits for most commands that refer to a GraphDocument.

Version:
$Id: GraphDocumentCommand.java,v 1.20 2006/01/30 11:56:45 BurkhardWick Exp $
Author:
GillesIachelini

Constructor Summary
GraphDocumentCommand(ApplicationFrame applicationFrame, java.lang.String command)
          Creates the GraphDocumentCommand.
 
Method Summary
protected  GraphDocument getGraphDocument()
          Returns the current document as GraphDocument, if it is one, otherwise null.
 VisualGraphView getVisualGraphView()
          Returns the VisualGraphView of the currently active document.
 boolean isEnabled()
          (non-Javadoc) This method returns true if the currently active Document is an instance of GraphDocument.
 
Methods inherited from class com.tensegrity.skeleton.commands.DocumentCommand
getDocument, getGraphApplication, newGraphDocumentFromFactory
 
Methods inherited from class com.tensegrity.skeleton.commands.CommonBaseCommand
getApplicationFrame, getTitle, perform
 
Methods inherited from class com.tensegrity.generic.command.BaseCommand
getDescription, getId, getPerformDescription, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphDocumentCommand

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

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

isEnabled

public boolean isEnabled()
(non-Javadoc) This method returns true if the currently active Document is an instance of GraphDocument.

Specified by:
isEnabled in interface Command
Overrides:
isEnabled in class BaseCommand

getVisualGraphView

public VisualGraphView getVisualGraphView()
Returns the VisualGraphView of the currently active document. This method returns null either when DocumentCommand.getDocument() method returns null, or the current document is not of type GraphDocument.

Returns:
the VisualGraphView of the current GraphDocument.

getGraphDocument

protected GraphDocument getGraphDocument()
Returns the current document as GraphDocument, if it is one, otherwise null.

Returns:
the GraphDocument or null.


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