Class GraphicalEditPolicy

java.lang.Object
org.eclipse.gef.editpolicies.AbstractEditPolicy
org.eclipse.gef.editpolicies.GraphicalEditPolicy
All Implemented Interfaces:
EditPolicy, RequestConstants
Direct Known Subclasses:
DirectEditPolicy, GraphicalNodeEditPolicy, LayoutEditPolicy, SelectionEditPolicy, SnapFeedbackPolicy

public abstract class GraphicalEditPolicy extends AbstractEditPolicy
A GraphicalEditPolicy is used with a GraphicalEditPart. All GraphicalEditPolicies are involved with the Figure in some way. They might use the Figure to interpret Requests, or they might simply decorate the Figure with graphical Feedback, such as selection handles.

This class provides convenience methods for accessing the host's Figure, and for adding feedback to the GraphicalViewer. This class does not handle any Request types directly.

  • Constructor Details

    • GraphicalEditPolicy

      public GraphicalEditPolicy()
  • Method Details

    • addFeedback

      protected void addFeedback(org.eclipse.draw2d.IFigure figure)
      Adds the specified Figure to the LayerConstants.FEEDBACK_LAYER.
      Parameters:
      figure - the feedback to add
    • getFeedbackLayer

      protected org.eclipse.draw2d.IFigure getFeedbackLayer()
      Returns the layer used for displaying feedback.
      Returns:
      the feedback layer
    • getHostFigure

      protected org.eclipse.draw2d.IFigure getHostFigure()
      Convenience method to return the host's Figure.
      Returns:
      The host GraphicalEditPart's Figure
    • getLayer

      protected org.eclipse.draw2d.IFigure getLayer(Object layer)
      Obtains the specified layer.
      Parameters:
      layer - the key identifying the layer
      Returns:
      the requested layer
    • removeFeedback

      protected void removeFeedback(org.eclipse.draw2d.IFigure figure)
      Removes the specified Figure from the LayerConstants.FEEDBACK_LAYER.
      Parameters:
      figure - the feedback to remove