com.tensegrity.skeleton.swt.commands
Class SwtZoomGraphDocumentCommand

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
                  extended bycom.tensegrity.skeleton.swt.commands.SwtZoomGraphDocumentCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
SwtZoomCommand, SwtZoomGraphCommand

public abstract class SwtZoomGraphDocumentCommand
extends GraphDocumentCommand

The SwtZoomGraphDocumentCommand acts as a base class for all zoom related commands in SWT context. Thus it provides methods to retrieve the current zoom value and setting it.

Version:
$Id: SwtZoomGraphDocumentCommand.java,v 1.3 2005/12/20 14:33:35 ArndHouben Exp $
Author:
S�bastien Guyon

Field Summary
protected  boolean dontUpdate
          This update flag is required to avoid loops while updating the combobox.
protected static double MAXIMUM_ZOOM_LIMIT
          Constants for the zoom limits
protected static double MINIMUM_ZOOM_LIMIT
          Constants for the zoom limits
protected  int value
          the zoom value this command zooms the active graph to.
static Boundary ZOOM_INSETS
          Insets to use for zoom to fit
 
Constructor Summary
SwtZoomGraphDocumentCommand(ApplicationFrame applicationFrame, java.lang.String command)
          Constructor for the SwtZoomGraphDocumentCommand.
 
Method Summary
protected  double getZoom()
          returns the current zoom value of the graph.
 void setZoom(double zoomvalue)
          sets the zoom value of the graph view.
protected  void setZoomToFit()
          sets the zoom value of the graph view to fit all existing items.
 
Methods inherited from class com.tensegrity.skeleton.commands.GraphDocumentCommand
getGraphDocument, getVisualGraphView, isEnabled
 
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
 

Field Detail

ZOOM_INSETS

public static final Boundary ZOOM_INSETS
Insets to use for zoom to fit


MINIMUM_ZOOM_LIMIT

protected static final double MINIMUM_ZOOM_LIMIT
Constants for the zoom limits

See Also:
Constant Field Values

MAXIMUM_ZOOM_LIMIT

protected static final double MAXIMUM_ZOOM_LIMIT
Constants for the zoom limits

See Also:
Constant Field Values

value

protected int value
the zoom value this command zooms the active graph to.


dontUpdate

protected boolean dontUpdate
This update flag is required to avoid loops while updating the combobox. Each time the ComboBox sets this flag, the combobox isnt updated. Otherwise the current zoomValue is set onto the combo as well.

Constructor Detail

SwtZoomGraphDocumentCommand

public SwtZoomGraphDocumentCommand(ApplicationFrame applicationFrame,
                                   java.lang.String command)
Constructor for the SwtZoomGraphDocumentCommand.

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

getZoom

protected double getZoom()
returns the current zoom value of the graph.

Returns:
double

setZoom

public void setZoom(double zoomvalue)
sets the zoom value of the graph view.

Parameters:
zoomvalue - the value to set the zoom to.

setZoomToFit

protected void setZoomToFit()
sets the zoom value of the graph view to fit all existing items.



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