public class GraphicalViewerImpl extends AbstractEditPartViewer implements GraphicalViewer
Figures.EditPartViewer.ConditionalconstantSelection, focusPart, selection, selectionListeners| Constructor and Description |
|---|
GraphicalViewerImpl()
Constructs a GraphicalViewerImpl with the default root editpart.
|
| Modifier and Type | Method and Description |
|---|---|
Control |
createControl(Composite composite)
Optionally creates the default
Control using the default style. |
protected void |
createDefaultRoot()
Creates the default root editpart.
|
protected LightweightSystem |
createLightweightSystem()
Creates the lightweight system used to host figures.
|
Handle |
findHandleAt(Point p)
Returns the
Handle at the specified Point. |
EditPart |
findObjectAtExcluding(Point pt,
java.util.Collection exclude,
EditPartViewer.Conditional condition)
Returns
null or the EditPart at the specified
location, using the given exclusion set and conditional. |
void |
flush()
Flushes and pending layouts and paints in the lightweight system.
|
protected DomainEventDispatcher |
getEventDispatcher()
Deprecated.
This method should not be called by subclasses
|
protected LayerManager |
getLayerManager()
Convenience method for finding the layer manager.
|
protected LightweightSystem |
getLightweightSystem()
Returns the lightweight system.
|
protected IFigure |
getRootFigure()
Deprecated.
There is no reason to call this method $TODO delete this
method
|
protected void |
handleDispose(DisposeEvent e)
Called if and when the
Control is disposed. |
protected void |
handleFocusGained(FocusEvent fe)
This method is invoked when this viewer's control gains focus.
|
protected void |
handleFocusLost(FocusEvent fe)
This method is invoked when this viewer's control loses focus.
|
protected void |
hookControl()
Extended to tell the lightweight system what its control is.
|
protected void |
hookDropTarget()
Extended to flush paints during drop callbacks.
|
protected void |
hookRootFigure()
Hook the root figure into this viewer's
LightweightSystem. |
void |
registerAccessibleEditPart(AccessibleEditPart acc)
Registers the accessible editpart with the event dispatcher.
|
void |
reveal(EditPart part)
Reveals the specified editpart by using
ExposeHelpers. |
void |
setContextMenu(MenuManager contextMenu)
Extended implementation to flush the viewer as the context menu is shown.
|
void |
setCursor(Cursor newCursor)
Sets the cursor for the viewer's
Control. |
protected void |
setDragSource(DragSource source)
Extends the drag source to handle figures which handle MouseDown events,
thereby aborting any DragDetect callbacks.
|
void |
setEditDomain(EditDomain domain)
Sets the
EditDomain for this viewer. |
void |
setRootEditPart(RootEditPart editpart)
Sets the root of this viewer.
|
protected void |
setRootFigure(IFigure figure)
Deprecated.
This method should no longer be used.
|
void |
setRouteEventsToEditDomain(boolean value)
Turns on/off the routing of events directly to the Editor.
|
protected void |
unhookControl()
Called when the control is being set to
null, but before it
is null. |
void |
unregisterAccessibleEditPart(AccessibleEditPart acc)
Does nothing by default.
|
addDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, addSelectionChangedListener, appendSelection, deselect, deselectAll, findObjectAt, findObjectAtExcluding, fireSelectionChanged, getContents, getContextMenu, getControl, getDelegatingDragAdapter, getDelegatingDropAdapter, getDragSource, getDropTarget, getEditDomain, getEditPartFactory, 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, setSelectionManagerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddDragSourceListener, addDragSourceListener, addDropTargetListener, addDropTargetListener, addPropertyChangeListener, appendSelection, deselect, deselectAll, findObjectAt, findObjectAtExcluding, getContents, getContextMenu, getControl, getEditDomain, getEditPartFactory, getEditPartRegistry, getFocusEditPart, getKeyHandler, getProperty, getResourceManager, getRootEditPart, getSelectedEditParts, getSelection, getSelectionManager, getVisualPartMap, removeDragSourceListener, removeDragSourceListener, removeDropTargetListener, removeDropTargetListener, removePropertyChangeListener, select, setContents, setContents, setControl, setEditPartFactory, setFocus, setKeyHandler, setProperty, setSelectionManageraddSelectionChangedListener, removeSelectionChangedListener, setSelectionpublic GraphicalViewerImpl()
public Control createControl(Composite composite)
EditPartViewerControl using the default style. The Control can also be created
externally and then set into the Viewer.createControl in interface EditPartViewercreateControl in class AbstractEditPartViewercomposite - the parent in which create the SWT ControlEditPartViewer.createControl(org.eclipse.swt.widgets.Composite)protected void createDefaultRoot()
protected LightweightSystem createLightweightSystem()
protected void handleDispose(DisposeEvent e)
AbstractEditPartViewerControl is disposed. Subclasses may
extend this method to perform additional cleanup.handleDispose in class AbstractEditPartViewere - the disposeeventAbstractEditPartViewer.handleDispose(org.eclipse.swt.events.DisposeEvent)protected void handleFocusGained(FocusEvent fe)
focusPart, if there
is one.fe - the focusEvent received by this viewer's controlprotected void handleFocusLost(FocusEvent fe)
focusPart, if
there is one.fe - the focusEvent received by this viewer's controlpublic Handle findHandleAt(Point p)
GraphicalViewerHandle at the specified Point. Returns
null if no handle exists at the given Point. The specified
point should be relative to the
client area
for this Viewer's Control.findHandleAt in interface GraphicalViewerp - the location relative to the Control's client areanull or a HandleGraphicalViewer.findHandleAt(org.eclipse.draw2d.geometry.Point)public EditPart findObjectAtExcluding(Point pt, java.util.Collection exclude, EditPartViewer.Conditional condition)
EditPartViewernull or the EditPart at the specified
location, using the given exclusion set and conditional. This method
behaves similarly to EditPartViewer.findObjectAt(Point).findObjectAtExcluding in interface EditPartViewerpt - The mouse locationexclude - The set of EditParts to be excludedcondition - the Conditional used to evaluate a potential hitnull or an EditPartEditPartViewer.findObjectAtExcluding(Point, Collection,
EditPartViewer.Conditional)public void flush()
flush in interface EditPartViewerflush in class AbstractEditPartViewerEditPartViewer.flush()protected DomainEventDispatcher getEventDispatcher()
protected LayerManager getLayerManager()
protected LightweightSystem getLightweightSystem()
protected IFigure getRootFigure()
protected void hookDropTarget()
hookDropTarget in class AbstractEditPartViewerAbstractEditPartViewer.hookDropTarget()protected void hookControl()
hookControl in class AbstractEditPartViewerAbstractEditPartViewer.hookControl()public void registerAccessibleEditPart(AccessibleEditPart acc)
registerAccessibleEditPart in interface EditPartViewerregisterAccessibleEditPart in class AbstractEditPartVieweracc - the accessibleEditPartViewer.registerAccessibleEditPart(AccessibleEditPart)public void reveal(EditPart part)
ExposeHelpers. 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.reveal in interface EditPartViewerreveal in class AbstractEditPartViewerpart - the EditPart to revealEditPartViewer.reveal(EditPart)public void setContextMenu(MenuManager contextMenu)
setContextMenu in interface EditPartViewersetContextMenu in class AbstractEditPartViewercontextMenu - the ContextMenuProviderEditPartViewer.setContextMenu(org.eclipse.jface.action.MenuManager)public void setCursor(Cursor newCursor)
EditPartViewerControl. This method should
only be called by Tools. null can be used to
indicate that the default cursor should be restored.setCursor in interface EditPartViewersetCursor in class AbstractEditPartViewernewCursor - null or a CursorEditPartViewer.setCursor(org.eclipse.swt.graphics.Cursor)protected void setDragSource(DragSource source)
setDragSource in class AbstractEditPartViewersource - null or a drag sourceAbstractEditPartViewer.setDragSource(org.eclipse.swt.dnd.DragSource)public void setEditDomain(EditDomain domain)
EditPartViewerEditDomain for this viewer. The Viewer will route
all mouse and keyboard events to the EditDomain.setEditDomain in interface EditPartViewersetEditDomain in class AbstractEditPartViewerdomain - The EditDomainEditPartViewer.setEditDomain(org.eclipse.gef.EditDomain)public void setRootEditPart(RootEditPart editpart)
EditPartViewersetRootEditPart in interface EditPartViewersetRootEditPart in class AbstractEditPartViewereditpart - the RootEditPartEditPartViewer.setRootEditPart(org.eclipse.gef.RootEditPart)protected void setRootFigure(IFigure figure)
figure - the root figureprotected void hookRootFigure()
LightweightSystem.public void setRouteEventsToEditDomain(boolean value)
EditPartViewerEditDomain rather than handled in the default way.setRouteEventsToEditDomain in interface EditPartViewersetRouteEventsToEditDomain in class AbstractEditPartViewervalue - true if the viewer should route events to the EditDomainEditPartViewer.setRouteEventsToEditDomain(boolean)protected void unhookControl()
AbstractEditPartViewernull, but before it
is null.unhookControl in class AbstractEditPartViewerAbstractEditPartViewer.unhookControl()public void unregisterAccessibleEditPart(AccessibleEditPart acc)
AbstractEditPartViewerunregisterAccessibleEditPart in interface EditPartViewerunregisterAccessibleEditPart in class AbstractEditPartVieweracc - the accessible partEditPartViewer.unregisterAccessibleEditPart(org.eclipse.gef.AccessibleEditPart)Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.