|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.mcgill.cim.sre.cv4hci.TransformedShape
public class TransformedShape
TransformedShape is a class representing a Java2D Shape + AffineTransform + Color. It is used as an entity for a shape in the rest of the package. It comes with some methods required for its use, which are not part of or not working from the constituent Shape and AffineTransform objects.
Note: This class is not optimized for object-oriented reuse, it is only a demo.
Field Summary | |
---|---|
java.awt.Color |
fillColor
The fill Color object associated with us. |
boolean |
isSelected
State indicating if we are selected by a Brick or not. |
java.awt.Color |
outlineColor
The outline Color object associated with us. |
java.awt.Shape |
shape
The Shape object associated with us. |
java.awt.geom.AffineTransform |
transform
The AffineTransform object associated with us. |
Constructor Summary | |
---|---|
TransformedShape(java.awt.Shape shape,
java.awt.Color color)
TransformedShape constructor specifiying the associated Shape and Color objects. |
|
TransformedShape(java.awt.Shape shape,
java.awt.Color fillColor,
java.awt.Color outlineColor)
TransformedShape constructor specifiying the associated Shape, fill Color and outline Color objects. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a clone of ourself. |
boolean |
contains(java.awt.geom.Point2D p)
Returns whether point p is inside us or not. |
void |
draw(java.awt.Graphics2D g)
Draws this shape onto g with the right transform, and the right colors. |
java.awt.geom.Rectangle2D |
getBounds2D()
Returns a 2D rectangle indicating our bounds as a shape. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.awt.Shape shape
public java.awt.geom.AffineTransform transform
public java.awt.Color fillColor
public java.awt.Color outlineColor
public boolean isSelected
Constructor Detail |
---|
public TransformedShape(java.awt.Shape shape, java.awt.Color fillColor, java.awt.Color outlineColor)
public TransformedShape(java.awt.Shape shape, java.awt.Color color)
Method Detail |
---|
public boolean contains(java.awt.geom.Point2D p)
p
- the 2D point we want to check
public java.awt.geom.Rectangle2D getBounds2D()
public void draw(java.awt.Graphics2D g)
g
- the Graphics2D object to draw onpublic java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |