de.cau.cs.kieler.core.model.gmf
Class GmfFrameworkBridge

java.lang.Object
  extended by de.cau.cs.kieler.core.model.gmf.GmfFrameworkBridge
All Implemented Interfaces:
IGraphicalFrameworkBridge
Direct Known Subclasses:
PapyrusFrameworkBridge

public class GmfFrameworkBridge
extends Object
implements IGraphicalFrameworkBridge

Domain model element provider for GMF.

Rating red

Constructor Summary
GmfFrameworkBridge()
           
 
Method Summary
static org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart getDiagramEditPart(EditPart editPart)
          Finds the diagram edit part of an edit part.
 IFigure getDrawingLayer(EditPart editPart)
          Returns a layer figure for the associated diagram that can be used to draw additional information.
 EditingDomain getEditingDomain(Object object)
          Retrieve the editing domain for model changes of the given object.
static EditPart getEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart dep, EObject element)
          Find an edit part that is contained in the given diagram edit part.
static EditPart getEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart dep, View view)
          Find an edit part that is contained in the given diagram edit part.
 EditPart getEditPart(IWorkbenchPart workbenchPart, Object object)
          Returns the relevant edit part for the given object.
 EditPart getEditPart(Object object)
          Returns the relevant edit part for the given object.
 EObject getElement(Object object)
          Retrieve the domain model element from the given object.
 EObject getNotationElement(Object object)
          Retrieve the notational model element from the given object.
 ISelection getSelection(IWorkbenchPart workbenchPart)
          Returns the current selection for the given editor part.
 ZoomManager getZoomManager(EditPart editPart)
          Returns a zoom manager for the associated diagram.
 boolean supports(Object object)
          Determine whether this bridge supports the given object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GmfFrameworkBridge

public GmfFrameworkBridge()
Method Detail

supports

public boolean supports(Object object)
Determine whether this bridge supports the given object.

Specified by:
supports in interface IGraphicalFrameworkBridge
Parameters:
object - an edit part, editor part, or notational object
Returns:
true if this bridge supports the given object

getDiagramEditPart

public static org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart getDiagramEditPart(EditPart editPart)
Finds the diagram edit part of an edit part.

Parameters:
editPart - an edit part
Returns:
the diagram edit part, or null if there is no containing diagram edit part

getEditPart

public static EditPart getEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart dep,
                                   EObject element)
Find an edit part that is contained in the given diagram edit part. The edit part should correspond to the given model element.

Parameters:
dep - a diagram edit part
element - a model element
Returns:
the corresponding edit part, or null

getEditPart

public static EditPart getEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart dep,
                                   View view)
Find an edit part that is contained in the given diagram edit part. The edit part should correspond to the given notation view.

Parameters:
dep - a diagram edit part
view - a notation view
Returns:
the corresponding edit part, or null

getElement

public EObject getElement(Object object)
Retrieve the domain model element from the given object.

Specified by:
getElement in interface IGraphicalFrameworkBridge
Parameters:
object - a selectable object, such as an edit part
Returns:
the domain model element, or null if there is none

getNotationElement

public EObject getNotationElement(Object object)
Retrieve the notational model element from the given object. The kind of notational element depends on the specific graphical framework.

Specified by:
getNotationElement in interface IGraphicalFrameworkBridge
Parameters:
object - a selectable object, such as an edit part
Returns:
the notational model element, or null if there is none

getEditPart

public EditPart getEditPart(Object object)
Returns the relevant edit part for the given object. If a diagram editor part is passed, then the return value is the corresponding diagram edit part. If an edit part is passed, it is filtered in such a way that the most relevant related edit part is returned; e.g. for a compartment edit part the containing node edit part is returned. If a model element is passed, the most relevant edit part in the active editor is returned.

Specified by:
getEditPart in interface IGraphicalFrameworkBridge
Parameters:
object - an editor part, edit part, notational object, or model element
Returns:
the relevant edit part, or null if the passed object cannot be handled

getEditPart

public EditPart getEditPart(IWorkbenchPart workbenchPart,
                            Object object)
Returns the relevant edit part for the given object. If a model element is passed, the most relevant edit part in the given editor is returned.

Specified by:
getEditPart in interface IGraphicalFrameworkBridge
Parameters:
workbenchPart - a workbench part containing a diagram
object - an edit part, notational object, or model element
Returns:
the relevant edit part, or null if the passed object cannot be handled

getEditingDomain

public EditingDomain getEditingDomain(Object object)
Retrieve the editing domain for model changes of the given object.

Specified by:
getEditingDomain in interface IGraphicalFrameworkBridge
Parameters:
object - a selectable object, such as an edit part
Returns:
the transactional editing domain, or null if there is none

getDrawingLayer

public IFigure getDrawingLayer(EditPart editPart)
Returns a layer figure for the associated diagram that can be used to draw additional information.

Specified by:
getDrawingLayer in interface IGraphicalFrameworkBridge
Parameters:
editPart - an edit part from a graphical diagram
Returns:
a drawing layer

getZoomManager

public ZoomManager getZoomManager(EditPart editPart)
Returns a zoom manager for the associated diagram.

Specified by:
getZoomManager in interface IGraphicalFrameworkBridge
Parameters:
editPart - an edit part from a graphical diagram
Returns:
a zoom manager

getSelection

public ISelection getSelection(IWorkbenchPart workbenchPart)
Returns the current selection for the given editor part.

Specified by:
getSelection in interface IGraphicalFrameworkBridge
Parameters:
workbenchPart - a workbench part containing a diagram
Returns:
the current selection, or null if the selection cannot be determined