Class DefaultGraphicalFeedbackFactory

java.lang.Object
org.csstudio.opibuilder.feedback.DefaultGraphicalFeedbackFactory
All Implemented Interfaces:
IGraphicalFeedbackFactory
Direct Known Subclasses:
ArrayFeedbackFactory, GroupingContainerFeedbackFactory

public class DefaultGraphicalFeedbackFactory extends Object implements IGraphicalFeedbackFactory
A default implementation of IGraphicalFeedbackFactory which does nothing to changing default graphical feedback behavior. Subclass can override this class to create customized feedback behavior.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.eclipse.gef.commands.Command
    createChangeBoundsCommand(AbstractWidgetModel widgetModel, org.eclipse.gef.requests.ChangeBoundsRequest request, org.eclipse.draw2d.geometry.Rectangle targetBounds)
    Returns a command, which handles the size and location changes, implied by the change bounds request and the target bounds.
    List<org.eclipse.gef.Handle>
    createCustomHandles(org.eclipse.gef.GraphicalEditPart editPart)
    Creates and returns custom handles Handle for the specified edit part.
    org.eclipse.draw2d.IFigure
    createDragSourceFeedbackFigure(AbstractWidgetModel model, org.eclipse.draw2d.geometry.Rectangle initalBounds)
    The returned figure will be used to provide graphical feedback during drag or resize operations.
    org.eclipse.gef.commands.Command
    createInitialBoundsCommand(AbstractWidgetModel widgetModel, org.eclipse.gef.requests.CreateRequest request, org.eclipse.draw2d.geometry.Rectangle targetBounds)
    Returns a command, which handles the initial size and location during the creation of new widget models.
    org.eclipse.draw2d.Shape
    createSizeOnDropFeedback(org.eclipse.gef.requests.CreateRequest createRequest)
    The returned figure will be used to provide graphical feedback during the creation of new widget models.
    Gets the class type of a custom creation tool for the kind of objects, this factory is responsible for.
    void
    showChangeBoundsFeedback(AbstractWidgetModel widgetModel, org.eclipse.draw2d.geometry.PrecisionRectangle bounds, org.eclipse.draw2d.IFigure feedbackFigure, org.eclipse.gef.requests.ChangeBoundsRequest request)
    This method will be called, when the size or location of the feedback changes during drag or resize operations.
    void
    showSizeOnDropFeedback(org.eclipse.gef.requests.CreateRequest request, org.eclipse.draw2d.IFigure feedback, org.eclipse.draw2d.geometry.Insets insets)
    This method will be called, when the size or location of the feedback changes during the creation process.The specified figure equals the figure, which is created by IGraphicalFeedbackFactory.createSizeOnDropFeedback(CreateRequest).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultGraphicalFeedbackFactory

      public DefaultGraphicalFeedbackFactory()
  • Method Details

    • createDragSourceFeedbackFigure

      public org.eclipse.draw2d.IFigure createDragSourceFeedbackFigure(AbstractWidgetModel model, org.eclipse.draw2d.geometry.Rectangle initalBounds)
      Description copied from interface: IGraphicalFeedbackFactory
      The returned figure will be used to provide graphical feedback during drag or resize operations.
      Specified by:
      createDragSourceFeedbackFigure in interface IGraphicalFeedbackFactory
      Parameters:
      model - the widget model
      initalBounds - the initial bounds
      Returns:
      a customized feedback figure during draging, null if not necessary.
    • showChangeBoundsFeedback

      public void showChangeBoundsFeedback(AbstractWidgetModel widgetModel, org.eclipse.draw2d.geometry.PrecisionRectangle bounds, org.eclipse.draw2d.IFigure feedbackFigure, org.eclipse.gef.requests.ChangeBoundsRequest request)
      Description copied from interface: IGraphicalFeedbackFactory
      This method will be called, when the size or location of the feedback changes during drag or resize operations. The specified figure equals the figure, which is created by the IGraphicalFeedbackFactory.createDragSourceFeedbackFigure(AbstractWidgetModel, Rectangle). Implementors should apply the changed bounds to their individual feedback figure.
      Specified by:
      showChangeBoundsFeedback in interface IGraphicalFeedbackFactory
      Parameters:
      widgetModel - the corresponding widget model
      bounds - the new bounds
      feedbackFigure - the current feedback figure
      request - the change request
    • createSizeOnDropFeedback

      public org.eclipse.draw2d.Shape createSizeOnDropFeedback(org.eclipse.gef.requests.CreateRequest createRequest)
      Description copied from interface: IGraphicalFeedbackFactory
      The returned figure will be used to provide graphical feedback during the creation of new widget models.
      Specified by:
      createSizeOnDropFeedback in interface IGraphicalFeedbackFactory
      Parameters:
      createRequest - the create request
      Returns:
      a customized droop feedback figure, null if it is not necessary.
    • showSizeOnDropFeedback

      public void showSizeOnDropFeedback(org.eclipse.gef.requests.CreateRequest request, org.eclipse.draw2d.IFigure feedback, org.eclipse.draw2d.geometry.Insets insets)
      Description copied from interface: IGraphicalFeedbackFactory
      This method will be called, when the size or location of the feedback changes during the creation process.The specified figure equals the figure, which is created by IGraphicalFeedbackFactory.createSizeOnDropFeedback(CreateRequest).
      Specified by:
      showSizeOnDropFeedback in interface IGraphicalFeedbackFactory
      Parameters:
      request - the create request
      feedback - the current feedback figure
      insets - any insets that need to be applied to the creation feedback's bounds
    • getCreationTool

      public Class<?> getCreationTool()
      Description copied from interface: IGraphicalFeedbackFactory
      Gets the class type of a custom creation tool for the kind of objects, this factory is responsible for.
      Specified by:
      getCreationTool in interface IGraphicalFeedbackFactory
      Returns:
      the class type of a custom creation tool or null, if the default creation tool should be used
    • createChangeBoundsCommand

      public org.eclipse.gef.commands.Command createChangeBoundsCommand(AbstractWidgetModel widgetModel, org.eclipse.gef.requests.ChangeBoundsRequest request, org.eclipse.draw2d.geometry.Rectangle targetBounds)
      Description copied from interface: IGraphicalFeedbackFactory
      Returns a command, which handles the size and location changes, implied by the change bounds request and the target bounds.
      Specified by:
      createChangeBoundsCommand in interface IGraphicalFeedbackFactory
      Parameters:
      widgetModel - the affected widget model
      request - a change bounds request (may contain extended data, when a custom creation tool (see IGraphicalFeedbackFactory.getCreationTool()) or custom handles (IGraphicalFeedbackFactory.createCustomHandles(GraphicalEditPart)) are used.
      targetBounds - the new bounds
      Returns:
      a undoable command, which handles the size and location changes, null if default change bounds command should be used.
    • createInitialBoundsCommand

      public org.eclipse.gef.commands.Command createInitialBoundsCommand(AbstractWidgetModel widgetModel, org.eclipse.gef.requests.CreateRequest request, org.eclipse.draw2d.geometry.Rectangle targetBounds)
      Description copied from interface: IGraphicalFeedbackFactory
      Returns a command, which handles the initial size and location during the creation of new widget models.
      Specified by:
      createInitialBoundsCommand in interface IGraphicalFeedbackFactory
      Parameters:
      widgetModel - the created widget model
      request - the create request (may contain extended data, when a custom creation tool (see IGraphicalFeedbackFactory.getCreationTool()) is used
      targetBounds - the initial bounds
      Returns:
      a undoable command, which sets up the initial size and location changes. null if it is not necessary to initialize size and location.
    • createCustomHandles

      public List<org.eclipse.gef.Handle> createCustomHandles(org.eclipse.gef.GraphicalEditPart editPart)
      Description copied from interface: IGraphicalFeedbackFactory
      Creates and returns custom handles Handle for the specified edit part.
      Specified by:
      createCustomHandles in interface IGraphicalFeedbackFactory
      Parameters:
      editPart - the edit part
      Returns:
      a list, which contains all custom handles or null, if no custom handles should be created