org.eclipse.gef.editpolicies
Class GraphicalNodeEditPolicy
java.lang.Object
org.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.GraphicalEditPolicy
org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy
-
All Implemented Interfaces:
-
EditPolicy,
RequestConstants
- public abstract class GraphicalNodeEditPolicy
- extends
GraphicalEditPolicy
A GraphicalNodeEditPolicy is responsible for creating and reconnecting connections
graphically.
Created on :Nov 11, 2002
-
Since:
- 2.0
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_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
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
|
feedbackHelper
protected
FeedbackHelper feedbackHelper
- the current FeedbackHelper
connectionFeedback
protected
Connection connectionFeedback
- The connection feedback displayed during creates
GraphicalNodeEditPolicy
public GraphicalNodeEditPolicy()
createDummyConnection
protected
Connection createDummyConnection(
Request req)
- Returns a connection to be used as feeback during creates.
-
-
Parameters:
-
req
- the operation being performed
-
Returns:
- a connection to use as feedback
deactivate
public void deactivate()
-
Description copied from class:
AbstractEditPolicy
- Does nothing by default.
-
-
Specified by:
-
deactivate
in interface
EditPolicy
-
Overrides:
-
deactivate
in class
AbstractEditPolicy
-
-
See Also:
-
EditPolicy.deactivate()
eraseCreationFeedback
protected void eraseCreationFeedback(
CreateConnectionRequest request)
- Erases connection feedback if necessary. Frees unused fields.
-
-
Parameters:
-
request
- the CreateConnectionRequest
eraseSourceFeedback
public void eraseSourceFeedback(
Request request)
- Calls
eraseCreationFeedback(CreateConnectionRequest)
when appropriate.
-
-
Specified by:
-
eraseSourceFeedback
in interface
EditPolicy
-
Overrides:
-
eraseSourceFeedback
in class
AbstractEditPolicy
-
-
See Also:
-
EditPolicy.eraseSourceFeedback(Request)
eraseTargetConnectionFeedback
protected void eraseTargetConnectionFeedback(
DropRequest request)
- Override to erase target feedback. Does nothing by default.
-
-
Parameters:
-
request
- the DropRequest
eraseTargetFeedback
public void eraseTargetFeedback(
Request request)
- Calls
eraseTargetConnectionFeedback(DropRequest)
when appropriate.
-
-
Specified by:
-
eraseTargetFeedback
in interface
EditPolicy
-
Overrides:
-
eraseTargetFeedback
in class
AbstractEditPolicy
-
-
See Also:
-
EditPolicy.eraseTargetFeedback(Request)
getCommand
public
Command getCommand(
Request request)
- Factors the request into one of four abstract methods. Subclasses must implement these
methods.
-
-
Specified by:
-
getCommand
in interface
EditPolicy
-
Overrides:
-
getCommand
in class
AbstractEditPolicy
-
-
See Also:
-
EditPolicy.getCommand(Request)
getConnectionCompleteCommand
protected abstract
Command getConnectionCompleteCommand(
CreateConnectionRequest request)
- Returns the Command that will create the connection. This is second part of creation.
CreateConnectionRequest.getStartCommand()
is used here to obtain the
contribution from the EditPart from which the User started the creation.
-
-
Parameters:
-
request
- the CreateConnectionRequest
-
Returns:
- the complete command to create a connection
getConnectionCreateCommand
protected abstract
Command getConnectionCreateCommand(
CreateConnectionRequest request)
- Returns the Command that represents the first half of creating a connection. This
Command will be passed to the target node EditPart. The target node may do anything
necessary to create a Command that represents the entire creation.
-
-
Parameters:
-
request
- the CreateConnectionRequest
-
Returns:
- a Command representing half of a connection creation
-
See Also:
-
getConnectionCompleteCommand(CreateConnectionRequest)
getDummyConnectionRouter
protected
ConnectionRouter getDummyConnectionRouter(
CreateConnectionRequest request)
- Returns the ConnectionRouter for the creation feedback's connection.
-
-
Parameters:
-
request
- the create request
-
Returns:
- a connection router
-
Since:
- 3.2
getFeedbackHelper
protected
FeedbackHelper getFeedbackHelper(
CreateConnectionRequest request)
- Returns the FeedbackHelper that is ready to use. The feedback helper must be configured
with the connection that will be used to display feedback, and that connection must be
added to the appropriate layer in the diagram.
-
-
Parameters:
-
request
- the CreateConnectionRequest
-
Returns:
- a FeedbackHelper
getReconnectTargetCommand
protected abstract
Command getReconnectTargetCommand(
ReconnectRequest request)
- Returns the
Command
to reconnect a connection's target end to the
host.
-
-
Parameters:
-
request
- the ReconnectRequest
-
Returns:
- a Command
getReconnectSourceCommand
protected abstract
Command getReconnectSourceCommand(
ReconnectRequest request)
- Returns the
Command
to reconnect a connection's source end to the
host.
-
-
Parameters:
-
request
- the ReconnectRequest
-
Returns:
- a Command
getSourceConnectionAnchor
protected
ConnectionAnchor getSourceConnectionAnchor(
CreateConnectionRequest request)
- Called during the display of creation feedback to snap the feedback to the nearest
source ConnectionAnchor.
-
-
Parameters:
-
request
- CreateConnectionRequest
-
Returns:
-
null
or the nearest source ConnectionAnchor
getTargetConnectionAnchor
protected
ConnectionAnchor getTargetConnectionAnchor(
CreateConnectionRequest request)
- Called during the display of creation feedback to snap the feedback to the nearest
target ConnectionAnchor.
-
-
Parameters:
-
request
- CreateConnectionRequest
-
Returns:
-
null
or the nearest target ConnectionAnchor
getTargetEditPart
public
EditPart getTargetEditPart(
Request request)
- Returns the host for the appropriate
Requests
. Returns
null
otherwise.
-
-
Specified by:
-
getTargetEditPart
in interface
EditPolicy
-
Overrides:
-
getTargetEditPart
in class
AbstractEditPolicy
-
-
See Also:
-
EditPolicy.getTargetEditPart(Request)
showCreationFeedback
protected void showCreationFeedback(
CreateConnectionRequest request)
- Shows feedback during a creation.
-
-
Parameters:
-
request
- CreateConnectionRequest
showSourceFeedback
public void showSourceFeedback(
Request request)
- calls
showCreationFeedback(CreateConnectionRequest)
when appropriate.
-
-
Specified by:
-
showSourceFeedback
in interface
EditPolicy
-
Overrides:
-
showSourceFeedback
in class
AbstractEditPolicy
-
-
See Also:
-
EditPolicy.showSourceFeedback(Request)
showTargetConnectionFeedback
protected void showTargetConnectionFeedback(
DropRequest request)
- Override to show target connection feedback. Does nothing by default.
-
-
Parameters:
-
request
- the DropRequest
showTargetFeedback
public void showTargetFeedback(
Request request)
- Calls
showTargetConnectionFeedback(DropRequest)
when appropriate.
-
-
Specified by:
-
showTargetFeedback
in interface
EditPolicy
-
Overrides:
-
showTargetFeedback
in class
AbstractEditPolicy
-
-
See Also:
-
EditPolicy.showTargetFeedback(Request)
Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.