Пример #1
0
  /** Compute circumference by adding up the length of it's segemnts. */
  @Override
  public final void compute() {
    if (!polygon.isDefined()) {
      circum.setUndefined();
      return;
    }

    GeoSegmentND[] segment = polygon.getSegments();
    double length = 0;
    for (int i = 0; i < segment.length; i++) {
      length = length + (segment[i].getLength());
    }
    circum.setValue(length);
  }
Пример #2
0
 @Override
 public final void compute() {
   if (text.isDefined()) length.setValue(text.getTextString().length());
   else length.setUndefined();
 }