Lines Matching refs:top

28  * represented by the coordinates of its 4 edges (left, top, right bottom).
31 * the coordinates are sorted correctly (i.e. left <= right and top <= bottom).
35 public int top;
50 * top <= bottom.
53 * @param top The Y coordinate of the top of the rectangle
57 public Rect(int left, int top, int right, int bottom) {
59 this.top = top;
73 left = top = right = bottom = 0;
76 top = r.top;
88 return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
94 result = 31 * result + top;
104 sb.append(top); sb.append(" - "); sb.append(right);
123 sb.append(top); sb.append("]["); sb.append(right);
134 * @return Returns a new String of the form "left top right bottom"
142 sb.append(top);
171 pw.print(top); pw.print("]["); pw.print(right);
176 * Returns true if the rectangle is empty (left >= right or top >= bottom)
179 return left >= right || top >= bottom;
192 * (i.e. top <= bottom) so the result may be negative.
195 return bottom - top;
213 return (top + bottom) >> 1;
227 return (top + bottom) * 0.5f;
234 left = right = top = bottom = 0;
240 * left <= right and top <= bottom.
243 * @param top The Y coordinate of the top of the rectangle
247 public void set(int left, int top, int right, int bottom) {
249 this.top = top;
262 this.top = src.top;
269 * adding dy to its top and bottom coordinates.
272 * @param dy The amount to add to the rectangle's top and bottom coordinates
276 top += dy;
282 * Offset the rectangle to a specific (left, top) position,
286 * @param newTop The new "top" coordinate for the rectangle
290 bottom += newTop - top;
292 top = newTop;
299 * for dy and the top and bottom.
302 * @param dy The amount to add(subtract) from the rectangle's top(bottom)
306 top += dy;
312 * Returns true if (x,y) is inside the rectangle. The left and top are
314 * that for a x,y to be contained: left <= x < right and top <= y < bottom.
320 * means left <= x < right and top <= y < bottom
323 return left < right && top < bottom // check for empty first
324 && x >= left && x < right && y >= top && y < bottom;
333 * @param top The top of the rectangle being tested for containment
339 public boolean contains(int left, int top, int right, int bottom) {
341 return this.left < this.right && this.top < this.bottom
343 && this.left <= left && this.top <= top
357 return this.left < this.right && this.top < this.bottom
359 && left <= r.left && top <= r.top && right >= r.right && bottom >= r.bottom;
363 * If the rectangle specified by left,top,right,bottom intersects this
371 * @param top The top of the rectangle being intersected with this rectangle
380 public boolean intersect(int left, int top, int right, int bottom) {
381 if (this.left < right && left < this.right && this.top < bottom && top < this.bottom) {
383 if (this.top < top) this.top = top;
403 return intersect(r.left, r.top, r.right, r.bottom);
419 if (a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom) {
421 top = Math.max(a.top, b.top);
436 * @param top The top of the rectangle being tested for intersection
443 public boolean intersects(int left, int top, int right, int bottom) {
444 return this.left < right && left < this.right && this.top < bottom && top < this.bottom;
458 return a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
467 * @param top The top edge being unioned with this rectangle
471 public void union(int left, int top, int right, int bottom) {
472 if ((left < right) && (top < bottom)) {
473 if ((this.left < this.right) && (this.top < this.bottom)) {
475 if (this.top > top) this.top = top;
480 this.top = top;
495 union(r.left, r.top, r.right, r.bottom);
511 if (y < top) {
512 top = y;
519 * Swap top/bottom or left/right if there are flipped (i.e. left > right
520 * and/or top > bottom). This can be called if
522 * If the edges are already correct (i.e. left <= right and top <= bottom)
531 if (top > bottom) {
532 int temp = top;
533 top = bottom;
552 out.writeInt(top);
583 top = in.readInt();
595 top = (int) (top * scale + 0.5f);