blob: 0c08e76fd1b83326e5dcaaabaf19cc2840b80f19 [file] [log] [blame]
nicolasroard0d7cdf82012-09-25 14:27:56 -07001
2package com.android.gallery3d.filtershow.ui;
3
John Hofordc7b2c282012-10-02 18:12:03 -07004public class ControlPoint implements Comparable {
nicolasroard3992ae62012-10-15 18:03:37 -07005 public float x;
6 public float y;
7
nicolasroard0d7cdf82012-09-25 14:27:56 -07008 public ControlPoint(float px, float py) {
9 x = px;
10 y = py;
11 }
12
nicolasroard3992ae62012-10-15 18:03:37 -070013 public ControlPoint(ControlPoint point) {
14 x = point.x;
15 y = point.y;
nicolasroard0d7cdf82012-09-25 14:27:56 -070016 }
17
nicolasroard0d7cdf82012-09-25 14:27:56 -070018 public ControlPoint copy() {
19 return new ControlPoint(x, y);
20 }
21
22 @Override
23 public int compareTo(Object another) {
24 ControlPoint p = (ControlPoint) another;
25 if (p.x < x) {
26 return 1;
27 } else if (p.x > x) {
28 return -1;
29 }
30 return 0;
31 }
32}