|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.gef.editpolicies.AbstractEditPolicy | +--org.eclipse.gef.editpolicies.GraphicalEditPolicy | +--org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
A GraphicalNodeEditPolicy is responsible for creating and reconnecting connections graphically. Created on :Nov 11, 2002
Field Summary | |
protected Connection |
connectionFeedback
The connection feedback displayed during creates |
protected FeedbackHelper |
feedbackHelper
the current FeedbackHelper |
Fields inherited from interface org.eclipse.gef.EditPolicy |
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 |
Fields inherited from interface org.eclipse.gef.RequestConstants |
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, 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 | |
GraphicalNodeEditPolicy()
|
Method Summary | |
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 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. |
Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy |
addFeedback, getHostFigure, getLayer, removeFeedback |
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy |
activate, debugFeedback, getHost, setHost, toString, understandsRequest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected FeedbackHelper feedbackHelper
protected Connection connectionFeedback
Constructor Detail |
public GraphicalNodeEditPolicy()
Method Detail |
protected Connection createDummyConnection(Request req)
req
- the operation being performed
public 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
EditPolicy.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
EditPolicy.eraseTargetFeedback(Request)
public Command getCommand(Request request)
getCommand
in interface EditPolicy
getCommand
in class AbstractEditPolicy
EditPolicy.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 CreateConnectionRequest
protected abstract Command getConnectionCreateCommand(CreateConnectionRequest request)
request
- the CreateConnectionRequest
getConnectionCompleteCommand(CreateConnectionRequest)
protected FeedbackHelper getFeedbackHelper(CreateConnectionRequest request)
request
- the CreateConnectionRequest
protected abstract Command getReconnectTargetCommand(ReconnectRequest request)
Command
to reconnect a connection's target end to the
host.
request
- the ReconnectRequest
protected abstract Command getReconnectSourceCommand(ReconnectRequest request)
Command
to reconnect a connection's source end to the
host.
request
- the ReconnectRequest
protected ConnectionAnchor getSourceConnectionAnchor(CreateConnectionRequest request)
request
- CreateConnectionRequest
null
or the nearest source ConnectionAnchorprotected ConnectionAnchor getTargetConnectionAnchor(CreateConnectionRequest request)
request
- CreateConnectionRequest
null
or the nearest target ConnectionAnchorpublic EditPart getTargetEditPart(Request request)
Requests
. Returns
null
otherwise.
getTargetEditPart
in interface EditPolicy
getTargetEditPart
in class AbstractEditPolicy
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
EditPolicy.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
EditPolicy.showTargetFeedback(Request)
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |