net.tmachine.gpg.hue
Class Document

java.lang.Object
  extended bynet.tmachine.gpg.hue.Document

public class Document
extends java.lang.Object


Field Summary
protected  java.util.ArrayList shapes
           
 
Constructor Summary
Document()
           
 
Method Summary
 void addShape(java.awt.Shape s)
          Converts all added shapes to Area instances if they are not already, since Sun's 2D API was badly designed and prevents you from applying AffineTransforms to most shapes.
 java.util.ArrayList getAllShapes()
           
 java.util.ArrayList getShapesAtPoint(int[] point)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shapes

protected java.util.ArrayList shapes
Constructor Detail

Document

public Document()
Method Detail

getAllShapes

public java.util.ArrayList getAllShapes()

addShape

public void addShape(java.awt.Shape s)
Converts all added shapes to Area instances if they are not already, since Sun's 2D API was badly designed and prevents you from applying AffineTransforms to most shapes.

Without the auto-conversion, it is hard to write decent GUIs because you are not allowed to use the AffineTransform class, so you cannot do rotations etc without implementing it all by hand, and creating large switch statements to deal with all possible shapes (which all have different API's)

Parameters:
s -

getShapesAtPoint

public java.util.ArrayList getShapesAtPoint(int[] point)