Modelers

org.topcased.modeler.edit
Class DiagramEditPart

java.lang.Object
  extended by org.eclipse.gef.editparts.AbstractEditPart
      extended by org.eclipse.gef.editparts.AbstractGraphicalEditPart
          extended by org.topcased.modeler.edit.BaseEditPart
              extended by org.topcased.modeler.edit.DiagramEditPart
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.gef.EditPart, org.eclipse.gef.GraphicalEditPart, org.eclipse.gef.LayerConstants, org.eclipse.gef.RequestConstants

public abstract class DiagramEditPart
extends BaseEditPart
implements org.eclipse.gef.LayerConstants

Basic diagram edit part.
creation : 30 nov. 2004


Nested Class Summary
protected  class DiagramEditPart.DiagramEditPartListener
           
 
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
org.eclipse.gef.editparts.AbstractGraphicalEditPart.AccessibleGraphicalEditPart, org.eclipse.gef.editparts.AbstractGraphicalEditPart.DefaultAccessibleAnchorProvider
 
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.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.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.EditPart
SELECTED, SELECTED_NONE, SELECTED_PRIMARY
 
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
DiagramEditPart(Diagram model)
          Constructor
 
Method Summary
 void activate()
          Activate the adapters
protected  org.eclipse.draw2d.IFigure createBodyFigure()
          Create the figure that will represent the body of the page, the area where the children will be displayed
protected  void createEditPolicies()
          Create the EditPolicies
protected  org.eclipse.draw2d.IFigure createFigure()
          Create the diagram figure
protected  org.eclipse.draw2d.IFigure createPageFigure()
          Create the figure that will represent the page
 void deactivate()
          Deactivate the adapters
 java.lang.Object getAdapter(java.lang.Class key)
           
 org.eclipse.draw2d.IFigure getContentPane()
          Get the contentPane figure
protected  org.eclipse.swt.graphics.Color getDefaultBackgroundColor()
          Return the default foreground color of this type of element
protected  org.eclipse.swt.graphics.Font getDefaultFont()
          Return the default font of this type of element
protected  org.eclipse.swt.graphics.Color getDefaultForegroundColor()
          Return the default foreground color of this type of element
protected  Diagram getDiagram()
          Returns the Diagram
protected  DiagramElementListener getDiagramElementListener()
          Returns the listener used to listen the graphical mode object
 ILabel getEditableLabel()
          Return header figure
 EObject getEObject()
          Retrieve the model object
protected  java.lang.String getHeaderDiagram()
          Subclasses must implements this methods.
 ILabel getLabel()
          Return header figure
protected abstract  org.eclipse.gef.EditPolicy getLayoutEditPolicy()
          Returns the EditPolicy used in this diagram
protected  java.util.List getModelChildren()
          Get model children
protected  void handleModelChanged(Notification msg)
          Update model and graphics
protected  void handlePropertyChanged(Notification msg)
          Deprecated. use handleModelChanged instead
 boolean isSelectable()
          The Diagram figure is not selectable (ensure that the Marquee tool is directly accessible)
protected  void refreshColors()
          Refresh the background and the foreground Colors of the Diagram
protected  void refreshDiagramProperties()
          Refresh the diagram properties and set default values if necessary
protected  void refreshTextAndFont()
          Refresh the text to display at the top and the current Font of the Diagram
protected  void refreshVisuals()
           
 
Methods inherited from class org.topcased.modeler.edit.BaseEditPart
createSnapToHelper, getModelListener, refresh, updateModelListening
 
Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
addChildVisual, addNodeListener, addNotify, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getDragTracker, getFigure, getLayer, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeNotify, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisuals
 
Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart
activateEditPolicies, addChild, addEditPartListener, createChild, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getChildren, getCommand, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, performRequest, refreshChildren, register, registerAccessibility, registerModel, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setModel, setParent, 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.EditPart
addEditPartListener, eraseSourceFeedback, eraseTargetFeedback, getChildren, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, performRequest, removeEditPartListener, removeEditPolicy, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
 

Constructor Detail

DiagramEditPart

public DiagramEditPart(Diagram model)
Constructor

Parameters:
model - the model object
Method Detail

getDiagram

protected Diagram getDiagram()
Returns the Diagram

Returns:
the Diagram object

getEObject

public EObject getEObject()
Retrieve the model object

Returns:
the EObject associated with the EMFGraphNodeEditPart

activate

