Show PointCalculations.java syntax highlighted
/**
*
*/
package ucalgary.ebe.ci.gestures.helpers;
import java.util.List;
import ucalgary.ebe.ci.common.ICIPoint;
import ucalgary.ebe.ci.common.Point;
/**
* @author hkolenda
*
*/
public class PointCalculations {
public static ICIPoint getFocalPoint(List<ICIPoint> points) {
Point result = new Point();
int maxX = Integer.MIN_VALUE;
int maxY = Integer.MIN_VALUE;
int minX = Integer.MAX_VALUE;
int minY = Integer.MAX_VALUE;
for (ICIPoint p : points) {
if (p.getX() > maxX) {
maxX = p.getX();
}
if (p.getY() > maxY) {
maxY = p.getY();
}
if (p.getX() < minX) {
minX = p.getX();
}
if (p.getY() < minY) {
minY = p.getY();
}
}
result.setX(minX + (maxX - minX) / 2);
result.setY(minY + (maxY - minY) / 2);
return result;
}
public static ICIPoint getLocationForStoryCard() {
return new Point();
}
}
See more files for this project here
The MASE project investigates methods to support the coordination and executable acceptance testing of software projects. Keywords: Agile methods, distributed teams, Extreme Programming. See http://ebe.cpsc.ucalgary.ca/ebe for more information.
Project homepage:
http://sourceforge.net/projects/mase
Programming language(s): Java,XML
License: other
PointCalculations.java