if (method.equalsIgnoreCase("set")) {
ArrayList<Point> points = getPoints();
for (int a = 0; a < points.size(); a++) {
for (int b = a + 1; b < points.size(); b++) {
if (points.get(b).set.compareTo(points.get(a).set) < 0) {
Point temp = points.get(a);
points.set(a, points.get(b));
points.set(b, temp);
}
}
}
setPoints(points);
}
if (method.equalsIgnoreCase("locationX")) {
ArrayList<Point> points = getPoints();
for (int a = 0; a < points.size(); a++) {
for (int b = a + 1; b < points.size(); b++) {
if (points.get(a).getPosition()[0].doubleValue() > points.get(b).getPosition()[0].doubleValue()) {
Point temp = points.get(a);
points.set(a, points.get(b));
points.set(b, temp);
}
}
}
setPoints(points);
}
if (method.equalsIgnoreCase("locationY")) {
ArrayList<Point> points = getPoints();
for (int a = 0; a < points.size(); a++) {
for (int b = a + 1; b < points.size(); b++) {
if (points.get(a).getPosition()[1].doubleValue() > points.get(b).getPosition()[1].doubleValue()) {
Point temp = points.get(a);
points.set(a, points.get(b));
points.set(b, temp);
}
}
}