Eclipse GEF
2.1

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

public class GraphicalViewerImpl
extends AbstractEditPartViewer
implements GraphicalViewer


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, selection, selectionListeners
 
Constructor Summary
GraphicalViewerImpl()
           
 
Method Summary
 Control createControl(Composite composite)
          Optionally creates the default Control using the default style.
protected  void createDefaultRoot()
           
protected  org.eclipse.draw2d.LightweightSystem createLightweightSystem()
           
 Handle findHandleAt(org.eclipse.draw2d.geometry.Point p)
          Returns the Handle at the specified Point.
 EditPart findObjectAtExcluding(org.eclipse.draw2d.geometry.Point pt, Collection exclude, EditPartViewer.Conditional condition)
          Returns null or the EditPart at the specified location, using the given exclusion set and conditional.
 void flush()
          Flushes all pending updates to the Viewer.
protected  DomainEventDispatcher getEventDispatcher()
          Deprecated.  
protected  LayerManager getLayerManager()
           
protected  org.eclipse.draw2d.LightweightSystem getLightweightSystem()
           
protected  org.eclipse.draw2d.IFigure getRootFigure()
          Deprecated. There is no reason to call this method
protected  void handleDispose(DisposeEvent e)
          Called if and when the Control is disposed.
protected  void hookControl()
           
protected  void hookDropTarget()
           
 void registerAccessibleEditPart(AccessibleEditPart acc)
          Used for accessibility purposes.
 void reveal(EditPart part)
          Shows the given EditPart if it is not visible.
 void setContextMenu(MenuManager contextMenu)
          Extended implementation to flush asynchronous paints in draw2d.
 void setCursor(Cursor newCursor)
          Sets the cursor for the viewer's Control.
protected  void setDragSource(DragSource source)
           
 void setEditDomain(EditDomain domain)
          Sets the EditDomain for this viewer.
 void setRootEditPart(RootEditPart editpart)
          Sets the root of this viewer.
protected  void setRootFigure(org.eclipse.draw2d.IFigure figure)
           
 void setRouteEventsToEditDomain(boolean value)
          Turns on/off the routing of events directly to the Editor.
 void unregisterAccessibleEditPart(AccessibleEditPart acc)
          Used for accessibility purposes
 
Methods inherited from class org.eclipse.gef.ui.parts.AbstractEditPartViewer
addDragSourceListener, addDropTargetListener, addSelectionChangedListener, appendSelection, deselect, deselectAll, findObjectAt, findObjectAtExcluding, fireSelectionChanged, getContents, getContextMenu, getControl, getDelegatingDragAdapter, getDelegatingDropAdapter, getDragSource, getDropTarget, getEditDomain, getEditPartFactory, getEditPartRegistry, getFocusEditPart, getKeyHandler, getRootEditPart, getSelectedEditParts, getSelection, getVisualPartMap, hookDragSource, init, primGetSelectedEditParts, refreshDragSourceAdapter, refreshDropTargetAdapter, removeDragSourceListener, removeDropTargetListener, removeSelectionChangedListener, select, setContents, setContents, setControl, setDropTarget, setEditPartFactory, setFocus, setKeyHandler, setSelection, unhookControl
 
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.EditPartViewer
addDragSourceListener, addDropTargetListener, appendSelection, deselect, deselectAll, findObjectAt, findObjectAtExcluding, getContents, getContextMenu, getControl, getEditDomain, getEditPartFactory, getEditPartRegistry, getFocusEditPart, getKeyHandler, getRootEditPart, getSelectedEditParts, getVisualPartMap, select, setContents, setContents, setControl, setEditPartFactory, setFocus, setKeyHandler
 
Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider
addSelectionChangedListener, getSelection, removeSelectionChangedListener, setSelection
 

Constructor Detail

GraphicalViewerImpl

public GraphicalViewerImpl()
Method Detail

createControl

public Control createControl(Composite composite)
Description copied from interface: EditPartViewer
Optionally creates the default Control using the default style. The Control can also be created externally and then set into the Viewer.

Specified by:
createControl in interface EditPartViewer
Specified by:
createControl in class AbstractEditPartViewer
Parameters:
composite - the parent in which create the SWT Control
Returns:
the created Control for convenience
See Also:
EditPartViewer.setControl(Control)

createDefaultRoot

protected void createDefaultRoot()

createLightweightSystem

protected org.eclipse.draw2d.LightweightSystem createLightweightSystem()

handleDispose

protected void handleDispose(DisposeEvent e)
Description copied from class: AbstractEditPartViewer
Called if and when the Control is disposed. Subclasses may extend this method to perform additional cleanup.

Overrides:
handleDispose in class AbstractEditPartViewer
Parameters:
e - the disposeevent

findHandleAt

public Handle findHandleAt(org.eclipse.draw2d.geometry.Point p)
Description copied from interface: GraphicalViewer
Returns the Handle 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.

Specified by:
findHandleAt in interface GraphicalViewer
Parameters:
p - the location relative to the Control's client area
Returns:
Handle null or a Handle

