|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.geom.Morphing2D
public class Morphing2D
A morphing shape is a shape which geometry is constructed from two other shapes: a start shape and an end shape.
The morphing property of a morphing shape defines the amount of transformation applied to the start shape to turn it into the end shape.
Both shapes must have the same winding rule.
Constructor Summary | |
---|---|
Morphing2D(java.awt.Shape startShape,
java.awt.Shape endShape)
Creates a new morphing shape. |
Method Summary | |
---|---|
boolean |
contains(double x,
double y)
|
boolean |
contains(double x,
double y,
double w,
double h)
|
boolean |
contains(java.awt.geom.Point2D p)
|
boolean |
contains(java.awt.geom.Rectangle2D r)
|
java.awt.Rectangle |
getBounds()
|
java.awt.geom.Rectangle2D |
getBounds2D()
|
double |
getMorphing()
Returns the morphing value between the two shapes. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
|
boolean |
intersects(double x,
double y,
double w,
double h)
|
boolean |
intersects(java.awt.geom.Rectangle2D r)
|
void |
setMorphing(double morph)
Sets the morphing value between the two shapes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Morphing2D(java.awt.Shape startShape, java.awt.Shape endShape)
Creates a new morphing shape. A morphing shape can be used to turn one shape into another one. The transformation can be controlled by the morph property.
startShape
- the shape to morph fromendShape
- the shape to morph to
java.awt.geom.IllegalPathStateException
- if the shapes do not have the same
winding rulegetMorphing()
,
setMorphing(double)
Method Detail |
---|
public double getMorphing()
Returns the morphing value between the two shapes.
setMorphing(double)
public void setMorphing(double morph)
Sets the morphing value between the two shapes. This value controls the transformation from the start shape to the end shape. A value of 0.0 is the start shape. A value of 1.0 is the end shape. A value of 0.5 is a new shape, morphed half way from the start shape to the end shape.
The specified value should be between 0.0 and 1.0. If not, the value is clamped in the appropriate range.
morph
- the morphing value between the two shapesgetMorphing()
public java.awt.Rectangle getBounds()
getBounds
in interface java.awt.Shape
public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface java.awt.Shape
public boolean contains(double x, double y)
contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Point2D p)
contains
in interface java.awt.Shape
public boolean intersects(double x, double y, double w, double h)
intersects
in interface java.awt.Shape
public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface java.awt.Shape
public boolean contains(double x, double y, double w, double h)
contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Rectangle2D r)
contains
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
getPathIterator
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
getPathIterator
in interface java.awt.Shape
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |