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.VolumeComparator
JDFBaseDataTypes.EnumFitsValue
capacityIncrement, elementCount, elementData
modCount
EPSILON, 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(String s)
constructs a matrix with all values set via a String
|
JDFMatrix(Vector v)
Deprecated.
use typesafe constructors
|
Modifier and Type | Method and Description |
---|---|
void |
concat(JDFMatrix m)
concatinates this with m
|
static JDFMatrix |
createMatrix(String s)
factory for JDFXYPair that silently returns null in case of illegal strings
|
boolean |
equals(Object other)
equals - returns true if both JDFMatrices are equal, otherwise false
|
double |
getA()
getA - returns the first coordinate
|
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
|
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
|
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(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
|
abs, clone, contains, containsAll, copyNumList, doubleAt, elementAt, getDoubleList, getIntArray, getString, getString, isValidString, matches, norm, removeElementAt, replaceElementAt, scale, scale, scaleFromCM, scaleFromCM, scaleFromMM, scaleFromMM, scaleToCM, scaleToCM, scaleToMM, scaleToMM, set, setString, sort, subtract, toString, unify, volume
add, 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, trimToSize
finalize, getClass, notify, notifyAll, wait, wait, wait
parallelStream, stream
public JDFMatrix()
@Deprecated public JDFMatrix(Vector v) throws DataFormatException
Vector
- v - the given VectorDataFormatException
- - 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 shiftDataFormatException
- - 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 transformDataFormatException
- - if the Vector has not a valid formatpublic JDFMatrix(String s) throws DataFormatException
s
- the given StringDataFormatException
- - if the String has not a valid formatpublic JDFMatrix(JDFNumList nl) throws DataFormatException
nl
- the given number listDataFormatException
- - 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 static JDFMatrix createMatrix(String s)
s
- the string to parsepublic boolean isValid() throws DataFormatException
isValid
in class JDFNumList
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 double getAngle()
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(Object other)
equals
in interface Collection<Object>
equals
in interface List<Object>
equals
in class JDFNumList
public int hashCode()
hashCode
in interface Collection<Object>
hashCode
in interface List<Object>
hashCode
in class JDFNumList
public AffineTransform getAffineTransform()
public void setAffineTransform(AffineTransform affineTrans)
affineTrans
- matrix to be storedpublic 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 void concat(JDFMatrix m)
m
- the matrix to concatinatepublic JDFMatrix shift(JDFXYPair point)
point
- the point to shift byCopyright © 2018. All rights reserved.