findObjectAtExcluding

public EditPart findObjectAtExcluding(org.eclipse.draw2d.geometry.Point pt,
                                      Collection exclude,
                                      EditPartViewer.Conditional condition)
Description copied from interface: EditPartViewer
Returns null or the EditPart at the specified location, using the given exclusion set and conditional. This method behaves similarly to EditPartViewer.findObjectAt(Point).

Specified by:
findObjectAtExcluding in interface EditPartViewer
Parameters:
pt - The mouse location
exclude - The set of EditParts to be excluded
condition - the Conditional used to evaluate a potential hit
Returns:
null or an EditPart

flush

public void flush()
Description copied from interface: EditPartViewer
Flushes all pending updates to the Viewer.

Specified by:
flush in interface EditPartViewer
Overrides:
flush in class AbstractEditPartViewer
See Also:
EditPartViewer.flush()

getEventDispatcher

protected DomainEventDispatcher getEventDispatcher()
Deprecated.  


getLayerManager

protected LayerManager getLayerManager()

getLightweightSystem

protected org.eclipse.draw2d.LightweightSystem getLightweightSystem()

getRootFigure

protected org.eclipse.draw2d.IFigure getRootFigure()
Deprecated. There is no reason to call this method


hookDropTarget

protected void hookDropTarget()
Overrides:
hookDropTarget in class AbstractEditPartViewer

hookControl

protected void hookControl()
Overrides:
hookControl in class AbstractEditPartViewer

registerAccessibleEditPart

public void registerAccessibleEditPart(AccessibleEditPart acc)
Description copied from interface: EditPartViewer
Used for accessibility purposes.

Specified by:
registerAccessibleEditPart in interface EditPartViewer
Overrides:
registerAccessibleEditPart in class AbstractEditPartViewer
Parameters:
acc - the AccessibleEditPart

reveal

public void reveal(EditPart part)
Description copied from interface: EditPartViewer
Shows the given EditPart if it is not visible.

Specified by:
reveal in interface EditPartViewer
Overrides:
reveal in class AbstractEditPartViewer
Parameters:
part - the EditPart to reveal
See Also:
EditPartViewer.reveal(EditPart)

setContextMenu

public void setContextMenu(MenuManager contextMenu)
Extended implementation to flush asynchronous paints in draw2d.

Specified by:
setContextMenu in interface EditPartViewer
Overrides:
setContextMenu in class AbstractEditPartViewer
Parameters:
contextMenu - the ContextMenuProvider
See Also:
EditPartViewer.setContextMenu(org.eclipse.jface.action.MenuManager)

setCursor

public void setCursor(Cursor newCursor)
Description copied from interface: EditPartViewer
Sets the cursor for the viewer's Control. This method should only be called by Tools. null can be used to indicate that the default cursor should be restored.

Specified by:
setCursor in interface EditPartViewer
Overrides:
setCursor in class AbstractEditPartViewer
Parameters:
newCursor - null or a Cursor
See Also:
EditPartViewer.getControl()

setDragSource

protected void setDragSource(DragSource source)
Overrides:
setDragSource in class AbstractEditPartViewer

setEditDomain

public void setEditDomain(EditDomain domain)
Description copied from interface: EditPartViewer
Sets the EditDomain for this viewer. The Viewer will route all mouse and keyboard events to the EditDomain.

Specified by:
setEditDomain in interface EditPartViewer
Overrides:
setEditDomain in class AbstractEditPartViewer
Parameters:
domain - The EditDomain

setRootEditPart

public void setRootEditPart(RootEditPart editpart)
Description copied from interface: EditPartViewer
Sets the root of this viewer. The root should not be confused with the contents.

Specified by:
setRootEditPart in interface EditPartViewer
Overrides:
setRootEditPart in class AbstractEditPartViewer
Parameters:
editpart - the RootEditPart
See Also:
EditPartViewer.getRootEditPart(), EditPartViewer.getContents()

setRootFigure

protected void setRootFigure(org.eclipse.draw2d.IFigure figure)

setRouteEventsToEditDomain

public void setRouteEventsToEditDomain(boolean value)
Description copied from interface: EditPartViewer
Turns on/off the routing of events directly to the Editor. If supported by the viewer implementation, all Events should be routed to the EditDomain rather than handled in the default way.

Specified by:
setRouteEventsToEditDomain in interface EditPartViewer
Overrides:
setRouteEventsToEditDomain in class AbstractEditPartViewer
Parameters:
value - true if the viewer should route events to the EditDomain

unregisterAccessibleEditPart

public void unregisterAccessibleEditPart(AccessibleEditPart acc)
Description copied from interface: EditPartViewer
Used for accessibility purposes

Specified by:
unregisterAccessibleEditPart in interface EditPartViewer
Overrides:
unregisterAccessibleEditPart in class AbstractEditPartViewer
Parameters:
acc - the accessible part

Eclipse GEF
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.