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
public class ScrollableSelectionFeedbackEditPolicy extends SelectionEditPolicy
ASelectionEditPolicy, which may be registered to anIScrollableEditPartto provide primary selection feedback by rendering the hidden contents of the host figure'sScrollPane's nestedViewportby means ofGhostImageFigures.- 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_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
Constructors Constructor Description ScrollableSelectionFeedbackEditPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Extends activate to hook the appropriate listener and to initialize the visual changes for representing selection/focus.protected voidaddFeedbackFigure(org.eclipse.draw2d.IFigure feedbackFigure, org.eclipse.draw2d.geometry.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 voidcreateConnectionFeedbackFigures()Creates 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 voidcreateNodeFeedbackFigures()Creates the primary layer feedback figures.voiddeactivate()Extends 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 org.eclipse.draw2d.IFiguregetFeedbackLayer()Returns the layer used for displaying feedback.protected org.eclipse.draw2d.ViewportgetHostFigureViewport()Provides access to the host figure'sViewport.protected voidhideFeedback()Removes all feedback figures from the feedback layer as well as from thefeedbackFigureslist.protected voidhideSelection()Override to hide selectionvoidsetAlpha(int alpha)Used to specify the alpha value used for all feedback figures.voidsetHost(EditPart host)Sets the host in which this EditPolicy is installed.protected voidshowFeedback()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.protected voidshowSelection()Override to show selectionprotected voidupdateFeedback()Removes any existing feedback figures by delegating tohideFeedback().-
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, getHostFigure, getLayer, removeFeedback
-
Methods inherited from class org.eclipse.gef.editpolicies.AbstractEditPolicy
debugFeedback, eraseSourceFeedback, eraseTargetFeedback, getCommand, getHost, showSourceFeedback, showTargetFeedback, toString, understandsRequest
-
-
-
-
Method Detail
-
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:
SelectionEditPolicy.activate()
-
addFeedbackFigure
protected void addFeedbackFigure(org.eclipse.draw2d.IFigure feedbackFigure, org.eclipse.draw2d.geometry.Rectangle feedbackFigureAbsoluteBounds)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
protected void createConnectionFeedbackFigure(ConnectionEditPart connectionEditPart)
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
protected void createNodeFeedbackFigure(GraphicalEditPart childEditPart)
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:
SelectionEditPolicy.deactivate()
-
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
protected org.eclipse.draw2d.IFigure getFeedbackLayer()
Description copied from class:GraphicalEditPolicyReturns the layer used for displaying feedback.- Overrides:
getFeedbackLayerin classGraphicalEditPolicy- Returns:
- the feedback layer
- See Also:
GraphicalEditPolicy.getFeedbackLayer()
-
getHostFigureViewport
protected org.eclipse.draw2d.Viewport 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:
SelectionEditPolicy.hideSelection()
-
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
public void setHost(EditPart host)
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:
AbstractEditPolicy.setHost(EditPart)
-
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:
SelectionEditPolicy.showSelection()
-
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().
-
-