Package org.eclipse.gef.ui.parts
Class GraphicalViewerImpl
java.lang.Object
org.eclipse.gef.ui.parts.AbstractEditPartViewer
org.eclipse.gef.ui.parts.GraphicalViewerImpl
- All Implemented Interfaces:
- EditPartViewer,- GraphicalViewer,- ISelectionProvider
- Direct Known Subclasses:
- ScrollingGraphicalViewer
An EditPartViewer implementation based on 
Figures.- 
Nested Class SummaryNested classes/interfaces inherited from interface org.eclipse.gef.EditPartViewerEditPartViewer.Conditional
- 
Field SummaryFields inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewerconstantSelection, focusPart, selection, selectionListeners
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a GraphicalViewerImpl with the default root editpart.
- 
Method SummaryModifier and TypeMethodDescriptioncreateControl(Composite composite) Optionally creates the defaultControlusing the default style.protected voidCreates the default root editpart.protected LightweightSystemCreates the lightweight system used to host figures.Returns theHandleat the specified Point.findObjectAtExcluding(Point pt, Collection<IFigure> exclude, EditPartViewer.Conditional condition) Returnsnullor theEditPartat the specified location, using the given exclusion set and conditional.voidflush()Flushes and pending layouts and paints in the lightweight system.protected DomainEventDispatcherDeprecated.This method should not be called by subclassesprotected LayerManagerConvenience method for finding the layer manager.protected LightweightSystemReturns the lightweight system.protected IFigureDeprecated.There is no reason to call this method $TODO delete this methodprotected voidCalled if and when theControlis disposed.protected voidThis method is invoked when this viewer's control gains focus.protected voidThis method is invoked when this viewer's control loses focus.protected voidExtended to tell the lightweight system what its control is.protected voidExtended to flush paints during drop callbacks.protected voidHook the root figure into this viewer'sLightweightSystem.voidRegisters the accessible editpart with the event dispatcher.voidReveals the specified editpart by usingExposeHelpers.voidsetContextMenu(MenuManager contextMenu) Extended implementation to flush the viewer as the context menu is shown.voidSets the cursor for the viewer'sControl.protected voidsetDragSource(DragSource source) Extends the drag source to handle figures which handle MouseDown events, thereby aborting any DragDetect callbacks.voidsetEditDomain(EditDomain domain) Sets theEditDomainfor this viewer.voidsetRootEditPart(RootEditPart editpart) Sets the root of this viewer.protected voidsetRootFigure(IFigure figure) Deprecated.This method should no longer be used.voidsetRouteEventsToEditDomain(boolean value) Turns on/off the routing of events directly to the Editor.protected voidCalled when the control is being set tonull, but before it is null.voidDoes nothing by default.Methods inherited from class org.eclipse.gef.ui.parts.AbstractEditPartVieweraddDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, addSelectionChangedListener, appendSelection, deselect, deselectAll, findObjectAt, findObjectAtExcluding, fireSelectionChanged, getContents, getContextMenu, getControl, getDelegatingDragAdapter, getDelegatingDropAdapter, getDragSource, getDropTarget, getEditDomain, getEditPartFactory, getEditPartForModel, getEditPartRegistry, getFocusEditPart, getKeyHandler, getProperty, getResourceManager, getRootEditPart, getSelectedEditParts, getSelection, getSelectionManager, getVisualPartMap, hookDragSource, init, primGetSelectedEditParts, refreshDragSourceAdapter, refreshDropTargetAdapter, removeDragSourceListener, removeDragSourceListener, removeDropTargetListener, removeDropTargetListener, removePropertyChangeListener, removeSelectionChangedListener, select, setContents, setContents, setControl, setDropTarget, setEditPartFactory, setFocus, setKeyHandler, setProperty, setSelection, setSelectionManagerMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.gef.EditPartVieweraddDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, appendSelection, deselect, deselectAll, findObjectAt, findObjectAtExcluding, getContents, getContextMenu, getControl, getEditDomain, getEditPartFactory, getEditPartForModel, getEditPartRegistry, getFocusEditPart, getKeyHandler, getProperty, getResourceManager, getRootEditPart, getSelectedEditParts, getSelection, getSelectionManager, getVisualPartMap, removeDragSourceListener, removeDragSourceListener, removeDropTargetListener, removeDropTargetListener, removePropertyChangeListener, select, setContents, setContents, setControl, setEditPartFactory, setFocus, setKeyHandler, setProperty, setSelectionManagerMethods inherited from interface org.eclipse.jface.viewers.ISelectionProvideraddSelectionChangedListener, removeSelectionChangedListener, setSelection
- 
Constructor Details- 
GraphicalViewerImplpublic GraphicalViewerImpl()Constructs a GraphicalViewerImpl with the default root editpart.
 
