Class ToNorthChangeStrategy

  • All Implemented Interfaces:
    Rectangle2DChangeStrategy

    public class ToNorthChangeStrategy
    extends Object
    A strategy which enlarges an existing rectangle to the north.
    • Constructor Detail

      • ToNorthChangeStrategy

        public ToNorthChangeStrategy​(Rectangle2D original,
                                     boolean ratioFixed,
                                     double ratio,
                                     Rectangle2D bounds)
        Creates a new change strategy which enlarges the specified original rectangle to the north. The given ratio is enforced when indicated by ratioFixed.
        Parameters:
        original - the original rectangle
        ratioFixed - indicates whether the rectangle's ratio will be fixed to the ratio
        ratio - the possibly fixed ratio of the rectangle created by this strategy
        bounds - the bounds within which the rectangle can be resized
      • ToNorthChangeStrategy

        public ToNorthChangeStrategy​(Rectangle2D original,
                                     boolean ratioFixed,
                                     double ratio,
                                     double maxX,
                                     double maxY)
        Creates a new change strategy which enlarges the specified original rectangle to the northeast. The given ratio is enforced when indicated by ratioFixed.
        Parameters:
        original - the original rectangle
        ratioFixed - indicates whether the rectangle's ratio will be fixed to the ratio
        ratio - the possibly fixed ratio of the rectangle created by this strategy
        maxX - the maximal x-coordinate of the right edge of the created rectangles; must be greater than or equal to the previous rectangle's width
        maxY - the maximal y-coordinate of the lower edge of the created rectangles; must be greater than or equal to the previous rectangle's height