java.awt.Rectangle (JDK 1.0)
This class defines a rectangle as the X and Y coordinate of its upper-left corner and a width and height. The instance methods perform various tests and transformations on the rectangle. The x, y, width, and height variables are public and may thus be manipulated directly. Rectangle objects are used in several places in the java.awt package to specify clipping rectangles and bounding boxes.
public classRectangleextends Object implements Shape, Serializable { //Public ConstructorspublicRectangle(); 1.1 publicRectangle(Rectangler); publicRectangle(intx, inty, intwidth, intheight); publicRectangle(intwidth, intheight); publicRectangle(Pointp, Dimensiond); publicRectangle(Pointp); publicRectangle(Dimensiond); //Public Instance Variablespublic intheight; public intwidth; public intx; public inty; //Public Instance Methodspublic voidadd(intnewx, intnewy); public voidadd(Pointpt); public voidadd(Rectangler); 1.1 public booleancontains(Pointp); 1.1 public booleancontains(intx, inty); public booleanequals(Objectobj); //Overrides Object1.1 public RectanglegetBounds(); //From Shape1.1 public PointgetLocation(); 1.1 public DimensiongetSize(); public voidgrow(inth, intv); public inthashCode(); //Overrides Object# public booleaninside(intx, inty); public Rectangleintersection(Rectangler); public booleanintersects(Rectangler); public booleanisEmpty(); # public voidmove(intx, inty); # public voidreshape(intx, inty, intwidth, intheight); # public voidresize(intwidth, intheight); 1.1 public voidsetBounds(Rectangler); 1.1 public voidsetBounds(intx, inty, intwidth, intheight); 1.1 public voidsetLocation(Pointp); 1.1 public voidsetLocation(intx, inty); 1.1 public voidsetSize(Dimensiond); 1.1 public voidsetSize(intwidth, intheight); public StringtoString(); //Overrides Objectpublic voidtranslate(intx, inty); public Rectangle union(Rectangle r); }
Passed To:
Component.setBounds(), GridBagLayout.AdjustForGravity(), PaintEvent(), PaintEvent.setUpdateRect(), PropertyEditor.paintValue(), PropertyEditorSupport.paintValue(), Rectangle(), Rectangle.add(), Rectangle.intersection(), Rectangle.intersects(), Rectangle.setBounds(), Rectangle.union()
Returned By:
Component.bounds(), Component.getBounds(), Graphics.getClipBounds(), Graphics.getClipRect(), PaintEvent.getUpdateRect(), Polygon.getBoundingBox(), Polygon.getBounds(), Rectangle.getBounds(), Rectangle.intersection(), Rectangle.union(), Shape.getBounds()
Type Of:
Polygon.bounds