de.cau.cs.kieler.core.model.handlers
Class ZoomToFitHandler

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.core.commands.AbstractHandler
          extended by de.cau.cs.kieler.core.model.handlers.ZoomToFitHandler
All Implemented Interfaces:
IHandler, IHandler2

public class ZoomToFitHandler
extends AbstractHandler

A handler used to zoom the diagram to fit.

Rating red

Constructor Summary
ZoomToFitHandler()
           
 
Method Summary
 Object execute(ExecutionEvent event)
          
static void resetViewLocation(IEditorPart editor)
          Reset the scrolling of the editor to the upper left corner.
static void zoomToFitAllNodes(IEditorPart editor)
          Zoom-to-fit the diagram in the given editor.
 
Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZoomToFitHandler

public ZoomToFitHandler()
Method Detail

execute

public Object execute(ExecutionEvent event)
               throws ExecutionException

Throws:
ExecutionException

zoomToFitAllNodes

public static void zoomToFitAllNodes(IEditorPart editor)
Zoom-to-fit the diagram in the given editor. This considers only nodes and no edges. The problem with edges is that zooming fails in case of collapsed compartments that contain edges.

Parameters:
editor - the editor to zoom

resetViewLocation

public static void resetViewLocation(IEditorPart editor)
Reset the scrolling of the editor to the upper left corner.

Parameters:
editor - the current editor