|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.eclipse.gef.editparts.AbstractEditPart
|
+--org.eclipse.gef.editparts.AbstractGraphicalEditPart
Abstract class which uses IFigures for visuals.
| Inner Class Summary | |
protected class |
AbstractGraphicalEditPart.AccessibleGraphicalEditPart
|
protected class |
AbstractGraphicalEditPart.DefaultAccessibleAnchorProvider
|
| Inner classes inherited from class org.eclipse.gef.editparts.AbstractEditPart |
AbstractEditPart.EditPolicyIterator |
| Field Summary | |
protected IFigure |
figure
|
protected List |
handles
|
protected List |
sourceConnections
|
protected List |
targetConnections
|
| Fields inherited from class org.eclipse.gef.editparts.AbstractEditPart |
children, eventListeners, FLAG_ACTIVE, FLAG_FOCUS, FLAG_INITIALIZED, MAX_FLAG |
| Fields inherited from interface org.eclipse.gef.EditPart |
SELECTED, SELECTED_NONE, SELECTED_PRIMARY |
| Constructor Summary | |
AbstractGraphicalEditPart()
|
|
| Method Summary | |
void |
activate()
Indicates that editing has begun and the model may start changing. |
protected void |
addChildVisual(EditPart childEditPart,
int index)
Before performing the addition of the child EditPart to the model structure in super, its Figure is added to the graphical model. |
protected void |
addSourceConnection(ConnectionEditPart connection,
int index)
Adds a connection to this EditPart, the source. |
protected void |
addTargetConnection(ConnectionEditPart connection,
int index)
Adds a connection to this EditPart, the target. |
protected abstract IFigure |
createFigure()
Returns the figure to be used as this part's visuals. |
void |
deactivate()
Called by the managing EditPart(s). |
void |
dispose()
Called when the EditPart will no longer be used. |
protected void |
fireRemovingSourceConnection(ConnectionEditPart connection,
int index)
Notifies listeners that a source connection has been added. |
protected void |
fireRemovingTargetConnection(ConnectionEditPart connection,
int index)
Notifies listeners that a source connection has been added. |
protected void |
fireSourceConnectionAdded(ConnectionEditPart connection,
int index)
Notifies listeners that a source connection has been added. |
protected void |
fireTargetConnectionAdded(ConnectionEditPart connection,
int index)
Notifies listeners that a source connection has been added. |
Object |
getAdapter(Class key)
Returns the adapter of the given type, for example: IPropertySource. |
IFigure |
getContentPane()
The figure into which children will be placed. |
DragTracker |
getDragTracker(Request request)
Returns a DragTrack for the given Request. |
IFigure |
getFigure()
Returns the graphical object of this. |
protected IFigure |
getLayer(Object layer)
Returns the layer with the input name from the LayerManager from |
protected List |
getModelSourceConnections()
Returns a List of the connection model objects
for which this EditPart's model is the source. |
protected List |
getModelTargetConnections()
Returns a List of the connection model objects
for which this EditPart's model is the target. |
protected IFigure |
getParentingFigure()
|
List |
getSourceConnections()
Returns the connections for which this EditPart is the source. |
List |
getTargetConnections()
Returns the connections for which this EditPart is the target. |
protected void |
primAddSourceConnection(ConnectionEditPart connection,
int index)
Performs the actual addition of a source connection. |
protected void |
primAddTargetConnection(ConnectionEditPart connection,
int index)
Performs the actual addition of a target connection. |
protected void |
primRemoveSourceConnection(ConnectionEditPart connection)
Performs the actual removal of a source connection. |
protected void |
primRemoveTargetConnection(ConnectionEditPart editPart)
Performs the actual removal of a target connection. |
void |
refresh()
Called to force a refresh of all properties displayed by this EditPart. |
protected void |
refreshSourceConnections()
Refreshes the set of Source Connections. |
protected void |
refreshTargetConnections()
Refreshes the set of Target Connections. |
protected void |
registerVisuals()
|
protected void |
removeChildVisual(EditPart childEditPart)
Before removing the child EditPart from the model structure in super, its Figure is removed from the graphical model. |
protected void |
removeSourceConnection(ConnectionEditPart connection)
Removes the given connection for which this EditPart is the source. |
protected void |
removeTargetConnection(ConnectionEditPart connection)
Removes the given connection for which this EditPart is the target. |
protected void |
reorderChild(EditPart child,
int index)
Reorders the child to be at the specified new position. |
protected void |
reorderSourceConnection(ConnectionEditPart editPart,
int index)
Bubbles the given source ConnectionEditPart into a lower index than it
previously occupied. |
protected void |
reorderTargetConnection(ConnectionEditPart editPart,
int index)
Bubbles the given target ConnectionEditPart into a lower index than it
previously occupied. |
protected void |
setFigure(IFigure figure)
Sets the Figure representing the graphical content of this. |
void |
setLayoutConstraint(EditPart child,
IFigure childFigure,
Object constraint)
A child can call this method to set the layout constraint for its figure. |
protected boolean |
shouldInitialize()
Updates this EditPart. |
protected void |
unregister()
Undoes any registration performed by AbstractEditPart.register(). |
| 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, getKeyHandler, getModel, getParent, getRoot, getSelected, getTargetEditPart, hasFocus, installEditPolicy, performRequest, removeEditPartListener, removeEditPolicy, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest |
| Field Detail |
protected IFigure figure
protected List handles
protected List sourceConnections
protected List targetConnections
| Constructor Detail |
public AbstractGraphicalEditPart()
| Method Detail |
public void activate()
EditPartEditPart.activate() and then EditPart.deactivate() multiple times on
the receiver.
Activiation should initiate several things. First, the EditPart
should begin to observe its model if appropriate, and should continue
the observation until EditPart.deactivate() is called. The EditPart
should create and activate all of its EditPolicies. EditPolicies
may also observe the model, and should also stop observing when deactivated.
Any EditParts managed by this EditPart should also be activated.
activate in interface EditPartactivate in class AbstractEditPartorg.eclipse.gef.editparts.AbstractEditPartAbstractEditPart.deactivate()
protected void addChildVisual(EditPart childEditPart,
int index)
addChildVisual in class AbstractEditPartchildEditPart - EditPart being added to the structureindex - Psotion the EditPart is being added into.
protected void addSourceConnection(ConnectionEditPart connection,
int index)
Adds a connection to this EditPart, the source.
The connection will have its source set to this EditPart,
The connection will be conditionally activated.
primAddSourceConnection(ConnectionEditPart, int) is called
to separate the act of adding the connection from the activation
and firing of notification. Subclasses should generally override
primAddSourceConnection(ConnectionEditPart, int);connection - Connection being addedindex - Index where it is being addedprimAddSourceConnection(ConnectionEditPart, int),
removeSourceConnection(org.eclipse.gef.ConnectionEditPart)
protected void addTargetConnection(ConnectionEditPart connection,
int index)
Adds a connection to this EditPart, the target.connection - Connection being addedindex - Index where it is being addedremoveTargetConnection(ConnectionEditPart),
addSourceConnection(ConnectionEditPart,int)protected abstract IFigure createFigure()
public void deactivate()
EditPartEditPart.activate() and then EditPart.deactivate() multiple
times on the receiver. The EditPart should unhook all listeners to
the model, and should deactivate its EditPolicies. It may be
reactivated later. The EditPart should deactivate all EditParts
that it manages.deactivate in interface EditPartdeactivate in class AbstractEditPartorg.eclipse.gef.editparts.AbstractEditPartAbstractEditPart.activate()public void dispose()
EditPartEditPart.deactivate(), such as unregistering
itself from the Viewer.dispose in interface EditPartdispose in class AbstractEditPart
protected void fireRemovingSourceConnection(ConnectionEditPart connection,
int index)
connection - ConnectionEditPart being added as child.index - Position child is being added into.
protected void fireRemovingTargetConnection(ConnectionEditPart connection,
int index)
connection - ConnectionEditPart being added as child.index - Position child is being added into.
protected void fireSourceConnectionAdded(ConnectionEditPart connection,
int index)
connection - ConnectionEditPart being added as child.index - Position child is being added into.
protected void fireTargetConnectionAdded(ConnectionEditPart connection,
int index)
connection - ConnectionEditPart being added as child.index - Position child is being added into.public Object getAdapter(Class key)
AbstractEditPart
Returns the adapter of the given type, for example: IPropertySource.
If your model implements IPropertySource, or if it is IAdaptable then there
is no reason to override this method. Or, if you do not need propertysheet
support.
EditParts are the objects sent out as selection to other viewers. If you have
viewers that require additional adapter types, return them here.getAdapter in interface IAdaptablegetAdapter in class AbstractEditPartorg.eclipse.gef.editparts.AbstractEditPartIAdaptablepublic IFigure getContentPane()
GraphicalEditPartnull,
but may return the same figure as getFigure(). An example would be
a GraphicalEditPart that uses a
ScrollPane, which looks like this:
| ┬ | ScrollPane - returned by getFigure() |
||
| └ | ┬ | Viewport - (internal, does the scrolling) | |
| └ | ─ | View - returned by getContentPane() |
|
A ScrollPane already has a special child, so the GraphicalEditPart's children will get added to the View
getContentPane in interface GraphicalEditPartpublic DragTracker getDragTracker(Request request)
getDragTracker in interface EditPartRequest - A Request describing the type of drag.public final IFigure getFigure()
getFigure in interface GraphicalEditPartIFigureprotected IFigure getLayer(Object layer)
LayerManager fromlayer - Name of the Layer to be returnedprotected List getModelSourceConnections()
Returns a List of the connection model objects
for which this EditPart's model is the source.
refreshSourceConnections() requires that this List be
non-null. For each connection model object,
AbstractEditPart.createConnection(Object) will be called to obtain a corresponding
ConnectionEditPart.protected List getModelTargetConnections()
Returns a List of the connection model objects
for which this EditPart's model is the target.
refreshTargetConnections() requires that this List be
non-null. For each connection model object,
AbstractEditPart.createConnection(Object) will be called to obtain a corresponding
ConnectionEditPart.
protected final IFigure getParentingFigure()
throws Exception
public List getSourceConnections()
GraphicalEditPartgetSourceConnections in interface GraphicalEditPartpublic List getTargetConnections()
GraphicalEditPartgetTargetConnections in interface GraphicalEditPart
protected void primAddSourceConnection(ConnectionEditPart connection,
int index)
Performs the actual addition of a source connection.connection - The connection to add.index - Position connection is being added.addSourceConnection(ConnectionEditPart,int)
protected void primAddTargetConnection(ConnectionEditPart connection,
int index)
Performs the actual addition of a target connection.
A target connection is a connection whose target is this EditPart.connection - The connection being added.index - Position connection is being added.addTargetConnection(ConnectionEditPart,int)protected void primRemoveSourceConnection(ConnectionEditPart connection)
connection - Connection to remove.removeSourceConnection(ConnectionEditPart)protected void primRemoveTargetConnection(ConnectionEditPart editPart)
connection - Connection to remove.removeTargetConnection(ConnectionEditPart)public void refresh()
EditPartrefresh in interface EditPartrefresh in class AbstractEditPartprotected void refreshSourceConnections()
Refreshes the set of Source Connections.
This method should not be overridden. AbstractEditPart.createConnection(Object)
and getModelSourceConnections() should be overridden together.protected void refreshTargetConnections()
Refreshes the set of Target Connections.
This method should not be overridden. AbstractEditPart.createConnection(Object)
and getModelTargetConnections() should be overridden together.protected void registerVisuals()
registerVisuals in class AbstractEditPartprotected void removeChildVisual(EditPart childEditPart)
removeChildVisual in class AbstractEditPartchildEditPart - EditPart being removed from the structureprotected void removeSourceConnection(ConnectionEditPart connection)
Removes the given connection for which this EditPart is the source.
addSourceConnection(ConnectionEditPart, int)connection - Connection being removedprotected void removeTargetConnection(ConnectionEditPart connection)
Removes the given connection for which this EditPart is the target.
addTargetConnection(ConnectionEditPart, int)connection - Connection being removed
protected void reorderChild(EditPart child,
int index)
reorderChild in class AbstractEditPartchild - EditPart being reordered.index - PosPosition being reordered to.
protected void reorderSourceConnection(ConnectionEditPart editPart,
int index)
Bubbles the given source ConnectionEditPart into a lower index than it
previously occupied.connection - Connection being reorderedindex - the new Position into which the connection is being placed.
protected void reorderTargetConnection(ConnectionEditPart editPart,
int index)
Bubbles the given target ConnectionEditPart into a lower index than it
previously occupied.connection - Connection being reorderedindex - the new Position into which the connection is being placed.protected void setFigure(IFigure figure)
figure - Figure being set.
public void setLayoutConstraint(EditPart child,
IFigure childFigure,
Object constraint)
GraphicalEditPartsetLayoutConstraint in interface GraphicalEditPartprotected boolean shouldInitialize()
shouldInitialize in class AbstractEditPartprotected void unregister()
AbstractEditPart
Undoes any registration performed by AbstractEditPart.register().
The provided base classes will correctly unregister their visuals.unregister in class AbstractEditPart
|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||