|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.AbstractGraphicalEditPart
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart |
AbstractGraphicalEditPart.AccessibleGraphicalEditPart, AbstractGraphicalEditPart.DefaultAccessibleAnchorProvider |
| Nested classes inherited from class org.eclipse.gef.editparts.AbstractEditPart |
AbstractEditPart.EditPolicyIterator |
| Field Summary | |
protected AccessibleEditPart |
accessibleEP
Used for accessibility. |
protected java.lang.String |
elementGuid
Used for registering and unregistering the edit part |
| 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.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 | |
GraphicalEditPart(EObject model)
Create an instance. |
|
| Method Summary | |
void |
activate()
Registers this editpart to recieve notation and semantic events. |
protected void |
addChild(EditPart child,
int index)
|
protected void |
addListenerFilter(java.lang.String filterId,
NotificationListener listener,
EObject element)
Adds a listener filter by adding the given listener to a passed notifier |
protected void |
addListenerFilter(java.lang.String filterId,
NotificationListener listener,
EObject element,
EStructuralFeature feature)
Adds a listener filter by adding the given listener to a passed notifier |
protected void |
addNotationalListeners()
This method adds all listeners to the notational world (views, figures, editpart...etc) Override this method to add more notational listeners down the hierarchy |
protected void |
addSemanticListeners()
This method adds all listeners to the semantic element behind this EditPart Override this method to add more semantic listeners down the hierarchy This method is called only if the semantic element is resolvable |
protected java.lang.Object |
basicGetModel()
Access the model member variable |
protected ConnectionEditPart |
createConnection(java.lang.Object connectionView)
Creates a connection editpart. |
protected void |
createDefaultEditPolicies()
Should be overridden to install editpolicies programmatically. |
protected void |
createEditPolicies()
Overridden to support editpolicies installed programmatically and via the EditPolicyService. |
protected IFigure |
createFigure()
|
void |
deactivate()
|
void |
disableEditMode()
Disables edit mode of the EditPart. |
void |
enableEditMode()
Enables edit mode of the EditPart. |
void |
eraseSourceFeedback(Request request)
|
void |
eraseTargetFeedback(Request request)
|
protected void |
executeCommand(Command command)
executes the passed Command |
EditPart |
findEditPart(EditPart epBegin,
EObject theElement)
Finds an editpart given a starting editpart and an EObject |
protected AccessibleEditPart |
getAccessibleEditPart()
|
java.lang.Object |
getAdapter(java.lang.Class key)
Adds the ability to adapt to the edit part's view class. |
IGraphicalEditPart |
getChildBySemanticHint(java.lang.String semanticHint)
Method getChildBySemanticHint. |
IGraphicalEditPart |
getChildBySemanticHintOnPrimaryView(java.lang.String semanticHint)
Utility method to get the primary view and then query for a child based on the semantic hint |
View |
getChildViewBySemanticHint(java.lang.String semanticHint)
Method getChildViewBySemanticHint. |
Command |
getCommand(Request _request)
Return a command for the supplied request. |
protected IFigure |
getContentPaneFor(IGraphicalEditPart editPart)
gets the content pane for the supplied editpart. |
IDiagramEditDomain |
getDiagramEditDomain()
Return the editpart's diagram edit domain. |
PreferencesHint |
getDiagramPreferencesHint()
Gets the preferences hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values. |
protected Diagram |
getDiagramView()
Convenience method returning the editpart's parimary view. |
DragTracker |
getDragTracker(Request request)
|
protected EditDomain |
getEditDomain()
gets this editpart's edit domain. |
org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain()
Derives my editing domain from my model or my diagram element. |
protected org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode |
getMapMode()
|
java.lang.Object |
getModel()
Returns tis edit part's model; the returned values is not granteed to be View, the return value could be null or any Object depending
on the edit part implementation |
protected java.util.List |
getModelChildren()
Return this editpart's view (model) children. |
View |
getNotationView()
Return the editpart's associated Notation View. |
java.lang.Object |
getPreferredValue(EStructuralFeature feature)
Retrieves the preferred value for the supplied feature. |
EditPart |
getPrimaryChildEditPart()
this method will return the primary child EditPart inside this edit part |
View |
getPrimaryView()
Convenience method returning the editpart's parimary view. |
protected ResourceManager |
getResourceManager()
Gets the resource manager to remember the resources allocated for this graphical viewer. |
RootEditPart |
getRoot()
|
java.lang.Object |
getStructuralFeatureValue(EStructuralFeature feature)
Convenience method to retreive the value for the supplied value from the editpart's associated view element. |
TopGraphicEditPart |
getTopGraphicEditPart()
Walks up the editpart hierarchy to find and return the TopGraphicEditPart instance. |
protected void |
handleMajorSemanticChange()
Handles the case where the semantic reference has changed. |
protected void |
handleNotificationEvent(Notification event)
Handles the property changed event. |
boolean |
hasNotationView()
indicates if this edit part's model is a view or not |
boolean |
isCanonical()
|
boolean |
isEditModeEnabled()
Returns true if the EditPart is editable. |
boolean |
isSelectable()
Return true if the editpart's figure is visible; false otherwise. |
void |
notifyChanged(Notification notification)
Will be called when a Notification event gets sent from the DiagramEventBroker after the transaction has been closed. |
protected void |
performDirectEditRequest(Request request)
Performs a direct edit request (usually by showing some type of editor) |
void |
performRequest(Request request)
Perform a request by executing a command from the target editpart of the request For the Direct_Edit request, we need to show up an editor first |
protected void |
reactivateSemanticModel()
Method reactivateSemanticModel. |
void |
refresh()
Invoke the editpart's refresh mechanism. |
protected void |
refreshBackgroundColor()
Refresh the editpart's figure background colour. |
protected void |
refreshChild(GraphicalEditPart child)
Refreshes a child editpart by removing it and refreshing children |
protected void |
refreshFont()
Refresh the editpart's figure font. |
protected void |
refreshFontColor()
Refresh the editpart's figure font colour. |
protected void |
refreshForegroundColor()
Refresh the editpart's figure foreground colour. |
protected void |
refreshSourceConnection(ConnectionEditPart conn)
Refreshes a source connection editpart by removing it and refreshing source connections |
protected void |
refreshTargetConnection(ConnectionEditPart conn)
Refreshes a target connection editpart by removing it and refreshing target connections |
protected void |
refreshVisibility()
Refresh the editpart's figure visibility. |
protected void |
refreshVisuals()
Refresh the editpart's figure visual properties. |
protected void |
registerModel()
Adds a [ref, editpart] mapping to the EditPartForElement map. |
protected void |
removeListenerFilter(java.lang.String filterId)
Removes a listener previously added with the given id |
protected void |
removeNotationalListeners()
This method removes all listeners to the notational world (views, figures, editpart...etc) Override this method to remove notational listeners down the hierarchy |
void |
removeNotify()
|
protected void |
removeSemanticListeners()
This method removes all listeners to the semantic element behind this EditPart Override this method to remove semantic listeners down the hierarchy |
EObject |
resolveSemanticElement()
gets the semantic element associated to this editpart. |
protected void |
setBackgroundColor(Color color)
sets the back ground color of this edit part |
protected void |
setFont(FontData fontData)
Sets the font to the label. |
protected void |
setFontColor(Color color)
sets the font color |
protected void |
setForegroundColor(Color color)
sets the fore ground color of this edit part's figure |
void |
setModel(java.lang.Object model)
|
void |
setStructuralFeatureValue(EStructuralFeature feature,
java.lang.Object value)
Sets the passed feature if possible on this editpart's view to the passed value. |
protected void |
setVisibility(boolean vis)
sets the visibility of this edit part |
void |
showSourceFeedback(Request request)
|
void |
showTargetFeedback(Request request)
|
Command |
transactionAboutToCommit(Notification notification)
|
protected void |
unregisterModel()
Remove this editpart from the EditPartForElement map. |
| 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 |
addEditPartListener, addNotify, getChildren, getEditPolicy, getParent, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, removeEditPartListener, removeEditPolicy, setFocus, setParent, setSelected, understandsRequest |
| Field Detail |
protected AccessibleEditPart accessibleEP
protected java.lang.String elementGuid
| Constructor Detail |
public GraphicalEditPart(EObject model)
model - the underlying model.| Method Detail |
public void activate()
activate in interface EditPart
protected void addListenerFilter(java.lang.String filterId,
NotificationListener listener,
EObject element)
filterId - A unique filter id (within the same editpart instance)listener - A listener instanceelement - An element to add the listener to
protected void addListenerFilter(java.lang.String filterId,
NotificationListener listener,
EObject element,
EStructuralFeature feature)
filterId - A unique filter id (within the same editpart instance)listener - A listener instanceelement - An element to add the listener toprotected final ConnectionEditPart createConnection(java.lang.Object connectionView)
protected final void createEditPolicies()
EditPolicyService. Subclasses should override
createDefaultEditPolicies().
AbstractEditPart.createEditPolicies()protected void createDefaultEditPolicies()
AbstractEditPart.createEditPolicies()public void deactivate()
deactivate in interface EditPartpublic void removeNotify()
removeNotify in interface EditPartprotected void executeCommand(Command command)
Command
command - the command to exectueprotected final java.lang.Object basicGetModel()
public java.lang.Object getAdapter(java.lang.Class key)
getAdapter in interface IAdaptablepublic IGraphicalEditPart getChildBySemanticHintOnPrimaryView(java.lang.String semanticHint)
semanticHint - String that is the hint that can retrieved on the getType
method of View
IGraphicalEditPart that matches with the given semanticHintpublic IGraphicalEditPart getChildBySemanticHint(java.lang.String semanticHint)
getChildBySemanticHint in interface IGraphicalEditPartsemanticHint -
public View getChildViewBySemanticHint(java.lang.String semanticHint)
semanticHint -
public Command getCommand(Request _request)
getCommand in interface EditPartprotected IFigure getContentPaneFor(IGraphicalEditPart editPart)
editPart - the edit part to use to get the contents pane
IFigureprotected Diagram getDiagramView()
public final View getPrimaryView()
getView().getPrimaryView()
getPrimaryView in interface IGraphicalEditPartprotected EditDomain getEditDomain()
public IDiagramEditDomain getDiagramEditDomain()
getDiagramEditDomain in interface IGraphicalEditPartprotected java.util.List getModelChildren()
public java.lang.Object getStructuralFeatureValue(EStructuralFeature feature)
ViewUtil.getStructuralFeatureValue(getNotationView(),feature).
getStructuralFeatureValue in interface IGraphicalEditPartpublic EObject resolveSemanticElement()
resolveSemanticElement in interface IGraphicalEditPartnull if the semantic element was
null or unresolvablepublic TopGraphicEditPart getTopGraphicEditPart()
TopGraphicEditPart instance.
getTopGraphicEditPart in interface IGraphicalEditPartpublic View getNotationView()
getNotationView in interface IGraphicalEditPartView, the associated view or null if there is no associated Notation Viewprotected void reactivateSemanticModel()
public EditPart findEditPart(EditPart epBegin,
EObject theElement)
findEditPart in interface IGraphicalEditPartepBegin - starting edit parttheElement - eObject to use
public void refresh()
refresh in interface EditPartprotected void refreshBackgroundColor()
protected void refreshFont()
protected void refreshFontColor()
protected void refreshForegroundColor()
protected void refreshVisibility()
protected void refreshVisuals()
protected void removeListenerFilter(java.lang.String filterId)
filterId - the filter IDprotected void setBackgroundColor(Color color)
color - the new value of the back ground colorprotected void setFont(FontData fontData)
fontData - the font dataprotected void setFontColor(Color color)
color - the new value of the font colorprotected void setForegroundColor(Color color)
color - the new value of the foregroundcolor
public void setStructuralFeatureValue(EStructuralFeature feature,
java.lang.Object value)
setStructuralFeatureValue in interface IGraphicalEditPartfeature - the feature to usevalue - the value of the property being setprotected void setVisibility(boolean vis)
vis - the new value of the visibilityprotected void addNotationalListeners()
protected void addSemanticListeners()
protected void removeNotationalListeners()
protected void removeSemanticListeners()
public void performRequest(Request request)
performRequest in interface EditPartEditPart.performRequest(org.eclipse.gef.Request)protected void performDirectEditRequest(Request request)
request - the direct edit requestprotected AccessibleEditPart getAccessibleEditPart()
AbstractEditPart.getAccessibleEditPart()protected void registerModel()
protected void unregisterModel()
protected final void refreshChild(GraphicalEditPart child)
child - the child to refreshprotected final void refreshSourceConnection(ConnectionEditPart conn)
conn - the connection to refreshprotected final void refreshTargetConnection(ConnectionEditPart conn)
conn - the connection to refreshprotected final void handleMajorSemanticChange()
public DragTracker getDragTracker(Request request)
getDragTracker in interface EditPartEditPart.getDragTracker(org.eclipse.gef.Request)public boolean isCanonical()
public boolean isSelectable()
isSelectable in interface EditPartpublic void disableEditMode()
org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart
disableEditMode in interface org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart
protected void addChild(EditPart child,
int index)
public void enableEditMode()
org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart
enableEditMode in interface org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPartpublic boolean isEditModeEnabled()
org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditParttrue if the EditPart is editable. Editparts are
editable after IEditableEditPart.enableEditMode()is called, and until
IEditableEditPart.disableEditMode()is called.
isEditModeEnabled in interface org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditParttrue when editablepublic void showSourceFeedback(Request request)
showSourceFeedback in interface EditPartpublic void showTargetFeedback(Request request)
showTargetFeedback in interface EditPartpublic void eraseSourceFeedback(Request request)
eraseSourceFeedback in interface EditPartpublic void eraseTargetFeedback(Request request)
eraseTargetFeedback in interface EditPartpublic EditPart getPrimaryChildEditPart()
getPrimaryChildEditPart in interface IGraphicalEditPartpublic PreferencesHint getDiagramPreferencesHint()
IGraphicalEditPart
getDiagramPreferencesHint in interface IGraphicalEditPartpublic void notifyChanged(Notification notification)
NotificationListener
notifyChanged in interface NotificationListenernotification - the notification objectpublic Command transactionAboutToCommit(Notification notification)
protected void handleNotificationEvent(Notification event)
event - the Notification object that is the property changed eventprotected org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode getMapMode()
IMapMode that allows for the coordinate mapping from device to
logical units.public boolean hasNotationView()
true or falsepublic java.lang.Object getModel()
View, the return value could be null or any Object depending
on the edit part implementation
getModel in interface EditPartpublic org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()
getEditingDomain in interface IGraphicalEditPartprotected IFigure createFigure()
public void setModel(java.lang.Object model)
setModel in interface EditPartpublic RootEditPart getRoot()
getRoot in interface EditPartpublic java.lang.Object getPreferredValue(EStructuralFeature feature)
IGraphicalEditPart
getPreferredValue in interface IGraphicalEditPartfeature - the feature to use
protected ResourceManager getResourceManager()
|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.