Class ChangeViewportOperation

    • Constructor Detail

      • ChangeViewportOperation

        public ChangeViewportOperation​(InfiniteCanvas canvas,
                                       AffineTransform newContentTransform)
        Creates a new ChangeViewportOperation to manipulate the given InfiniteCanvas. The current viewport values are read and used when undoing this operation. The given AffineTransform will be applied when executing this operation.
        Parameters:
        canvas - The InfiniteCanvas that is manipulated.
        newContentTransform - The contents transformation which is applied when executing this operation.
      • ChangeViewportOperation

        public ChangeViewportOperation​(InfiniteCanvas canvas,
                                       double newHorizontalScrollOffset,
                                       double newVerticalScrollOffset)
        Creates a new ChangeViewportOperation to manipulate the given InfiniteCanvas. The current viewport values are read and used when undoing this operation. The given translation values will be applied when executing this operation.
        Parameters:
        canvas - The InfiniteCanvas that is manipulated.
        newHorizontalScrollOffset - The horizontal translation that is applied when executing this operation.
        newVerticalScrollOffset - The vertical translation that is applied when executing this operation.
      • ChangeViewportOperation

        public ChangeViewportOperation​(InfiniteCanvas canvas,
                                       double newHorizontalScrollOffset,
                                       double newVerticalScrollOffset,
                                       AffineTransform newContentTransform)
        Creates a new ChangeViewportOperation to manipulate the given InfiniteCanvas. The current viewport values are read and used when undoing this operation. The given translation values and contents transformation will be applied when executing this operation.
        Parameters:
        canvas - The InfiniteCanvas that is manipulated.
        newHorizontalScrollOffset - The horizontal translation that is applied when executing this operation.
        newVerticalScrollOffset - The vertical translation that is applied when executing this operation.
        newContentTransform - The contents transformation which is applied when executing this operation.
      • ChangeViewportOperation

        public ChangeViewportOperation​(InfiniteCanvas canvas,
                                       double newHorizontalScrollOffset,
                                       double newVerticalScrollOffset,
                                       double newWidth,
                                       double newHeight,
                                       AffineTransform newContentTransform)
        Creates a new ChangeViewportOperation to manipulate the given InfiniteCanvas. The current viewport values are read and used when undoing this operation. The given translation values, dimensions, and contents transformation will be applied when executing this operation.
        Parameters:
        canvas - The InfiniteCanvas that is manipulated.
        newHorizontalScrollOffset - The horizontal translation that is applied when executing this operation.
        newVerticalScrollOffset - The vertical translation that is applied when executing this operation.
        newWidth - The viewport width that is applied when executing this operation.
        newHeight - The viewport height that is applied when executing this operation.
        newContentTransform - The contents transformation which is applied when executing this operation.
    • Method Detail

      • concatenateToNewContentTransform

        public void concatenateToNewContentTransform​(AffineTransform t)
        Concatenates the given AffineTransform to the contents transformation that will be applied when executing this operation.
        Parameters:
        t - The AffineTransform which is concatenated to the transformation that will be applied when executing this operation.
      • getInitialContentTransform

        public AffineTransform getInitialContentTransform()
        Returns the contents transformation that will be applied when undoing this operation.
        Returns:
        The contents transformation that will be applied when undoing this operation.
      • getInitialHeight

        public double getInitialHeight()
        Returns the viewport height that will be applied when undoing this operation.
        Returns:
        The viewport height that will be applied when undoing this operation.
      • getInitialHorizontalScrollOffset

        public double getInitialHorizontalScrollOffset()
        Returns the horizontal translation that will be applied when undoing this operation.
        Returns:
        The horizontal translation that will be applied when undoing this operation.
      • getInitialVerticalScrollOffset

        public double getInitialVerticalScrollOffset()
        Returns the vertical translation that will be applied when undoing this operation.
        Returns:
        The vertical translation that will be applied when undoing this operation.
      • getInitialWidth

        public double getInitialWidth()
        Returns the viewport width that will be applied when undoing this operation.
        Returns:
        The viewport width that will be applied when undoing this operation.
      • getNewContentTransform

        public AffineTransform getNewContentTransform()
        Returns the contents transformation that will be applied when executing this operation.
        Returns:
        The contents transformation that will be applied when executing this operation.
      • getNewHeight

        public double getNewHeight()
        Returns the viewport height that will be applied when executing this operation.
        Returns:
        The viewport height that will be applied when executing this operation.
      • getNewHorizontalScrollOffset

        public double getNewHorizontalScrollOffset()
        Returns the horizontal translation that will be applied when executing this operation.
        Returns:
        The horizontal translation that will be applied when executing this operation.
      • getNewVerticalScrollOffset

        public double getNewVerticalScrollOffset()
        Returns the vertical translation that will be applied when executing this operation.
        Returns:
        The vertical translation that will be applied when executing this operation.
      • getNewWidth

        public double getNewWidth()
        Returns the viewport width that will be applied when executing this operation.
        Returns:
        The viewport width that will be applied when executing this operation.
      • readViewport

        protected void readViewport​(InfiniteCanvas canvas)
        Stores all relevant viewport values in fields, so that they can be restored later.
        Parameters:
        canvas - The InfiniteCanvas from which the values are read.
      • setInitialContentTransform

        public void setInitialContentTransform​(AffineTransform initialContentTransform)
        Sets the initial content transform before applying the new value.
        Parameters:
        initialContentTransform - The initialContentTransform to set.
      • setInitialHeight

        public void setInitialHeight​(double initialHeight)
        Sets the initial height before applying the new value.
        Parameters:
        initialHeight - The initialHeight to set.
      • setInitialHorizontalScrollOffset

        public void setInitialHorizontalScrollOffset​(double initialHorizontalScrollOffset)
        Sets the initial horizontal scroll offset before applying the new value.
        Parameters:
        initialHorizontalScrollOffset - The initialHorizontalScrollOffset to set.
      • setInitialVerticalScrollOffset

        public void setInitialVerticalScrollOffset​(double initialVerticalScrollOffset)
        Sets the initial vertical scroll offset before applying the new value.
        Parameters:
        initialVerticalScrollOffset - The initialVerticalScrollOffset to set.
      • setInitialWidth

        public void setInitialWidth​(double initialWidth)
        Sets the initial width before applying the new value.
        Parameters:
        initialWidth - The initialWidth to set.
      • setNewContentTransform

        public void setNewContentTransform​(AffineTransform newContentTransform)
        Sets the contents transformation that will be applied when executing this operation to the given value.
        Parameters:
        newContentTransform - The contents transformation to apply when executing this operation.
      • setNewHeight

        public void setNewHeight​(double newHeight)
        Sets the viewport height that will be applied when executing this operation to the given value.
        Parameters:
        newHeight - The viewport height to apply when executing this operation.
      • setNewHorizontalScrollOffset

        public void setNewHorizontalScrollOffset​(double newHorizontalScrollOffset)
        Sets the horizontal translation that will be applied when executing this operation to the given value.
        Parameters:
        newHorizontalScrollOffset - The horizontal translation to apply when executing this operation.
      • setNewVerticalScrollOffset

        public void setNewVerticalScrollOffset​(double newVerticalScrollOffset)
        Sets the vertical translation that will be applied when executing this operation to the given value.
        Parameters:
        newVerticalScrollOffset - The vertical translation to apply when executing this operation.
      • setNewWidth

        public void setNewWidth​(double newWidth)
        Sets the viewport width that will be applied when executing this operation to the given value.
        Parameters:
        newWidth - The viewport width to apply when executing this operation.