nicolasroard | 0d7cdf8 | 2012-09-25 14:27:56 -0700 | [diff] [blame] | 1 | |
| 2 | package com.android.gallery3d.filtershow.ui; |
| 3 | |
John Hoford | c7b2c28 | 2012-10-02 18:12:03 -0700 | [diff] [blame] | 4 | public class ControlPoint implements Comparable { |
nicolasroard | 3992ae6 | 2012-10-15 18:03:37 -0700 | [diff] [blame^] | 5 | public float x; |
| 6 | public float y; |
| 7 | |
nicolasroard | 0d7cdf8 | 2012-09-25 14:27:56 -0700 | [diff] [blame] | 8 | public ControlPoint(float px, float py) { |
| 9 | x = px; |
| 10 | y = py; |
| 11 | } |
| 12 | |
nicolasroard | 3992ae6 | 2012-10-15 18:03:37 -0700 | [diff] [blame^] | 13 | public ControlPoint(ControlPoint point) { |
| 14 | x = point.x; |
| 15 | y = point.y; |
nicolasroard | 0d7cdf8 | 2012-09-25 14:27:56 -0700 | [diff] [blame] | 16 | } |
| 17 | |
nicolasroard | 0d7cdf8 | 2012-09-25 14:27:56 -0700 | [diff] [blame] | 18 | 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 | } |