public void activate()
Activate the adapters

Specified by:
activate in interface org.eclipse.gef.EditPart
Overrides:
activate in class org.eclipse.gef.editparts.AbstractGraphicalEditPart
See Also:
AbstractGraphicalEditPart.activate()

deactivate

public void deactivate()
Deactivate the adapters

Specified by:
deactivate in interface org.eclipse.gef.EditPart
Overrides:
deactivate in class org.eclipse.gef.editparts.AbstractGraphicalEditPart
See Also:
AbstractGraphicalEditPart.deactivate()

getDiagramElementListener

protected DiagramElementListener getDiagramElementListener()
Returns the listener used to listen the graphical mode object

Specified by:
getDiagramElementListener in class BaseEditPart
Returns:
the listener

getAdapter

public java.lang.Object getAdapter(java.lang.Class key)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class BaseEditPart
See Also:
BaseEditPart.getAdapter(java.lang.Class)

handleModelChanged

protected void handleModelChanged(Notification msg)
Update model and graphics

Specified by:
handleModelChanged in class BaseEditPart
Parameters:
msg - the Notification

handlePropertyChanged

protected void handlePropertyChanged(Notification msg)
Deprecated. use handleModelChanged instead


createEditPolicies

protected void createEditPolicies()
Create the EditPolicies

Overrides:
createEditPolicies in class BaseEditPart
See Also:
AbstractEditPart.createEditPolicies()

getLayoutEditPolicy

protected abstract org.eclipse.gef.EditPolicy getLayoutEditPolicy()
Returns the EditPolicy used in this diagram

Returns:
the diagram editPolicy

createFigure

protected org.eclipse.draw2d.IFigure createFigure()
Create the diagram figure

Specified by:
createFigure in class org.eclipse.gef.editparts.AbstractGraphicalEditPart
See Also:
AbstractGraphicalEditPart.createFigure()

createPageFigure

protected org.eclipse.draw2d.IFigure createPageFigure()
Create the figure that will represent the page

Returns:
the page figure

createBodyFigure

protected org.eclipse.draw2d.IFigure createBodyFigure()
Create the figure that will represent the body of the page, the area where the children will be displayed

Returns:
the container figure

isSelectable

public boolean isSelectable()
The Diagram figure is not selectable (ensure that the Marquee tool is directly accessible)

Specified by:
isSelectable in interface org.eclipse.gef.EditPart
Overrides:
isSelectable in class org.eclipse.gef.editparts.AbstractEditPart
Returns:
a boolean

getEditableLabel

public ILabel getEditableLabel()
Return header figure

Returns:
the label

getLabel

public ILabel getLabel()
Return header figure

Returns:
the label

getContentPane

public org.eclipse.draw2d.IFigure getContentPane()
Get the contentPane figure

Specified by:
getContentPane in interface org.eclipse.gef.GraphicalEditPart
Overrides:
getContentPane in class org.eclipse.gef.editparts.AbstractGraphicalEditPart
See Also:
AbstractGraphicalEditPart.getContentPane()

refreshVisuals

protected void refreshVisuals()
Overrides:
refreshVisuals in class org.eclipse.gef.editparts.AbstractEditPart
See Also:
AbstractEditPart.refreshVisuals()

refreshColors

protected void refreshColors()
Refresh the background and the foreground Colors of the Diagram


refreshTextAndFont

protected void refreshTextAndFont()
Refresh the text to display at the top and the current Font of the Diagram


getHeaderDiagram

protected java.lang.String getHeaderDiagram()
Subclasses must implements this methods. It returns the text to display at the top of the diagram

Returns:
a String

getModelChildren

protected java.util.List getModelChildren()
Get model children

Overrides:
getModelChildren in class org.eclipse.gef.editparts.AbstractEditPart
See Also:
AbstractEditPart.getModelChildren()

refreshDiagramProperties

protected void refreshDiagramProperties()
Refresh the diagram properties and set default values if necessary


getDefaultForegroundColor

protected org.eclipse.swt.graphics.Color getDefaultForegroundColor()
Return the default foreground color of this type of element

Returns:
Color

getDefaultBackgroundColor

protected org.eclipse.swt.graphics.Color getDefaultBackgroundColor()
Return the default foreground color of this type of element

Returns:
Color

getDefaultFont

protected org.eclipse.swt.graphics.Font getDefaultFont()
Return the default font of this type of element

Returns:
Font

Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.