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 top = r.top;
82 return left == r.left && top == r.top && right == r.right
92 sb.append(top); sb.append(" - "); sb.append(right);
111 sb.append(top); sb.append("]["); sb.append(right);
122 * @return Returns a new String of the form "left top right bottom"
130 sb.append(top);
159 pw.print(top); pw.print("]["); pw.print(right);
164 * Returns true if the rectangle is empty (left >= right or top >= bottom)
167 return left >= right || top >= bottom;
180 * (i.e. top <= bottom) so the result may be negative.
183 return bottom - top;
201 return (top + bottom) >> 1;
215 return (top + bottom) * 0.5f;
222 left = right = top = bottom = 0;
228 * left <= right and top <= bottom.
231 * @param top The Y coordinate of the top of the rectangle
235 public void set(int left, int top, int right, int bottom) {
237 this.top = top;
250 this.top = src.top;
257 * adding dy to its top and bottom coordinates.
260 * @param dy The amount to add to the rectangle's top and bottom coordinates
264 top += dy;
270 * Offset the rectangle to a specific (left, top) position,
274 * @param newTop The new "top" coordinate for the rectangle
278 bottom += newTop - top;
280 top = newTop;
287 * for dy and the top and bottom.
290 * @param dy The amount to add(subtract) from the rectangle's top(bottom)
294 top += dy;
300 * Returns true if (x,y) is inside the rectangle. The left and top are
302 * that for a x,y to be contained: left <= x < right and top <= y < bottom.
308 * means left <= x < right and top <= y < bottom
311 return left < right && top < bottom // check for empty first
312 && x >= left && x < right && y >= top && y < bottom;
321 * @param top The top of the rectangle being tested for containment
327 public boolean contains(int left, int top, int right, int bottom) {
329 return this.left < this.right && this.top < this.bottom
331 && this.left <= left && this.top <= top
345 return this.left < this.right && this.top < this.bottom
347 && left <= r.left && top <= r.top
352 * If the rectangle specified by left,top,right,bottom intersects this
360 * @param top The top of the rectangle being intersected with this rectangle
369 public boolean intersect(int left, int top, int right, int bottom) {
371 && this.top < bottom && top < this.bottom) {
375 if (this.top < top) {
376 this.top = top;
401 return intersect(r.left, r.top, r.right, r.bottom);
418 && a.top < b.bottom && b.top < a.bottom) {
420 top = Math.max(a.top, b.top);
435 * @param top The top of the rectangle being tested for intersection
442 public boolean intersects(int left, int top, int right, int bottom) {
444 && this.top < bottom && top < this.bottom;
459 && a.top < b.bottom && b.top < a.bottom;
468 * @param top The top edge being unioned with this rectangle
472 public void union(int left, int top, int right, int bottom) {
473 if ((left < right) && (top < bottom)) {
474 if ((this.left < this.right) && (this.top < this.bottom)) {
477 if (this.top > top)
478 this.top = top;
485 this.top = top;
500 union(r.left, r.top, r.right, r.bottom);
516 if (y < top) {
517 top = y;
524 * Swap top/bottom or left/right if there are flipped (i.e. left > right
525 * and/or top > bottom). This can be called if
527 * If the edges are already correct (i.e. left <= right and top <= bottom)
536 if (top > bottom) {
537 int temp = top;
538 top = bottom;
557 out.writeInt(top);
588 top = in.readInt();
600 top = (int) (top * scale + 0.5f);