Lines Matching refs:left

30  * represented by the coordinates of its 4 edges (left, top, right bottom).
33 * the coordinates are sorted correctly (i.e. left <= right and top <= bottom).
37 * into the column and row described by its left and top coordinates, but not
41 public int left;
68 * checking is performed, so the caller must ensure that left <= right and
71 * @param left The X coordinate of the left side of the rectangle
76 public Rect(int left, int top, int right, int bottom) {
77 this.left = left;
85 * rectangle (which is left unmodified).
92 left = top = right = bottom = 0;
94 left = r.left;
107 return left == r.left && top == r.top && right == r.right && bottom == r.bottom;
112 int result = left;
122 sb.append("Rect("); sb.append(left); sb.append(", ");
141 sb.append('['); sb.append(left); sb.append(',');
153 * @return Returns a new String of the form "left top right bottom"
159 sb.append(left);
193 pw.print('['); pw.print(left); pw.print(',');
199 * Returns true if the rectangle is empty (left >= right or top >= bottom)
202 return left >= right || top >= bottom;
207 * (i.e. left <= right) so the result may be negative.
210 return right - left;
227 return (left + right) >> 1;
243 return (left + right) * 0.5f;
257 left = right = top = bottom = 0;
263 * left <= right and top <= bottom.
265 * @param left The X coordinate of the left side of the rectangle
270 public void set(int left, int top, int right, int bottom) {
271 this.left = left;
284 this.left = src.left;
291 * Offset the rectangle by adding dx to its left and right coordinates, and
294 * @param dx The amount to add to the rectangle's left and right coordinates
298 left += dx;
305 * Offset the rectangle to a specific (left, top) position,
308 * @param newLeft The new "left" coordinate for the rectangle
312 right += newLeft - left;
314 left = newLeft;
324 * @param dx The amount to add(subtract) from the rectangle's left(right)
328 left += dx;
341 left += insets.left;
350 * @param left The amount to add from the rectangle's left
355 public void inset(int left, int top, int right, int bottom) {
356 this.left += left;
363 * Returns true if (x,y) is inside the rectangle. The left and top are
365 * that for a x,y to be contained: left <= x < right and top <= y < bottom.
371 * means left <= x < right and top <= y < bottom
374 return left < right && top < bottom // check for empty first
375 && x >= left && x < right && y >= top && y < bottom;
383 * @param left The left side of the rectangle being tested for containment
390 public boolean contains(int left, int top, int right, int bottom) {
392 return this.left < this.right && this.top < this.bottom
394 && this.left <= left && this.top <= top
408 return this.left < this.right && this.top < this.bottom
410 && left <= r.left && top <= r.top && right >= r.right && bottom >= r.bottom;
414 * If the rectangle specified by left,top,right,bottom intersects this
420 * @param left The left side of the rectangle being intersected with this
432 public boolean intersect(int left, int top, int right, int bottom) {
433 if (this.left < right && left < this.right && this.top < bottom && top < this.bottom) {
434 if (this.left < left) this.left = left;
456 return intersect(r.left, r.top, r.right, r.bottom);
473 if (a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom) {
474 left = Math.max(a.left, b.left);
489 * @param left The left side of the rectangle being tested for intersection
497 public boolean intersects(int left, int top, int right, int bottom) {
498 return this.left < right && left < this.right && this.top < bottom && top < this.bottom;
512 return a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
520 * @param left The left edge being unioned with this rectangle
525 public void union(int left, int top, int right, int bottom) {
526 if ((left < right) && (top < bottom)) {
527 if ((this.left < this.right) && (this.top < this.bottom)) {
528 if (this.left > left) this.left = left;
533 this.left = left;
549 union(r.left, r.top, r.right, r.bottom);
560 if (x < left) {
561 left = x;
573 * Swap top/bottom or left/right if there are flipped (i.e. left > right
576 * If the edges are already correct (i.e. left <= right and top <= bottom)
580 if (left > right) {
581 int temp = left;
582 left = right;
605 out.writeInt(left);
636 left = in.readInt();
648 left = (int) (left * scale + 0.5f);