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 anIScrollableEditPart
to provide primary selection feedback by rendering the hidden contents of the host figure'sScrollPane
's nestedViewport
by means ofGhostImageFigure
s.- 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 void
activate()
Extends activate to hook the appropriate listener and to initialize the visual changes for representing selection/focus.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 localfeedbackFigures
list.protected void
createConnectionFeedbackFigure(ConnectionEditPart connectionEditPart)
Creates a ghost image feedback figure for the givenConnectionEditPart
's figure and adds it to the feedback layer.protected void
createConnectionFeedbackFigures()
Creates the connection layer feedback figures.protected void
createNodeFeedbackFigure(GraphicalEditPart childEditPart)
Creates a ghost image feedback figure for the givenGraphicalEditPart
's figure and adds it to the feedback layer.protected void
createNodeFeedbackFigures()
Creates the primary layer feedback figures.void
deactivate()
Extends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus.protected int
getAlpha()
Used to obtain the alpha value used for all feedback figures.protected org.eclipse.draw2d.IFigure
getFeedbackLayer()
Returns the layer used for displaying feedback.protected org.eclipse.draw2d.Viewport
getHostFigureViewport()
Provides access to the host figure'sViewport
.protected void
hideFeedback()
Removes all feedback figures from the feedback layer as well as from thefeedbackFigures
list.protected void
hideSelection()
Override to hide selectionvoid
setAlpha(int alpha)
Used to specify the alpha value used for all feedback figures.void
setHost(EditPart host)
Sets the host in which this EditPolicy is installed.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.protected void
showSelection()
Override to show selectionprotected void
updateFeedback()
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:SelectionEditPolicy
Extends activate to hook the appropriate listener and to initialize the visual changes for representing selection/focus.- Specified by:
activate
in interfaceEditPolicy
- Overrides:
activate
in 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 localfeedbackFigures
list.- 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:SelectionEditPolicy
Extends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus.- Specified by:
deactivate
in interfaceEditPolicy
- Overrides:
deactivate
in 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:GraphicalEditPolicy
Returns the layer used for displaying feedback.- Overrides:
getFeedbackLayer
in 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
Viewport
of the host figure'sScrollPane
-
hideFeedback
protected void hideFeedback()
Removes all feedback figures from the feedback layer as well as from thefeedbackFigures
list.
-
hideSelection
protected void hideSelection()
Description copied from class:SelectionEditPolicy
Override to hide selection- Specified by:
hideSelection
in 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:EditPolicy
Sets the host in which this EditPolicy is installed.- Specified by:
setHost
in interfaceEditPolicy
- Overrides:
setHost
in 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:SelectionEditPolicy
Override to show selection- Specified by:
showSelection
in 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()
.
-
-