Class CropTool

    • Field Detail

      • MODE_DEFAULT

        protected static int MODE_DEFAULT
        Mode Default
      • MODE_DRAW

        protected static int MODE_DRAW
      • MODE_MOVE

        protected static int MODE_MOVE
      • area

        protected Area area
      • cropArea

        protected Area cropArea
      • dimArea

        protected Area dimArea
      • mode

        protected int mode
      • startX

        protected int startX
      • startY

        protected int startY
      • newX

        protected int newX
      • newY

        protected int newY
    • Constructor Detail

      • CropTool

        public CropTool()
        Creates a new instance of CropTool
    • Method Detail

      • startTool

        public void startTool​(FXCanvas canvas)
        Description copied from class: AbstractTool
        Overidden to register input listener. Inherited tool please do not forget to call super
        Specified by:
        startTool in interface FXTool
        Overrides:
        startTool in class AbstractTool
      • createArea

        protected Area createArea()
      • updateArea

        protected void updateArea()
      • createResizeTransform

        protected AffineTransform createResizeTransform​(AffineTransform at)
        Create Resize transform into "return value" at and return at. If at is null a new AffineTransform is allocated. This is useful if the caller wants to avoid allocating a new AffineTransform object on the heap.
        Parameters:
        at - AffneTransform or null
        Returns:
        if at is null return a newly created AffineTransform
      • createMoveTransform

        protected AffineTransform createMoveTransform​(AffineTransform at)
        Create Move Transform into "return value" at and return at. If at is null a new AffineTransform is allocated. This is useful if the caller wants to avoid allocating a new AffineTransform object on the heap.
        Parameters:
        at - AffineTransform or null
        Returns:
        if at is null return a newly created AffineTransform
      • cropAreaContains

        protected boolean cropAreaContains​(Point2D point,
                                           boolean needTransform)
        Check whether the supplied point is inside Crop Area
        Parameters:
        point - Point2D to check
        needTransform - if true transfrom the supplied point into cropArea space
        Returns:
        true or false