|
Eclipse GEF 3.0.1 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.GraphicalEditPolicy
org.eclipse.gef.editpolicies.SelectionEditPolicy
org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy
org.eclipse.gef.editpolicies.BendpointEditPolicy
Used to add bendpoint handles on a ConnectionEditPart.
BendpointEditPolicy will automatically observe the Connection figure. If the number of bends in the
Connection changes, the handles will be updated.
| Field Summary |
| Fields inherited from class org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy |
handles |
| 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 |
| Constructor Summary | |
BendpointEditPolicy()
|
|
| Method Summary | |
void |
activate()
activate() is extended to add a listener to the Connection
figure. |
protected List |
createSelectionHandles()
Creates selection handles for the bendpoints. |
void |
deactivate()
deactivate() is extended to remove the property change listener on the
Connection figure. |
protected void |
eraseConnectionFeedback(BendpointRequest request)
Erases all bendpoint feedback. |
void |
eraseSourceFeedback(Request request)
Does nothing by default. |
Command |
getCommand(Request request)
Factors the Request into either a MOVE, a DELETE, or a CREATE of a bendpoint. |
protected Connection |
getConnection()
Convenience method for obtaining the host's Connection figure. |
protected abstract Command |
getCreateBendpointCommand(BendpointRequest request)
Implement this method to return a Command that will create a bendpoint. |
protected abstract Command |
getDeleteBendpointCommand(BendpointRequest request)
Implement this method to return a Command that will delete a bendpoint. |
protected abstract Command |
getMoveBendpointCommand(BendpointRequest request)
Implement this method to return a Command that will move a bendpoint. |
void |
propertyChange(PropertyChangeEvent evt)
If the number of bendpoints changes, handles are updated. |
protected void |
restoreOriginalConstraint()
Restores the original constraint that was saved before feedback began to show. |
protected void |
saveOriginalConstraint()
Since the original figure is used for feedback, this method saves the original constraint, so that is can be restored when the feedback is erased. |
protected void |
showCreateBendpointFeedback(BendpointRequest request)
Shows feedback when a bendpoint is being created. |
protected void |
showDeleteBendpointFeedback(BendpointRequest request)
Shows feedback when a bendpoint is being deleted. |
protected void |
showMoveBendpointFeedback(BendpointRequest request)
Shows feedback when a bendpoint is being moved. |
void |
showSourceFeedback(Request request)
Shows feedback when appropriate. |
| Methods inherited from class org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy |
addSelectionHandles, getAdapter, hideSelection, removeSelectionHandles, showSelection |
| Methods inherited from class org.eclipse.gef.editpolicies.SelectionEditPolicy |
addSelectionListener, getTargetEditPart, hideFocus, removeSelectionListener, setFocus, setSelectedState, showFocus, showPrimarySelection |
| Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy |
addFeedback, getFeedbackLayer, getHostFigure, getLayer, removeFeedback |
| Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy |
debugFeedback, eraseTargetFeedback, getHost, setHost, showTargetFeedback, toString, understandsRequest |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public BendpointEditPolicy()
| Method Detail |
public void activate()
activate() is extended to add a listener to the Connection
figure.
activate in interface EditPolicyactivate in class SelectionEditPolicyEditPolicy.activate()protected List createSelectionHandles()
BendpointMoveHandles on them with a single BendpointCreationHandle between 2 consecutive explicit bendpoints. If implicit
bendpoints (such as those created by the AutomaticRouter) are used, one BendpointCreationHandle is placed in the middle of the Connection.
createSelectionHandles in class SelectionHandlesEditPolicySelectionHandlesEditPolicy.createSelectionHandles()public void deactivate()
deactivate() is extended to remove the property change listener on the
Connection figure.
deactivate in interface EditPolicydeactivate in class SelectionEditPolicyEditPolicy.deactivate()protected void eraseConnectionFeedback(BendpointRequest request)
Connection figure is
used for feedback, we just restore the original constraint that was saved before
feedback started to show.
request - the BendpointRequestpublic void eraseSourceFeedback(Request request)
AbstractEditPolicy
eraseSourceFeedback in interface EditPolicyeraseSourceFeedback in class AbstractEditPolicyEditPolicy.eraseSourceFeedback(Request)public Command getCommand(Request request)
getCommand in interface EditPolicygetCommand in class AbstractEditPolicyEditPolicy.getCommand(Request)protected Connection getConnection()
Connection figure.
protected abstract Command getCreateBendpointCommand(BendpointRequest request)
request - the BendpointRequest
protected abstract Command getDeleteBendpointCommand(BendpointRequest request)
request - the BendpointRequest
protected abstract Command getMoveBendpointCommand(BendpointRequest request)
request - the BendpointRequest
public void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerPropertyChangeListener.propertyChange(PropertyChangeEvent)protected void restoreOriginalConstraint()
protected void saveOriginalConstraint()
protected void showCreateBendpointFeedback(BendpointRequest request)
request - the BendpointRequestprotected void showDeleteBendpointFeedback(BendpointRequest request)
request - the BendpointRequestprotected void showMoveBendpointFeedback(BendpointRequest request)
showDeleteBendpointFeedback(BendpointRequest)
if needed. The original figure is used for feedback and the original constraint is
saved, so that it can be restored when feedback is erased.
request - the BendpointRequestpublic void showSourceFeedback(Request request)
showSourceFeedback in interface EditPolicyshowSourceFeedback in class AbstractEditPolicyrequest - the RequestshowCreateBendpointFeedback(BendpointRequest),
showMoveBendpointFeedback(BendpointRequest)
|
Eclipse GEF 3.0.1 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||