public abstract class GraphicalNodeEditPolicy extends GraphicalEditPolicy
Modifier and Type | Field and Description |
---|---|
protected Connection |
connectionFeedback
The connection feedback displayed during creates
|
protected FeedbackHelper |
feedbackHelper
the current FeedbackHelper
|
COMPONENT_ROLE, CONNECTION_BENDPOINTS_ROLE, CONNECTION_ENDPOINTS_ROLE, CONNECTION_ROLE, CONTAINER_ROLE, DIRECT_EDIT_ROLE, GRAPHICAL_NODE_ROLE, LAYOUT_ROLE, NODE_ROLE, PRIMARY_DRAG_ROLE, SELECTION_FEEDBACK_ROLE, TREE_CONTAINER_ROLE
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 and Description |
---|
GraphicalNodeEditPolicy() |
Modifier and Type | Method and Description |
---|---|
protected Connection |
createDummyConnection(Request req)
Returns a connection to be used as feeback during creates.
|
void |
deactivate()
Does nothing by default.
|
protected void |
eraseCreationFeedback(CreateConnectionRequest request)
Erases connection feedback if necessary.
|
void |
eraseSourceFeedback(Request request)
Calls
eraseCreationFeedback(CreateConnectionRequest) when
appropriate. |
protected void |
eraseTargetConnectionFeedback(DropRequest request)
Override to erase target feedback.
|
void |
eraseTargetFeedback(Request request)
Calls
eraseTargetConnectionFeedback(DropRequest) when
appropriate. |
Command |
getCommand(Request request)
Factors the request into one of four abstract methods.
|
protected abstract Command |
getConnectionCompleteCommand(CreateConnectionRequest request)
Returns the Command that will create the connection.
|
protected abstract Command |
getConnectionCreateCommand(CreateConnectionRequest request)
Returns the command that represents the first half of creating a
connection.
|
protected ConnectionRouter |
getDummyConnectionRouter(CreateConnectionRequest request)
Returns the ConnectionRouter for the creation feedback's connection.
|
protected FeedbackHelper |
getFeedbackHelper(CreateConnectionRequest request)
Returns the FeedbackHelper that is ready to use.
|
protected abstract Command |
getReconnectSourceCommand(ReconnectRequest request)
Returns the
Command to reconnect a connection's
source end to the host. |
protected abstract Command |
getReconnectTargetCommand(ReconnectRequest request)
Returns the
Command to reconnect a connection's
target end to the host. |
protected ConnectionAnchor |
getSourceConnectionAnchor(CreateConnectionRequest request)
Called during the display of creation feedback to snap the feedback to
the nearest source ConnectionAnchor.
|
protected ConnectionAnchor |
getTargetConnectionAnchor(CreateConnectionRequest request)
Called during the display of creation feedback to snap the feedback to
the nearest target ConnectionAnchor.
|
EditPart |
getTargetEditPart(Request request)
Returns the host for the appropriate
Requests . |
protected void |
showCreationFeedback(CreateConnectionRequest request)
Shows feedback during a creation.
|
void |
showSourceFeedback(Request request)
calls
showCreationFeedback(CreateConnectionRequest) when
appropriate. |
protected void |
showTargetConnectionFeedback(DropRequest request)
Override to show target connection feedback.
|
void |
showTargetFeedback(Request request)
Calls
showTargetConnectionFeedback(DropRequest) when
appropriate. |
addFeedback, getFeedbackLayer, getHostFigure, getLayer, removeFeedback
activate, debugFeedback, getHost, setHost, toString, understandsRequest
protected FeedbackHelper feedbackHelper
protected Connection connectionFeedback
protected Connection createDummyConnection(Request req)
req
- the operation being performedpublic void deactivate()
AbstractEditPolicy
deactivate
in interface EditPolicy
deactivate
in class AbstractEditPolicy
EditPolicy.deactivate()
protected void eraseCreationFeedback(CreateConnectionRequest request)
request
- the CreateConnectionRequestpublic void eraseSourceFeedback(Request request)
eraseCreationFeedback(CreateConnectionRequest)
when
appropriate.eraseSourceFeedback
in interface EditPolicy
eraseSourceFeedback
in class AbstractEditPolicy
request
- the RequestEditPolicy.eraseSourceFeedback(Request)
protected void eraseTargetConnectionFeedback(DropRequest request)
request
- the DropRequestpublic void eraseTargetFeedback(Request request)
eraseTargetConnectionFeedback(DropRequest)
when
appropriate.eraseTargetFeedback
in interface EditPolicy
eraseTargetFeedback
in class AbstractEditPolicy
request
- the RequestEditPolicy.eraseTargetFeedback(Request)
public Command getCommand(Request request)
getCommand
in interface EditPolicy
getCommand
in class AbstractEditPolicy
request
- the Requestnull
or a Command contributionEditPolicy.getCommand(Request)
protected abstract Command getConnectionCompleteCommand(CreateConnectionRequest request)
CreateConnectionRequest.getStartCommand()
is used
here to obtain the contribution from the EditPart from which the User
started the creation.request
- the CreateConnectionRequestprotected abstract Command getConnectionCreateCommand(CreateConnectionRequest request)
CreateConnectionRequest.setStartCommand(Command)
) before
returning it here.request
- the CreateConnectionRequestgetConnectionCompleteCommand(CreateConnectionRequest)
protected ConnectionRouter getDummyConnectionRouter(CreateConnectionRequest request)
request
- the create requestprotected FeedbackHelper getFeedbackHelper(CreateConnectionRequest request)
request
- the CreateConnectionRequestprotected abstract Command getReconnectTargetCommand(ReconnectRequest request)
Command
to reconnect a connection's
target end to the host.request
- the ReconnectRequestprotected abstract Command getReconnectSourceCommand(ReconnectRequest request)
Command
to reconnect a connection's
source end to the host.request
- the ReconnectRequestprotected ConnectionAnchor getSourceConnectionAnchor(CreateConnectionRequest request)
request
- CreateConnectionRequestnull
or the nearest source ConnectionAnchorprotected ConnectionAnchor getTargetConnectionAnchor(CreateConnectionRequest request)
request
- CreateConnectionRequestnull
or the nearest target ConnectionAnchorpublic EditPart getTargetEditPart(Request request)
Requests
.
Returns null
otherwise.getTargetEditPart
in interface EditPolicy
getTargetEditPart
in class AbstractEditPolicy
request
- the Requestnull
or the appropriate target EditPart
EditPolicy.getTargetEditPart(Request)
protected void showCreationFeedback(CreateConnectionRequest request)
request
- CreateConnectionRequestpublic void showSourceFeedback(Request request)
showCreationFeedback(CreateConnectionRequest)
when
appropriate.showSourceFeedback
in interface EditPolicy
showSourceFeedback
in class AbstractEditPolicy
request
- the RequestEditPolicy.showSourceFeedback(Request)
protected void showTargetConnectionFeedback(DropRequest request)
request
- the DropRequestpublic void showTargetFeedback(Request request)
showTargetConnectionFeedback(DropRequest)
when
appropriate.showTargetFeedback
in interface EditPolicy
showTargetFeedback
in class AbstractEditPolicy
request
- the RequestEditPolicy.showTargetFeedback(Request)
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.