Package 

Class BlockRectangle

  • All Implemented Interfaces:
    java.awt.Shape , java.io.Serializable , java.lang.Cloneable , java.lang.Comparable

    
    public class BlockRectangle
    extends Rectangle implements Comparable<BlockRectangle>
                        

    Created by vincent on 16-6-15. the screen coordinate system: 0------\>x | | * v y the coordinate of the star is (x, y)

    • Method Summary

      Modifier and Type Method Description
      static BlockRectangle parse(String simpleString) parse.
      static int alignToGrid(int n, int windowSize) Align to grid
      double getLeft() getLeft.
      double getTop() getTop.
      double getArea() getArea.
      void setWidth(int w) setWidth.
      void setHeight(int h) setHeight.
      BlockRectangle clone() clone.
      BlockRectangle trim(int windowSize) trim.
      BlockRectangle trim(int windowSize, int windowSize2) trim.
      BlockRectangle trim(int windowSize, int windowSize2, int windowSize3) trim.
      BlockRectangle trim(int xGrid, int yGrid, int wGrid, int hGrid) trim.
      BlockRectangle trim(BlockRectangle grid) trim.
      BlockRectangle trimAll(int windowSize) trimAll.
      int compareTo(@Nonnull() BlockRectangle blockRectangle)
      boolean equals(Object obj)
      String format() format.
      String toStyle() toStyle.
      String toString()
      • Methods inherited from class java.awt.Rectangle

        add, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setLocation, setRect, setSize, toString, translate, union
      • Methods inherited from class java.awt.geom.Rectangle2D

        getPathIterator, hashCode, intersect, intersectsLine, setFrame, union
      • Methods inherited from class java.awt.geom.RectangularShape

        clone, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, setFrameFromCenter, setFrameFromDiagonal
      • Methods inherited from class java.lang.Comparable

        compareTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BlockRectangle

        BlockRectangle()
        Constructor for BlockRectangle.
      • BlockRectangle

        BlockRectangle(int left, int top)
        Constructor for BlockRectangle.
        Parameters:
        left - a int.
        top - a int.
      • BlockRectangle

        BlockRectangle(int left, int top, int width, int height)
        Constructor for BlockRectangle.
        Parameters:
        left - a int.
        top - a int.
        width - a int.
        height - a int.
      • BlockRectangle

        BlockRectangle(double left, double top, double width, double height)
        Constructor for BlockRectangle.
        Parameters:
        left - a double.
        top - a double.
        width - a double.
        height - a double.
      • BlockRectangle

        BlockRectangle(Point pos)
        Constructor for BlockRectangle.
        Parameters:
        pos - a java.awt.Point object.