public class JDFMatrix extends JDFNumList
[ x'] [ a b tx ] [ x ] [ m00x + m01y + m02 ] [ y'] = [ c d ty ] [ y ] = [ m10x + m11y + m12 ] [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
JDFNumList.NormComparator, JDFNumList.VolumeComparatorJDFBaseDataTypes.EnumFitsValueEPSILON, MAX_CMYK_COLOR, MAX_LAB_COLOR, MAX_MATRIX_DIMENSION, MAX_RECTANGLE_DIMENSION, MAX_RGB_COLOR, MAX_SHAPE_DIMENSION, MAX_XY_DIMENSION| Constructor and Description |
|---|
JDFMatrix()
constructs a matrix with all values set to 0.0 Double
|
JDFMatrix(double degrees,
double x,
double y)
constructs a matrix with all values set via arotation and a shift
|
JDFMatrix(double a,
double b,
double c,
double d,
double tx,
double ty)
constructs a new JDFMatrix with the given double values
|
JDFMatrix(JDFElement.EnumOrientation orientation,
double w,
double h)
constructs a matrix with all values set via an enumerated orientation
|
JDFMatrix(JDFMatrix matrix)
copy constructor
|
JDFMatrix(JDFNumList nl)
constructs a rectangle with all values set via a JDFNumberList
|
JDFMatrix(JDFRectangle rect)
constructs a rectangle with all values set via a JDFNumberList
|
JDFMatrix(java.lang.String s)
constructs a matrix with all values set via a String
|
JDFMatrix(java.util.Vector v)
Deprecated.
use typesafe constructors
|
| Modifier and Type | Method and Description |
|---|---|
JDFMatrix |
clone() |
JDFMatrix |
concat(JDFMatrix m)
concatinates this with m
|
static JDFMatrix |
createMatrix(java.lang.String s)
factory for JDFXYPair that silently returns null in case of illegal strings
|
boolean |
equals(java.lang.Object other)
equals - returns true if both JDFMatrices are equal, otherwise false
|
double |
getA()
getA - returns the first coordinate
|
java.awt.geom.AffineTransform |
getAffineTransform()
getAffineTransform -
|
double |
getAngle() |
double |
getB()
getB - returns the second coordinate
|
double |
getC()
getC - returns the third coordinate
|
double |
getD()
getD - returns the fourth coordinate
|
JDFElement.EnumOrientation |
getOrientation() |
JDFXYPair |
getShift() |
double |
getTx()
getTx - returns the tx coordinate
|
double |
getTy()
getTy - returns the ty coordinate
|
static JDFMatrix |
getUnitMatrix() |
int |
hashCode()
hashCode complements equals() to fulfill the equals/hashCode contract
|
JDFMatrix |
invert()
inverts this
|
boolean |
isFlip() |
boolean |
isValid()
isValid - true if the size of the vector is 6 and all instances are Double types
|
JDFMatrix |
rotate(double degrees)
rotate this by degrees degrees CouterClockwise
|
void |
setA(double p_a)
setA - sets the first coordinate
|
void |
setAffineTransform(java.awt.geom.AffineTransform affineTrans)
setAffineTransform -
|
void |
setB(double p_b)
setB - sets the second coordinate
|
void |
setC(double p_c)
setC - sets the third coordinate
|
void |
setD(double p_d)
setD - sets the fourth coordinate
|
JDFMatrix |
setShift(JDFXYPair point)
shift this matrix by an xypair
|
void |
setTx(double p_tx)
setTx - sets the tx coordinate
|
void |
setTy(double p_ty)
setTy - sets the ty coordinate
|
JDFMatrix |
shift(double tx,
double ty)
shifts Tx and Ty by the amount specified
|
JDFMatrix |
shift(JDFXYPair point)
shift this matrix by an xypair
|
JDFRectangle |
transform(JDFRectangle jdfRectangle) |
JDFXYPair |
transform(JDFXYPair inCoordinate)
applies this to a point
|
abs, contains, containsAll, copyNumList, doubleAt, elementAt, getDouble, getDoubleList, getDoubleVector, getIntArray, getString, getString, intAt, isValidString, matches, max, min, norm, removeElementAt, replaceElementAt, scale, scale, scaleFromCM, scaleFromCM, scaleFromMM, scaleFromMM, scaleToCM, scaleToCM, scaleToMM, scaleToMM, set, setString, setX, shift, sort, subtract, toString, unify, volumeadd, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, forEach, get, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, trimToSizepublic JDFMatrix()
@Deprecated
public JDFMatrix(java.util.Vector v)
throws java.util.zip.DataFormatException
Vector - v - the given Vectorjava.util.zip.DataFormatException - - if the Vector has not a valid formatpublic JDFMatrix(double degrees,
double x,
double y)
degrees - - the rotation in degreesx - the X shifty - the Y shiftjava.util.zip.DataFormatException - - if the Vector has not a valid formatpublic JDFMatrix(JDFElement.EnumOrientation orientation, double w, double h)
orientation - - the named orientationw - the width of the unrotated object to transformh - the height of the unrotated object to transformjava.util.zip.DataFormatException - - if the Vector has not a valid formatpublic JDFMatrix(java.lang.String s)
throws java.util.zip.DataFormatException
s - the given Stringjava.util.zip.DataFormatException - - if the String has not a valid formatpublic JDFMatrix(JDFNumList nl) throws java.util.zip.DataFormatException
nl - the given number listjava.util.zip.DataFormatException - - if the JDFNumberList has not a valid formatpublic JDFMatrix(JDFMatrix matrix)
matrix - the given number listpublic JDFMatrix(JDFRectangle rect)
rect - the given number listpublic JDFMatrix(double a,
double b,
double c,
double d,
double tx,
double ty)
a - position 01 of the transformation matrixb - position 02 of the transformation matrixc - position 10 of the transformation matrixd - position 11 of the transformation matrixtx - position 03 of the transformation matrixty - position 13 of the transformation matrixpublic static JDFMatrix getUnitMatrix()
public JDFMatrix clone()
clone in class JDFNumListJDFNumList.clone()public static JDFMatrix createMatrix(java.lang.String s)
s - the string to parsepublic boolean isValid()
throws java.util.zip.DataFormatException
isValid in class JDFNumListjava.util.zip.DataFormatException - - if the Vector has not a valid formatpublic double getA()
public void setA(double p_a)
p_a - the first coordinatepublic double getB()
public void setB(double p_b)
p_b - the first coordinatepublic double getC()
public void setC(double p_c)
p_c - the third coordinatepublic double getD()
public void setD(double p_d)
p_d - the fourth coordinatepublic double getTx()
public JDFXYPair getShift()
public JDFElement.EnumOrientation getOrientation()
public double getAngle()
public boolean isFlip()
public void setTx(double p_tx)
p_tx - the tx coordinatepublic double getTy()
public void setTy(double p_ty)
p_ty - the ty coordinatepublic boolean equals(java.lang.Object other)
equals in interface java.util.Collection<java.lang.Object>equals in interface java.util.List<java.lang.Object>equals in class JDFNumListpublic int hashCode()
hashCode in interface java.util.Collection<java.lang.Object>hashCode in interface java.util.List<java.lang.Object>hashCode in class JDFNumListpublic java.awt.geom.AffineTransform getAffineTransform()
public void setAffineTransform(java.awt.geom.AffineTransform affineTrans)
affineTrans - matrix to be storedpublic JDFXYPair transform(JDFXYPair inCoordinate)
inCoordinate - public JDFMatrix shift(double tx, double ty)
tx - shift in x directionty - shift in y directionpublic JDFMatrix rotate(double degrees)
degrees - the degrees to rotate by in counterclockwise directionpublic JDFMatrix concat(JDFMatrix m)
m - the matrix to concatinatepublic JDFMatrix invert()
m - the matrix to concatinatepublic JDFMatrix shift(JDFXYPair point)
point - the point to shift bypublic JDFMatrix setShift(JDFXYPair point)
point - the point to shift bypublic JDFRectangle transform(JDFRectangle jdfRectangle)