Class Rect

java.lang.Object
cn.mapway.ui.client.mvc.Rect
All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable, Serializable

public class Rect extends Object implements Serializable, com.google.gwt.user.client.rpc.IsSerializable
See Also:
  • Field Details

    • x

      public double x
    • y

      public double y
    • width

      public double width
    • height

      public double height
  • Constructor Details

    • Rect

      public Rect()
    • Rect

      public Rect(double x, double y, double width, double height)
  • Method Details

    • getSize

      public Size getSize()
    • getXAsInt

      public int getXAsInt()
    • getYAsInt

      public int getYAsInt()
    • getWidthAsInt

      public int getWidthAsInt()
    • getHeightAsInt

      public int getHeightAsInt()
    • toString

      public final String toString()
      output json format
      Overrides:
      toString in class Object
      Returns:
    • offset

      public final Rect offset(double dx, double dy)
    • expand

      public final Rect expand(double top, double right, double bottom, double left)
    • getCenter

      public final Size getCenter()
    • clone

      public final Rect clone()
      Overrides:
      clone in class Object
    • contains

      public final boolean contains(Size point)
    • contains

      public final boolean contains(double x, double y)
    • extend

      public final Rect extend(double x, double y)
    • extend

      public final Rect extend(Rect box)
    • shrink

      public final Rect shrink(double left, double top, double right, double bottom)
    • normalize

      public final Rect normalize()
      正交化对象
    • intersect

      public final boolean intersect(Rect box)
    • copyFrom

      public final Rect copyFrom(Rect src)
    • copyTo

      public final Rect copyTo(Rect dest)
    • getX

      public final double getX()
    • setX

      public final void setX(double x)
    • getY

      public final double getY()
    • setY

      public final void setY(double y)
    • getWidth

      public final double getWidth()
    • setWidth

      public final Rect setWidth(double width)
    • getHeight

      public final double getHeight()
    • setHeight

      public final Rect setHeight(double height)
    • set

      public final Rect set(double startX, double startY, double width, double height)
    • snapToGrid

      public Rect snapToGrid(int gridSize)