Class LineAnnotationWrangler


public class LineAnnotationWrangler extends DefaultWrangler<LineAnnotation>
  • Constructor Details

    • LineAnnotationWrangler

      public LineAnnotationWrangler()
  • Method Details

    • getHandles

      public List<Handle> getHandles(PageView pageView, Page page, LineAnnotation annotation)
      Description copied from class: Wrangler
      Creates handles for a specific annotation.
      Overrides:
      getHandles in class DefaultWrangler<LineAnnotation>
      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
    • updateCreated

      protected void updateCreated(EditEvent e, LineAnnotation createAnno, Point2D createStart, Point2D createEnd)
      Overrides:
      updateCreated in class DefaultWrangler<LineAnnotation>
    • ensureMinimumLength

      protected void ensureMinimumLength(Point2D start, Point2D end, Grid.SnapTo snapTo, Page page, Grid grid)
    • ensureMinimumLength

      protected void ensureMinimumLength(Point2D start, Point2D end, double minLength, Grid.SnapTo snapTo, Page page, Grid grid)
      Makes sure the line length does not fall below the minimum length by maintaining a minimum distance between the edited point and its opposite.
      Parameters:
      start - the edited point. This is the point which is re-located if needed
      end - the other end of the line
      minLength - defines the maximum length of the line
      snapTo - the Grid.SnapTo used to align the line points to the grid
      page - the current page
      grid - the grid attached to the document
    • setMinimumLineLength

      public void setMinimumLineLength(double minimumLineLength)
      Sets the minimum line length of an annotation in millimeters. Used to inject the value defined in an underlying annotation profile.
      Parameters:
      minimumLineLength - the minimum line length
    • getMinimumLineLength

      public double getMinimumLineLength()
      Returns the minimum line length in millimeters.
      Returns:
      the minimum line length