jfig.utils
Class BoundingBoxCalculator

java.lang.Object
  extended byjfig.utils.BoundingBoxCalculator

public class BoundingBoxCalculator
extends java.lang.Object

calculate the bounding box of FIG objects.

BoundingBoxCalculator: a simple utility class to calculate the bounding box (union) of an Enumeration of FigObject objects.


Constructor Summary
BoundingBoxCalculator()
           
 
Method Summary
static FigBbox getBoundingBox(java.util.Enumeration E)
          given an Enumeration of FIG objects, that is, classes that implement the jfig.objects.FigObject interface, this method calculates the bounding box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundingBoxCalculator

public BoundingBoxCalculator()
Method Detail

getBoundingBox

public static FigBbox getBoundingBox(java.util.Enumeration E)
given an Enumeration of FIG objects, that is, classes that implement the jfig.objects.FigObject interface, this method calculates the bounding box. The result is given in world coordinates at 2400 dpi.

As an useful default for empty drawings, a one-inch square is returned for an empty Enumeration. This is not so much a workaround against NullPointerExceptions, but helps in keeping a user-friendly zoom-factor in the jfig editor.