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;
62 * top <= bottom.
65 * @param top The Y coordinate of the top of the rectangle
69 public Rect(int left, int top, int right, int bottom) {
71 this.top = top;
85 left = top = right = bottom = 0;
88 top = r.top;
100 return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
106 result = 31 * result + top;
116 sb.append(top); sb.append(" - "); sb.append(right);
135 sb.append(top); sb.append("]["); sb.append(right);
146 * @return Returns a new String of the form "left top right bottom"
154 sb.append(top);
183 pw.print(top); pw.print("]["); pw.print(right);
188 * Returns true if the rectangle is empty (left >= right or top >= bottom)
191 return left >= right || top >= bottom;
204 * (i.e. top <= bottom) so the result may be negative.
207 return bottom - top;
225 return (top + bottom) >> 1;
239 return (top + bottom) * 0.5f;
246 left = right = top = bottom = 0;
252 * left <= right and top <= bottom.
255 * @param top The Y coordinate of the top of the rectangle
259 public void set(int left, int top, int right, int bottom) {
261 this.top = top;
274 this.top = src.top;
281 * adding dy to its top and bottom coordinates.
284 * @param dy The amount to add to the rectangle's top and bottom coordinates
288 top += dy;
294 * Offset the rectangle to a specific (left, top) position,
298 * @param newTop The new "top" coordinate for the rectangle
302 bottom += newTop - top;
304 top = newTop;
311 * for dy and the top and bottom.
314 * @param dy The amount to add(subtract) from the rectangle's top(bottom)
318 top += dy;
324 * Returns true if (x,y) is inside the rectangle. The left and top are
326 * that for a x,y to be contained: left <= x < right and top <= y < bottom.
332 * means left <= x < right and top <= y < bottom
335 return left < right && top < bottom // check for empty first
336 && x >= left && x < right && y >= top && y < bottom;
345 * @param top The top of the rectangle being tested for containment
351 public boolean contains(int left, int top, int right, int bottom) {
353 return this.left < this.right && this.top < this.bottom
355 && this.left <= left && this.top <= top
369 return this.left < this.right && this.top < this.bottom
371 && left <= r.left && top <= r.top && right >= r.right && bottom >= r.bottom;
375 * If the rectangle specified by left,top,right,bottom intersects this
383 * @param top The top of the rectangle being intersected with this rectangle
392 public boolean intersect(int left, int top, int right, int bottom) {
393 if (this.left < right && left < this.right && this.top < bottom && top < this.bottom) {
395 if (this.top < top) this.top = top;
415 return intersect(r.left, r.top, r.right, r.bottom);
431 if (a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom) {
433 top = Math.max(a.top, b.top);
448 * @param top The top of the rectangle being tested for intersection
455 public boolean intersects(int left, int top, int right, int bottom) {
456 return this.left < right && left < this.right && this.top < bottom && top < this.bottom;
470 return a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
479 * @param top The top edge being unioned with this rectangle
483 public void union(int left, int top, int right, int bottom) {
484 if ((left < right) && (top < bottom)) {
485 if ((this.left < this.right) && (this.top < this.bottom)) {
487 if (this.top > top) this.top = top;
492 this.top = top;
507 union(r.left, r.top, r.right, r.bottom);
523 if (y < top) {
524 top = y;
531 * Swap top/bottom or left/right if there are flipped (i.e. left > right
532 * and/or top > bottom). This can be called if
534 * If the edges are already correct (i.e. left <= right and top <= bottom)
543 if (top > bottom) {
544 int temp = top;
545 top = bottom;
564 out.writeInt(top);
595 top = in.readInt();
607 top = (int) (top * scale + 0.5f);
620 top = (int) Math.ceil(top * scale);