Ejemplo n.º 1
0
 public String printLineList() {
   String str;
   str = new String();
   for (MyLine m : lineList) {
     str += m.toString() + "\n";
   }
   return str;
 }
Ejemplo n.º 2
0
  public String calculateInCentimeters() {
    String result;
    result = "";
    double distX, distY, dist;

    pixelToCentimetersConfig();
    for (MyLine m : lineList) {
      distX = (m.getP2().getX() - m.getP1().getX()) / propX;
      distY = (m.getP1().getY() - m.getP2().getY()) / propY;
      dist = Math.sqrt(distX * distX + distY * distY);
      result += String.format("%.2f", dist) + "\n";
    }

    return result;
  }