Class CommonToolHandler

    • Constructor Detail

      • CommonToolHandler

        public CommonToolHandler​(DocumentViewController documentViewController,
                                 AbstractPageViewComponent pageViewComponent)
        Create a new common tool handler. The tool handle can operate on a view or at the page level. If the handler only operates at the view level then pageViewComponent can be set to null;
        Parameters:
        documentViewController - parent view controller
        pageViewComponent - page view component tool acts on, can be null for view tool handlers.
    • Method Detail

      • checkAndApplyPreferences

        protected abstract void checkAndApplyPreferences()
      • getToPageSpaceTransform

        protected AffineTransform getToPageSpaceTransform()
      • convertToPageSpace

        protected Rectangle convertToPageSpace​(Rectangle rect)
        Convert the shapes that make up the annotation to page space so that they will scale correctly at different zooms.
        Parameters:
        rect - rectangle of rectangle to convert to page space.
        Returns:
        transformed bBox.
      • convertToPageSpace

        protected Point2D.Float convertToPageSpace​(Point location)
        Converts the location point from g2d to page space.
        Parameters:
        location - location to convert.
        Returns:
        converted point with Point2D precision.
      • convertToPageSpace

        protected Shape convertToPageSpace​(Shape shape)
        Convert the shapes that make up the annotation to page space so that they will scale correctly at different zooms.
        Parameters:
        shape - shape to convert to page space.
        Returns:
        transformed bBox.
      • convertToPageSpace

        protected Point2D[] convertToPageSpace​(Point... points)
        Converts the given point from g2d space to page space.
        Parameters:
        points - points to convert.
        Returns:
        array of converted points with Point2D precision.