Lines Matching refs:top

29  * represented by the coordinates of its 4 edges (left, top, right bottom).
32 * the coordinates are sorted correctly (i.e. left <= right and top <= bottom).
36 * into the column and row described by its left and top coordinates, but not
41 public int top;
68 * top <= bottom.
71 * @param top The Y coordinate of the top of the rectangle
75 public Rect(int left, int top, int right, int bottom) {
77 this.top = top;
91 left = top = right = bottom = 0;
94 top = r.top;
106 return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
112 result = 31 * result + top;
122 sb.append(top); sb.append(" - "); sb.append(right);
141 sb.append(top); sb.append("]["); sb.append(right);
152 * @return Returns a new String of the form "left top right bottom"
160 sb.append(top);
189 pw.print(top); pw.print("]["); pw.print(right);
194 * Returns true if the rectangle is empty (left >= right or top >= bottom)
197 return left >= right || top >= bottom;
210 * (i.e. top <= bottom) so the result may be negative.
213 return bottom - top;
231 return (top + bottom) >> 1;
245 return (top + bottom) * 0.5f;
252 left = right = top = bottom = 0;
258 * left <= right and top <= bottom.
261 * @param top The Y coordinate of the top of the rectangle
265 public void set(int left, int top, int right, int bottom) {
267 this.top = top;
280 this.top = src.top;
287 * adding dy to its top and bottom coordinates.
290 * @param dy The amount to add to the rectangle's top and bottom coordinates
294 top += dy;
300 * Offset the rectangle to a specific (left, top) position,
304 * @param newTop The new "top" coordinate for the rectangle
308 bottom += newTop - top;
310 top = newTop;
317 * for dy and the top and bottom.
320 * @param dy The amount to add(subtract) from the rectangle's top(bottom)
324 top += dy;
337 top += insets.top;
346 * @param top The amount to add from the rectangle's top
350 public void inset(int left, int top, int right, int bottom) {
352 this.top += top;
358 * Returns true if (x,y) is inside the rectangle. The left and top are
360 * that for a x,y to be contained: left <= x < right and top <= y < bottom.
366 * means left <= x < right and top <= y < bottom
369 return left < right && top < bottom // check for empty first
370 && x >= left && x < right && y >= top && y < bottom;
379 * @param top The top of the rectangle being tested for containment
385 public boolean contains(int left, int top, int right, int bottom) {
387 return this.left < this.right && this.top < this.bottom
389 && this.left <= left && this.top <= top
403 return this.left < this.right && this.top < this.bottom
405 && left <= r.left && top <= r.top && right >= r.right && bottom >= r.bottom;
409 * If the rectangle specified by left,top,right,bottom intersects this
417 * @param top The top of the rectangle being intersected with this rectangle
427 public boolean intersect(int left, int top, int right, int bottom) {
428 if (this.left < right && left < this.right && this.top < bottom && top < this.bottom) {
430 if (this.top < top) this.top = top;
451 return intersect(r.left, r.top, r.right, r.bottom);
468 if (a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom) {
470 top = Math.max(a.top, b.top);
485 * @param top The top of the rectangle being tested for intersection
492 public boolean intersects(int left, int top, int right, int bottom) {
493 return this.left < right && left < this.right && this.top < bottom && top < this.bottom;
507 return a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
516 * @param top The top edge being unioned with this rectangle
520 public void union(int left, int top, int right, int bottom) {
521 if ((left < right) && (top < bottom)) {
522 if ((this.left < this.right) && (this.top < this.bottom)) {
524 if (this.top > top) this.top = top;
529 this.top = top;
544 union(r.left, r.top, r.right, r.bottom);
560 if (y < top) {
561 top = y;
568 * Swap top/bottom or left/right if there are flipped (i.e. left > right
569 * and/or top > bottom). This can be called if
571 * If the edges are already correct (i.e. left <= right and top <= bottom)
580 if (top > bottom) {
581 int temp = top;
582 top = bottom;
601 out.writeInt(top);
632 top = in.readInt();
644 top = (int) (top * scale + 0.5f);