|
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.SelectionEditPolicy | +--org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy | +--org.eclipse.gef.editpolicies.NonResizableEditPolicy
Provide support for selecting and positioning a non-resizable editpart. Selection is
indicated via four square handles at each corner of the editpart's figure, and a
rectangular handle that outlines the editpart with a 1-pixel black line. All of these
handles return DragEditPartsTracker
s, which allows the
current selection to be dragged.
During feedback, a rectangle filled using XOR and outlined with dashes is drawn. Subclasses can tailor the feedback.
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_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 | |
NonResizableEditPolicy()
|
Method Summary | |
protected IFigure |
createDragSourceFeedbackFigure()
Creates the figure used for feedback. |
protected List |
createSelectionHandles()
Subclasses must implement to provide the list of handles. |
void |
deactivate()
Extends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus. |
protected void |
eraseChangeBoundsFeedback(ChangeBoundsRequest request)
Erases drag feedback. |
void |
eraseSourceFeedback(Request request)
Does nothing by default. |
protected Command |
getAlignCommand(AlignmentRequest request)
Returns the command contribution to an alignment request |
Command |
getCommand(Request request)
Returns null by default. |
protected IFigure |
getDragSourceFeedbackFigure()
Lazily creates and returns the feedback figure used during drags. |
protected Command |
getMoveCommand(ChangeBoundsRequest request)
Returns the command contribution to a change bounds request. |
protected Command |
getOrphanCommand(Request req)
Subclasses may override to contribute to the orphan request. |
protected void |
hideFocus()
Hides the focus rectangle displayed in showFocus() . |
protected void |
showChangeBoundsFeedback(ChangeBoundsRequest request)
Shows or updates feedback for a change bounds request. |
protected void |
showFocus()
Shows a focus rectangle around the host's figure. |
void |
showSourceFeedback(Request request)
Calls other methods as appropriate. |
boolean |
understandsRequest(Request request)
Returns true for move, align, add, and orphan request types. |
Methods inherited from class org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy |
addSelectionHandles, getAdapter, hideSelection, removeSelectionHandles, showSelection |
Methods inherited from class org.eclipse.gef.editpolicies.SelectionEditPolicy |
activate, addSelectionListener, getTargetEditPart, removeSelectionListener, setFocus, setSelectedState, showPrimarySelection |
Methods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy |
addFeedback, getHostFigure, getLayer, removeFeedback |
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy |
debugFeedback, eraseTargetFeedback, getHost, setHost, showTargetFeedback, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NonResizableEditPolicy()
Method Detail |
protected IFigure createDragSourceFeedbackFigure()
protected List createSelectionHandles()
SelectionHandlesEditPolicy
createSelectionHandles
in class SelectionHandlesEditPolicy
SelectionHandlesEditPolicy.createSelectionHandles()
public void deactivate()
SelectionEditPolicy
deactivate
in interface EditPolicy
deactivate
in class SelectionEditPolicy
EditPolicy.deactivate()
protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request)
request
- the requestpublic void eraseSourceFeedback(Request request)
AbstractEditPolicy
eraseSourceFeedback
in interface EditPolicy
eraseSourceFeedback
in class AbstractEditPolicy
EditPolicy.eraseSourceFeedback(org.eclipse.gef.Request)
public Command getCommand(Request request)
AbstractEditPolicy
null
by default. null
is used to indicate that the
EditPolicy does not contribute to the specified Request
.
getCommand
in interface EditPolicy
getCommand
in class AbstractEditPolicy
EditPolicy.getCommand(org.eclipse.gef.Request)
protected IFigure getDragSourceFeedbackFigure()
protected Command getAlignCommand(AlignmentRequest request)
request
- the alignment request
protected Command getMoveCommand(ChangeBoundsRequest request)
RequestConstants.REQ_MOVE_CHILDREN
request. The parent's contribution is returned.
request
- the change bounds requesgt
protected Command getOrphanCommand(Request req)
null
is returned to indicate no participation. Orphan requests are not
forwarded to the host's parent here. That is done in ComponentEditPolicy
. So,
if the host has a component editpolicy, then the parent will already have a chance to
contribute.
req
- the orphan request
null
by defaultprotected void hideFocus()
showFocus()
.
hideFocus
in class SelectionEditPolicy
showFocus()
,
SelectionEditPolicy.hideFocus()
protected void showChangeBoundsFeedback(ChangeBoundsRequest request)
request
- the requestprotected void showFocus()
showFocus
in class SelectionEditPolicy
SelectionEditPolicy.showFocus()
public void showSourceFeedback(Request request)
showSourceFeedback
in interface EditPolicy
showSourceFeedback
in class AbstractEditPolicy
EditPolicy.showSourceFeedback(org.eclipse.gef.Request)
public boolean understandsRequest(Request request)
true
for move, align, add, and orphan request types. This method
is never called for some of these types, but they are included for possible future use.
understandsRequest
in interface EditPolicy
understandsRequest
in class AbstractEditPolicy
EditPolicy.understandsRequest(org.eclipse.gef.Request)
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |