Runtime

## org.eclipse.gmf.runtime.diagram.ui.parts
Class DiagramGraphicalViewer

    java.lang.Object
      org.eclipse.gef.ui.parts.AbstractEditPartViewer
          org.eclipse.gef.ui.parts.GraphicalViewerImpl
              org.eclipse.gef.ui.parts.ScrollingGraphicalViewer
                  org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer

All Implemented Interfaces:
  EditPartViewer, GraphicalViewer, IDiagramGraphicalViewer, ISelectionProvider

Direct Known Subclasses:
  DiagramGraphicalViewerWithDnD

public class DiagramGraphicalViewer
extends ScrollingGraphicalViewer
implements IDiagramGraphicalViewer

Nested Class Summary

Nested classes inherited from class org.eclipse.gef.EditPartViewer
`EditPartViewer.Conditional`

Field Summary

Fields inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewer
`constantSelection, focusPart, selection, selectionListeners`

Constructor Summary
`DiagramGraphicalViewer()` Constructor

Method Summary
`boolean` `areUpdatesDisabled()`
`protected LightweightSystem` `createLightweightSystem()`
`void` `enableUpdates(boolean enable)`
`java.util.List` `findEditPartsForElement(java.lang.String elementIdStr, java.lang.Class editPartClass)` Finds all editparts of a specific class type on the diagram that have been registered for the given element.
`protected void` `fireSelectionChanged()` For performance reasons, we fire the event asynchronously
`void` `flush()` Overriden to also flush pending selection events to account for OS diffences, since we are firing selection change events asynchronously.
`protected void` `flushSelectionEvents(ISelection sel)` flush the selection events
`IDiagramEditDomain` `getDiagramEditDomain()` Method getDiagramEditDomain.
`ResourceManager` `getResourceManager()` Gets the resource manager to remember the resources allocated for this graphical viewer.
`IPreferenceStore` `getWorkspaceViewerPreferenceStore()` Returns the workspace preference store managed by the `DiagramEditor`, if one is being used.
`protected void` `hookControl()` Hook a zoom enabled graphics source
`void` `hookWorkspacePreferenceStore(IPreferenceStore store)` The editor manages the workspaces preferences store.
`void` `registerEditPartForElement(java.lang.String elementIdStr, EditPart ep)` Registers an editpart for an element in the element/editpart registry.
`void` `removeDragSourceListener(TransferDragSourceListener listener)` Refresh drag source adapters regardless if the adapter list is empty
`void` `removeDropTargetListener(TransferDropTargetListener listener)` Refresh drag target adapters regardless if the adapter list is empty
`protected void` `unhookControl()`
`void` `unregisterEditPartForElement(java.lang.String elementIdStr, EditPart ep)` Unregisters an editpart for a element in the element/editpart registry.

Methods inherited from class org.eclipse.gef.ui.parts.ScrollingGraphicalViewer
`createControl, getFigureCanvas, reveal, setRootFigure`

Methods inherited from class org.eclipse.gef.ui.parts.GraphicalViewerImpl
`createDefaultRoot, findHandleAt, findObjectAtExcluding, getEventDispatcher, getLayerManager, getLightweightSystem, getRootFigure, handleDispose, handleFocusGained, handleFocusLost, hookDropTarget, registerAccessibleEditPart, setContextMenu, setCursor, setDragSource, setEditDomain, setRootEditPart, setRouteEventsToEditDomain, unregisterAccessibleEditPart`

Methods inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewer

`addDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, addSelectionChangedListener, appendSelection, deselect, deselectAll, findObjectAt, findObjectAtExcluding, getContents, getContextMenu, getControl, getDelegatingDragAdapter, getDelegatingDropAdapter, getDragSource, getDropTarget, getEditDomain, getEditPartFactory, getEditPartRegistry, getFocusEditPart, getKeyHandler, getProperty, getRootEditPart, getSelectedEditParts, getSelection, getSelectionManager, getVisualPartMap, hookDragSource, init, primGetSelectedEditParts, refreshDragSourceAdapter, refreshDropTargetAdapter, removeDragSourceListener, removeDropTargetListener, removePropertyChangeListener, removeSelectionChangedListener, select, setContents, setContents, setControl, setDropTarget, setEditPartFactory, setFocus, setKeyHandler, setProperty, setSelection, setSelectionManager`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.eclipse.gef.GraphicalViewer
`findHandleAt`

Methods inherited from interface org.eclipse.gef.EditPartViewer

`addDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, appendSelection, createControl, deselect, deselectAll, findObjectAt, findObjectAtExcluding, findObjectAtExcluding, getContents, getContextMenu, getControl, getEditDomain, getEditPartFactory, getEditPartRegistry, getFocusEditPart, getKeyHandler, getProperty, getRootEditPart, getSelectedEditParts, getSelection, getSelectionManager, getVisualPartMap, registerAccessibleEditPart, removeDragSourceListener, removeDropTargetListener, removePropertyChangeListener, reveal, select, setContents, setContents, setContextMenu, setControl, setCursor, setEditDomain, setEditPartFactory, setFocus, setKeyHandler, setProperty, setRootEditPart, setRouteEventsToEditDomain, setSelectionManager, unregisterAccessibleEditPart`

Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider
`addSelectionChangedListener, removeSelectionChangedListener, setSelection`

Constructor Detail

### DiagramGraphicalViewer

    public DiagramGraphicalViewer()

  Constructor

Method Detail

### enableUpdates

    public void enableUpdates(boolean enable)

  Parameters:
    `enable` - `boolean` `true` if client wishes to disable updates on the figure canvas, `false` indicates normal updates are to take place.

### areUpdatesDisabled

    public boolean areUpdatesDisabled()

  Returns:

### createLightweightSystem

    protected LightweightSystem createLightweightSystem()

### hookControl

    protected void hookControl()

  Hook a zoom enabled graphics source

  See Also:
    `AbstractEditPartViewer.hookControl()`

### removeDragSourceListener

    public void removeDragSourceListener(TransferDragSourceListener listener)

  Refresh drag source adapters regardless if the adapter list is empty

  Specified by:
    `removeDragSourceListener` in interface `EditPartViewer`
  See Also:
    `AbstractEditPartViewer.removeDragSourceListener(TransferDragSourceListener)`

### removeDropTargetListener

    public void removeDropTargetListener(TransferDropTargetListener listener)

  Refresh drag target adapters regardless if the adapter list is empty

  Specified by:
    `removeDropTargetListener` in interface `EditPartViewer`
  See Also:
    `AbstractEditPartViewer.removeDropTargetListener(TransferDropTargetListener)`

### flush

    public void flush()

  Overriden to also flush pending selection events to account for OS diffences, since we are firing selection change events asynchronously.

  Specified by:
    `flush` in interface `EditPartViewer`

### fireSelectionChanged

    protected void fireSelectionChanged()

  For performance reasons, we fire the event asynchronously

### flushSelectionEvents

    protected void flushSelectionEvents(ISelection sel)

  flush the selection events

  Parameters:
    `sel` -

### getDiagramEditDomain

    public IDiagramEditDomain getDiagramEditDomain()

  Description copied from interface: `IDiagramGraphicalViewer`
  Method getDiagramEditDomain.

  Specified by:
    `getDiagramEditDomain` in interface `IDiagramGraphicalViewer`
  Returns:
    IDiagramEditDomain
  See Also:
    `IDiagramGraphicalViewer.getDiagramEditDomain()`

### findEditPartsForElement

    public java.util.List findEditPartsForElement(java.lang.String elementIdStr,
                                                  java.lang.Class editPartClass)

  Description copied from interface: `IDiagramGraphicalViewer`
  Finds all editparts of a specific class type on the diagram that have been registered for the given element.

  Specified by:
    `findEditPartsForElement` in interface `IDiagramGraphicalViewer`
  Parameters:
    `elementIdStr` - the element's id string
    `editPartClass` - the class of the editparts to be returned
  Returns:
    a List of editparts, if none exist an empty list is returned
  See Also:
    `IDiagramGraphicalViewer.findEditPartsForElement(java.lang.String, java.lang.Class)`

### registerEditPartForElement

    public void registerEditPartForElement(java.lang.String elementIdStr,
                                           EditPart ep)

  Description copied from interface: `IDiagramGraphicalViewer`
  Registers an editpart for an element in the element/editpart registry.

  Specified by:
    `registerEditPartForElement` in interface `IDiagramGraphicalViewer`
  Parameters:
    `elementIdStr` - the element's id string
    `ep` - the edit part to register for this element
  See Also:
    `IDiagramGraphicalViewer.registerEditPartForElement(java.lang.String, org.eclipse.gef.EditPart)`

### unregisterEditPartForElement

    public void unregisterEditPartForElement(java.lang.String elementIdStr,
                                             EditPart ep)

  Description copied from interface: `IDiagramGraphicalViewer`
  Unregisters an editpart for a element in the element/editpart registry.

  Specified by:
    `unregisterEditPartForElement` in interface `IDiagramGraphicalViewer`
  Parameters:
    `elementIdStr` - the element's id string
    `ep` - the edit part to register for this element
  See Also:
    `IDiagramGraphicalViewer.unregisterEditPartForElement(java.lang.String, org.eclipse.gef.EditPart)`

### hookWorkspacePreferenceStore

    public void hookWorkspacePreferenceStore(IPreferenceStore store)

  The editor manages the workspaces preferences store. So viewers not using a editor do not need to create a preference store. This method provides a hook for clients requiring access to the preference store.

  Parameters:
    `store` -

### getWorkspaceViewerPreferenceStore

    public IPreferenceStore getWorkspaceViewerPreferenceStore()

  Returns the workspace preference store managed by the `DiagramEditor`, if one is being used. May return null.

  Returns:
    the work space preference store

### getResourceManager

    public final ResourceManager getResourceManager()

  Gets the resource manager to remember the resources allocated for this graphical viewer. All resources will be disposed when the graphical viewer is closed if they have not already been disposed.

### unhookControl

    protected void unhookControl()

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.