Class StampAnnotationWrangler


public class StampAnnotationWrangler extends TextAnnotationWrangler
Manages the creation of stamp annotations.

This class is referenced in annotation profiles by its full classname. It supports parameterization via annotation profiles.

  • Constructor Details

    • StampAnnotationWrangler

      public StampAnnotationWrangler()
  • Method Details

    • calcPos

      protected static Point2D calcPos(StampAnnotation annotation, Point2D positionDocp)
    • getHandles

      public List<? extends Handle> getHandles(PageView pageView, Page page, TextAnnotation annotation)
      Description copied from class: Wrangler
      Creates handles for a specific annotation.
      Overrides:
      getHandles in class TextAnnotationWrangler
      Parameters:
      pageView - PageView the annotation is shown on (for example for repaint calls)
      page - The page that contains the annotation
      annotation - The annotation the wrangler should create handles for
      Returns:
      Handles that can be used to edit the annotation
    • handleCreateEditEvent

      public boolean handleCreateEditEvent(EditEvent e, TextAnnotation annotation)
      Description copied from class: Wrangler
      Invoked during the creation of an annotation.

      Can be invoked multiple times. For example during the creation of a polygon based annotation each mouse down event could indicate a new corner of the polygon at the current mouse position.

      Overrides:
      handleCreateEditEvent in class DefaultWrangler<TextAnnotation>
      Parameters:
      e - an edit event representing a mouse action
      annotation - the new annotation
      Returns:
      true, when the event finishes the annotation creation
    • isSelectionPoint

      public boolean isSelectionPoint(Annotation annotation, Point2D mousePoint, int tolerance, boolean b, int lineWidthFactor)
      Overrides:
      isSelectionPoint in class TextAnnotationWrangler
    • calculateEditorBounds

      protected Rectangle calculateEditorBounds(PageView pageView, Page page, TextAnnotation selected)
      Description copied from class: TextAnnotationWrangler
      Calculates the editor bounds which should be the same size and position as the text annotation. After that the position will be slightly adapted according to the line width of the annotation.
      Overrides:
      calculateEditorBounds in class TextAnnotationWrangler
      Parameters:
      pageView - the PageView containing the Annotation
      page - the page containing the Annotation
      selected - the selected Annotation
      Returns:
      the calculated editor bounds
    • scaleByEditorWidth

      public boolean scaleByEditorWidth()
      Description copied from class: TextAnnotationWrangler
      This can be overriden by any subclass to disable the initial resizing when an annotation is added with a single click.
      Overrides:
      scaleByEditorWidth in class TextAnnotationWrangler