- 
- 
Method Details- 
createControlDescription copied from interface:EditPartViewerOptionally creates the defaultControlusing the default style. The Control can also be created externally and then set into the Viewer.- Specified by:
- createControlin interface- EditPartViewer
- Specified by:
- createControlin class- AbstractEditPartViewer
- Parameters:
- composite- the parent in which create the SWT- Control
- Returns:
- the created Control for convenience
- See Also:
 
- 
createDefaultRootprotected void createDefaultRoot()Creates the default root editpart. Called during construction.
- 
createLightweightSystemCreates the lightweight system used to host figures. Subclasses should not need to override this method.- Returns:
- the lightweight system
 
- 
handleDisposeDescription copied from class:AbstractEditPartViewerCalled if and when theControlis disposed. Subclasses may extend this method to perform additional cleanup.- Overrides:
- handleDisposein class- AbstractEditPartViewer
- Parameters:
- e- the disposeevent
- See Also:
 
- 
handleFocusGainedThis method is invoked when this viewer's control gains focus. It gives focus to thefocusPart, if there is one.- Parameters:
- fe- the focusEvent received by this viewer's control
 
- 
handleFocusLostThis method is invoked when this viewer's control loses focus. It removes focus from thefocusPart, if there is one.- Parameters:
- fe- the focusEvent received by this viewer's control
 
- 
findHandleAtDescription copied from interface:GraphicalViewerReturns theHandleat the specified Point. Returnsnullif no handle exists at the given Point. The specified point should be relative to theclient areafor this Viewer'sControl.- Specified by:
- findHandleAtin interface- GraphicalViewer
- Parameters:
- p- the location relative to the Control's client area
- Returns:
- Handle nullor a Handle
- See Also:
 
- 
findObjectAtExcludingpublic EditPart findObjectAtExcluding(Point pt, Collection<IFigure> exclude, EditPartViewer.Conditional condition) Description copied from interface:EditPartViewerReturnsnullor theEditPartat the specified location, using the given exclusion set and conditional. This method behaves similarly toEditPartViewer.findObjectAt(Point).- Specified by:
- findObjectAtExcludingin interface- EditPartViewer
- Parameters:
- pt- The mouse location
- exclude- The set of IFigures to be excluded
- condition- the Conditional used to evaluate a potential hit
- Returns:
- nullor an EditPart
- See Also:
 
- 
flushpublic void flush()Flushes and pending layouts and paints in the lightweight system.- Specified by:
- flushin interface- EditPartViewer
- Overrides:
- flushin class- AbstractEditPartViewer
- See Also:
 
- 
getEventDispatcherDeprecated.This method should not be called by subclassesReturns the event dispatcher- Returns:
- the event dispatcher
 
- 
getLayerManagerConvenience method for finding the layer manager.- Returns:
- the LayerManager
 
- 
getLightweightSystemReturns the lightweight system.- Returns:
- the system
 
- 
getRootFigureDeprecated.There is no reason to call this method $TODO delete this methodReturns the root figure- Returns:
- the root figure
 
- 
hookDropTargetprotected void hookDropTarget()Extended to flush paints during drop callbacks.- Overrides:
- hookDropTargetin class- AbstractEditPartViewer
- See Also:
 
