|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcox.jmatt.java.MathTools.markup.svg.TransformPen
public class TransformPen
This pen provides an easy way to create a sequence of transformations for an SVG tag 'transform=' attribute. The operations work exactly per that standard. All transformations are applied IN THE ORDER THEY ARE SET, so set with care!
All transform methods return a reference to this instance to allow method chaining. This, along with reset() and copyOf()
allows easy re-use
of TransformPen
s.
Constructor Summary | |
---|---|
TransformPen()
The only constructor required. |
Method Summary | |
---|---|
TransformPen |
copyOf()
Return a copy of this TransformPen exactly as it is at this moment. |
boolean |
isEmpty()
Check to see if any transformations are present. |
TransformPen |
reset()
Clear all transforms. |
TransformPen |
rotate(double pTheta)
Add a rotation about the origin: 'rotate(pTheta)'. |
TransformPen |
rotate(double pTheta,
double pCX,
double pCY)
Add a rotation about a center point other than the origin: 'rotate(pTheta, pCX, pCY)'. |
TransformPen |
scale(double pScale)
Add a uniform scaling transform: 'scale(pScale)'. |
TransformPen |
scale(double pScaleX,
double pScaleY)
Add a non-uniform scaling transform: 'scale(pScaleX, pScaleY)'. |
TransformPen |
skewX(double pTheta)
Apply a skew transform in the X coordinate. |
TransformPen |
skewY(double pTheta)
Skew all Y-coordinates. |
java.lang.String |
toString(boolean pComplete)
Print and format the tag as an SVG 'transform=' attribute. |
TransformPen |
translate(double pDeltaX,
double pDeltaY)
Apply a translation: 'translate(pDeltaX, pDeltaY)'. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransformPen()
Method Detail |
---|
public java.lang.String toString(boolean pComplete)
pComplete
- true to include the attrubute name and quotes, false for just the data.public TransformPen copyOf()
TransformPen
exactly as it is at this moment. Changing the original later will not affect the copy or vise versa.
public boolean isEmpty()
public TransformPen reset()
public TransformPen scale(double pScale)
pScale
- The scale factor. This is applied to both the X and Y coordinates uniformly.public TransformPen scale(double pScaleX, double pScaleY)
pScaleX
- The X-coordinate scale factor.pScaleY
- The Y scaling factor.public TransformPen rotate(double pTheta)
pTheta
- The angle of rotation. The center is (0, 0).public TransformPen rotate(double pTheta, double pCX, double pCY)
pTheta
- The angle of rotation to apply.pCX
- The X-coordinate of the center of rotation.pCY
- The Y-coordinate of the center of rotation.public TransformPen translate(double pDeltaX, double pDeltaY)
pDeltaX
- The X-axis translation.pDeltaY
- The translation in the Y direction.public TransformPen skewX(double pTheta)
pTheta
- The angle by which all X-coordinates are to be skewed.public TransformPen skewY(double pTheta)
pTheta
- The angle by which all X-coordinates are to be skewed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |