Class RMMorphShape.Morphing2D
- All Implemented Interfaces:
- Shape
- Enclosing class:
- RMMorphShape
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.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intA non-zero winding rule for determining the interior of a path.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontains(double x, double y) booleancontains(double x, double y, double w, double h) booleanbooleandoubleReturns the morphing value between the two shapes.getPathIterator(AffineTransform at, double flatness) booleanintersects(double x, double y, double w, double h) booleanvoidsetMorphing(double morph) Sets the morphing value between the two shapes.
- 
Field Details- 
WIND_EVEN_ODDpublic static final int WIND_EVEN_ODD- See Also:
 
- 
WIND_NON_ZEROpublic static final int WIND_NON_ZEROA non-zero winding rule for determining the interior of a path.- See Also:
 
 
- 
- 
Constructor Details- 
Morphing2DCreates 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. - Parameters:
- startShape- the shape to morph from
- endShape- the shape to morph to
- Throws:
- IllegalPathStateException- if the shapes do not have the same winding rule
- See Also:
 
 
- 
- 
Method Details- 
getMorphingpublic double getMorphing()Returns the morphing value between the two shapes. - Returns:
- the morphing value between the two shapes
- See Also:
 
- 
setMorphingpublic 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 shap. 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. - Parameters:
- morph- the morphing value between the two shapes
- See Also:
 
- 
getBounds
- 
getBounds2D- Specified by:
- getBounds2Din interface- Shape
 
- 
containspublic boolean contains(double x, double y) 
- 
contains
- 
intersectspublic boolean intersects(double x, double y, double w, double h) - Specified by:
- intersectsin interface- Shape
 
- 
intersects- Specified by:
- intersectsin interface- Shape
 
- 
containspublic boolean contains(double x, double y, double w, double h) 
- 
contains
- 
getPathIterator- Specified by:
- getPathIteratorin interface- Shape
 
- 
getPathIterator- Specified by:
- getPathIteratorin interface- Shape
 
 
-