Package org.eclipse.gef.editpolicies
Class ScrollableSelectionFeedbackEditPolicy
java.lang.Object
org.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.GraphicalEditPolicy
org.eclipse.gef.editpolicies.SelectionEditPolicy
org.eclipse.gef.editpolicies.ScrollableSelectionFeedbackEditPolicy
- All Implemented Interfaces:
EditPolicy,RequestConstants
A
SelectionEditPolicy, which may be registered to an
IScrollableEditPart to provide primary selection feedback by
rendering the hidden contents of the host figure's ScrollPane's
nested Viewport by means of GhostImageFigures.- Since:
- 3.6
-
Field Summary
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_ROLEFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Extends activate to hook the appropriate listener and to initialize the visual changes for representing selection/focus.protected voidaddFeedbackFigure(IFigure feedbackFigure, Rectangle feedbackFigureAbsoluteBounds) Adds a given feedback figure to the feedback layer (using the provided bounds to layout it) and registers it in the localfeedbackFigureslist.protected voidcreateConnectionFeedbackFigure(ConnectionEditPart connectionEditPart) Creates a ghost image feedback figure for the givenConnectionEditPart's figure and adds it to the feedback layer.protected voidCreates the connection layer feedback figures.protected voidcreateNodeFeedbackFigure(GraphicalEditPart childEditPart) Creates a ghost image feedback figure for the givenGraphicalEditPart's figure and adds it to the feedback layer.protected voidCreates the primary layer feedback figures.voidExtends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus.protected intgetAlpha()Used to obtain the alpha value used for all feedback figures.protected IFigureReturns the layer used for displaying feedback.protected ViewportProvides access to the host figure'sViewport.protected voidRemoves all feedback figures from the feedback layer as well as from thefeedbackFigureslist.protected voidOverride to hide selectionvoidsetAlpha(int alpha) Used to specify the alpha value used for all feedback figures.voidSets the host in which this EditPolicy is installed.protected voidCreates feedback figures for all node figures nested within the host figure's viewport, as well as for all incoming and outgoing connections of these nodes.protected voidOverride to show selectionprotected voidRemoves any existing feedback figures by delegating tohideFeedback().Methods inherited from class org.eclipse.gef.editpolicies.SelectionEditPolicy
addSelectionListener, getTargetEditPart, hideFocus, removeSelectionListener, setFocus, setSelectedState, showFocus, showPrimarySelectionMethods inherited from class org.eclipse.gef.editpolicies.GraphicalEditPolicy
addFeedback, getHost, getHostFigure, getLayer, removeFeedbackMethods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy
debugFeedback, eraseSourceFeedback, eraseTargetFeedback, getCommand, showSourceFeedback, showTargetFeedback, toString, understandsRequest
-
Constructor Details
-
ScrollableSelectionFeedbackEditPolicy
public ScrollableSelectionFeedbackEditPolicy()
-
-
Method Details
-
activate
public void activate()Description copied from class:SelectionEditPolicyExtends activate to hook the appropriate listener and to initialize the visual changes for representing selection/focus.- Specified by:
activatein interfaceEditPolicy- Overrides:
activatein classSelectionEditPolicy- See Also:
-
addFeedbackFigure
Adds a given feedback figure to the feedback layer (using the provided bounds to layout it) and registers it in the localfeedbackFigureslist.- Parameters:
feedbackFigure- the feedback figure to add to the feedback layerfeedbackFigureAbsoluteBounds- the absolute bounds used to layout the feedback figure
-
createConnectionFeedbackFigure
Creates a ghost image feedback figure for the givenConnectionEditPart's figure and adds it to the feedback layer.- Parameters:
connectionEditPart-
-
createConnectionFeedbackFigures
protected void createConnectionFeedbackFigures()Creates the connection layer feedback figures. -
createNodeFeedbackFigure
Creates a ghost image feedback figure for the givenGraphicalEditPart's figure and adds it to the feedback layer.- Parameters:
childEditPart-
-
createNodeFeedbackFigures
protected void createNodeFeedbackFigures()Creates the primary layer feedback figures. -
deactivate
public void deactivate()Description copied from class:SelectionEditPolicyExtends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus.- Specified by:
deactivatein interfaceEditPolicy- Overrides:
deactivatein classSelectionEditPolicy- See Also:
-
getAlpha
protected int getAlpha()Used to obtain the alpha value used for all feedback figures. The valid range is the one documented forGraphics.setAlpha(int).- Returns:
- the alpha
-
getFeedbackLayer
Description copied from class:GraphicalEditPolicyReturns the layer used for displaying feedback.- Overrides:
getFeedbackLayerin classGraphicalEditPolicy- Returns:
- the feedback layer
- See Also:
-
getHostFigureViewport
Provides access to the host figure'sViewport.- Returns:
- the nested
Viewportof the host figure'sScrollPane
-
hideFeedback
protected void hideFeedback()Removes all feedback figures from the feedback layer as well as from thefeedbackFigureslist. -
hideSelection
protected void hideSelection()Description copied from class:SelectionEditPolicyOverride to hide selection- Specified by:
hideSelectionin classSelectionEditPolicy- See Also:
-
setAlpha
public void setAlpha(int alpha) Used to specify the alpha value used for all feedback figures. The valid range is the one documented forGraphics.setAlpha(int).- Parameters:
alpha-
-
setHost
Description copied from interface:EditPolicySets the host in which this EditPolicy is installed.- Specified by:
setHostin interfaceEditPolicy- Overrides:
setHostin classAbstractEditPolicy- Parameters:
host- the host EditPart- See Also:
-
showFeedback
protected void showFeedback()Creates feedback figures for all node figures nested within the host figure's viewport, as well as for all incoming and outgoing connections of these nodes. Feedback figures are only created in case there are children or connections, which are not fully visible. -
showSelection
protected void showSelection()Description copied from class:SelectionEditPolicyOverride to show selection- Specified by:
showSelectionin classSelectionEditPolicy- See Also:
-
updateFeedback
protected void updateFeedback()Removes any existing feedback figures by delegating tohideFeedback(). In case the host edit part is the primary selection, recreates feedback figures viashowFeedback().
-