de.tu_berlin.cs.tfs.muvitorkit.gef.editparts
Class AdapterConnectionEditPart<T extends EObject>

java.lang.Object
  extended by org.eclipse.gef.editparts.AbstractEditPart
      extended by org.eclipse.gef.editparts.AbstractGraphicalEditPart
          extended by org.eclipse.gef.editparts.AbstractConnectionEditPart
              extended by de.tu_berlin.cs.tfs.muvitorkit.gef.editparts.AdapterConnectionEditPart<T>
All Implemented Interfaces:
IAdaptable, ConnectionEditPart, EditPart, GraphicalEditPart, LayerConstants, RequestConstants

public abstract class AdapterConnectionEditPart<T extends EObject>
extends AbstractConnectionEditPart

This edit part is a convenience implementation with the following frequently used features for EObjects:

Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractConnectionEditPart
AbstractConnectionEditPart.DefaultAccessibleAnchorProvider
 
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
AbstractGraphicalEditPart.AccessibleGraphicalEditPart
 
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPart
AbstractEditPart.EditPolicyIterator
 
Field Summary
 
Fields inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
figure, sourceConnections, targetConnections
 
Fields inherited from class org.eclipse.gef.editparts.AbstractEditPart
children, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAG
 
Fields inherited from interface org.eclipse.gef.EditPart
SELECTED, SELECTED_NONE, SELECTED_PRIMARY
 
Fields inherited from interface org.eclipse.gef.LayerConstants
CONNECTION_LAYER, FEEDBACK_LAYER, GRID_LAYER, GUIDE_LAYER, HANDLE_LAYER, PRIMARY_LAYER, PRINTABLE_LAYERS, SCALABLE_LAYERS, SCALED_FEEDBACK_LAYER
 
Fields inherited from interface org.eclipse.gef.RequestConstants
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER
 
Constructor Summary
AdapterConnectionEditPart(T model)
          By default, an Adapter will be installed on the model, passing the notifications to notifyChanged(Notification) and to the MuvitorNotifierService.
 
Method Summary
protected  IPropertySource createPropertySource()
          Creates a default EObjectPropertySource showing all model features for this edit part.
 void deactivate()
          Removes this edit part's adapters from the model.
 Object getAdapter(Class key)
          Subclasses may override but must call super implementation!
 T getCastedModel()
          Convenience method that casts the model to the appropriate type.
protected  void notifyChanged(Notification notification)
          By default, an Adapter will be registered with this editpart's model that passes notifications to this method, which subclasses are expected to override.
protected  void performDirectEdit()
          Creates and opens a MuvitorDirectEditManager by default, handling direct editing, if this edit part implements IDirectEditPart.IGraphicalDirectEditPart.
protected  void performOpen()
          Calls MuvitorTreeEditor.showView(getCastedModel) by default.
 void performRequest(Request request)
          Handles the standard GEF requests "direct edit" and "open" on this edit part.
 void registerAdapter(Adapter adapter)
          Convenience method to register an Adapter on this editpart's model in AbstractGraphicalEditPart.activate().
 void registerAdapter(Adapter adapter, EObject model)
          Via this method subclasses can install Adapters in AbstractGraphicalEditPart.activate() listening to changes on a specific EObject.
 void registerAdapter(EObject model)
          Convenience method to let notifyChanged(Notification) receive notifications from additional EObjects.
 
Methods inherited from class org.eclipse.gef.editparts.AbstractConnectionEditPart
activateFigure, addNotify, createFigure, deactivateFigure, getConnectionFigure, getDragTracker, getSource, getSourceConnectionAnchor, getTarget, getTargetConnectionAnchor, refresh, refreshSourceAnchor, refreshTargetAnchor, removeNotify, setParent, setSource, setTarget
 
Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
activate, addChildVisual, addNodeListener, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getContentPane, getFigure, getLayer, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, isSelectable, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisuals
 
Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart
activateEditPolicies, addChild, addEditPartListener, createChild, createEditPolicies, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getChildren, getCommand, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getModelChildren, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, refreshChildren, refreshVisuals, register, registerAccessibility, registerModel, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setModel, setSelected, showSourceFeedback, showTargetFeedback, toString, understandsRequest, unregister, unregisterAccessibility, unregisterModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.gef.GraphicalEditPart
addNodeListener, getContentPane, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraint
 
Methods inherited from interface org.eclipse.gef.EditPart
activate, addEditPartListener, eraseSourceFeedback, eraseTargetFeedback, getChildren, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, isSelectable, removeEditPartListener, removeEditPolicy, setFocus, setModel, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
 

Constructor Detail

AdapterConnectionEditPart

public AdapterConnectionEditPart(T model)
By default, an Adapter will be installed on the model, passing the notifications to notifyChanged(Notification) and to the MuvitorNotifierService.

Parameters:
model - the model of this editpart
Method Detail

registerAdapter

public final void registerAdapter(Adapter adapter,
                                  EObject model)
Via this method subclasses can install Adapters in AbstractGraphicalEditPart.activate() listening to changes on a specific EObject. All registered adapters will be deregistered by default in deactivate().

Parameters:
adapter - an Adapter to register on the model
model - an EObject to observe with the passed adapter

registerAdapter

public final void registerAdapter(Adapter adapter)
Convenience method to register an Adapter on this editpart's model in AbstractGraphicalEditPart.activate().

Parameters:
adapter - an Adapter to register on this editpart's model
See Also:
registerAdapter(Adapter, EObject)

registerAdapter

public final void registerAdapter(EObject model)
Convenience method to let notifyChanged(Notification) receive notifications from additional EObjects. This method registers an Adapter on some EObject that just forwards its notifications.

Parameters:
adapter - an Adapter to register on this editpart's model
See Also:
registerAdapter(Adapter, EObject)

getCastedModel

public final T getCastedModel()
Convenience method that casts the model to the appropriate type.

Returns:
The model of this EditPart appropriately casted.

deactivate

public void deactivate()
Removes this edit part's adapters from the model. Subclasses may override but must call super implementation!

Specified by:
deactivate in interface EditPart
Overrides:
deactivate in class AbstractGraphicalEditPart
See Also:
AbstractGraphicalEditPart.deactivate()

performRequest

public void performRequest(Request request)
Handles the standard GEF requests "direct edit" and "open" on this edit part.

Specified by:
performRequest in interface EditPart
Overrides:
performRequest in class AbstractEditPart
See Also:
performDirectEdit(), performOpen(), AbstractEditPart.performRequest(org.eclipse.gef.Request)

performOpen

protected void performOpen()
Calls MuvitorTreeEditor.showView(getCastedModel) by default. Subclasses may override to perform some other action here.


performDirectEdit

protected void performDirectEdit()
Creates and opens a MuvitorDirectEditManager by default, handling direct editing, if this edit part implements IDirectEditPart.IGraphicalDirectEditPart. Subclasses may override to perform some other action here.


notifyChanged

protected void notifyChanged(Notification notification)
By default, an Adapter will be registered with this editpart's model that passes notifications to this method, which subclasses are expected to override. This can be extended to receive notifications from other EObjects as well with registerAdapter(EObject).


getAdapter

public Object getAdapter(Class key)
Subclasses may override but must call super implementation!

Specified by:
getAdapter in interface IAdaptable
Overrides:
getAdapter in class AbstractConnectionEditPart
See Also:
IAdaptable.getAdapter(java.lang.Class)

createPropertySource

protected IPropertySource createPropertySource()
Creates a default EObjectPropertySource showing all model features for this edit part. Subclasses may override.

Returns:
the property source for this edit part