- 
hookControlprotected void hookControl()Extended to tell the lightweight system what its control is.- Overrides:
- hookControlin class- AbstractEditPartViewer
- See Also:
 
- 
registerAccessibleEditPartRegisters the accessible editpart with the event dispatcher.- Specified by:
- registerAccessibleEditPartin interface- EditPartViewer
- Overrides:
- registerAccessibleEditPartin class- AbstractEditPartViewer
- Parameters:
- acc- the accessible
- See Also:
 
- 
revealReveals the specified editpart by usingExposeHelpers. A bottom-up scan through the parent-chain is performed, looking for expose helpers along the way, and asking them to expose the given editpart.- Specified by:
- revealin interface- EditPartViewer
- Overrides:
- revealin class- AbstractEditPartViewer
- Parameters:
- part- the EditPart to reveal
- See Also:
 
- 
setContextMenuExtended implementation to flush the viewer as the context menu is shown.- Specified by:
- setContextMenuin interface- EditPartViewer
- Overrides:
- setContextMenuin class- AbstractEditPartViewer
- Parameters:
- contextMenu- the- ContextMenuProvider
- See Also:
 
- 
setCursorDescription copied from interface:EditPartViewerSets the cursor for the viewer'sControl. This method should only be called byTools.nullcan be used to indicate that the default cursor should be restored.- Specified by:
- setCursorin interface- EditPartViewer
- Overrides:
- setCursorin class- AbstractEditPartViewer
- Parameters:
- newCursor-- nullor a Cursor
- See Also:
 
- 
setDragSourceExtends the drag source to handle figures which handle MouseDown events, thereby aborting any DragDetect callbacks.- Overrides:
- setDragSourcein class- AbstractEditPartViewer
- Parameters:
- source-- nullor a drag source
- See Also:
 
- 
setEditDomainDescription copied from interface:EditPartViewerSets theEditDomainfor this viewer. The Viewer will route all mouse and keyboard events to the EditDomain.- Specified by:
- setEditDomainin interface- EditPartViewer
- Overrides:
- setEditDomainin class- AbstractEditPartViewer
- Parameters:
- domain- The EditDomain
- See Also:
 
- 
setRootEditPartDescription copied from interface:EditPartViewerSets the root of this viewer. The root should not be confused with the contents.- Specified by:
- setRootEditPartin interface- EditPartViewer
- Overrides:
- setRootEditPartin class- AbstractEditPartViewer
- Parameters:
- editpart- the RootEditPart
- See Also:
 
- 
setRootFigureDeprecated.This method should no longer be used.Sets the lightweight system's root figure.- Parameters:
- figure- the root figure
 
- 
hookRootFigureprotected void hookRootFigure()Hook the root figure into this viewer'sLightweightSystem.- Since:
- 3.8
 
- 
setRouteEventsToEditDomainpublic void setRouteEventsToEditDomain(boolean value) Description copied from interface:EditPartViewerTurns on/off the routing of events directly to the Editor. If supported by the viewer implementation, all Events should be routed to theEditDomainrather than handled in the default way.- Specified by:
- setRouteEventsToEditDomainin interface- EditPartViewer
- Overrides:
- setRouteEventsToEditDomainin class- AbstractEditPartViewer
- Parameters:
- value- true if the viewer should route events to the EditDomain
- See Also:
 
- 
unhookControlprotected void unhookControl()Description copied from class:AbstractEditPartViewerCalled when the control is being set tonull, but before it is null.- Overrides:
- unhookControlin class- AbstractEditPartViewer
- See Also:
 
- 
unregisterAccessibleEditPartDescription copied from class:AbstractEditPartViewerDoes nothing by default. Subclasses needing to add accessibility support should override this method.- Specified by:
- unregisterAccessibleEditPartin interface- EditPartViewer
- Overrides:
- unregisterAccessibleEditPartin class- AbstractEditPartViewer
- Parameters:
- acc- the accessible part
- See Also:
 
 
-