|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<Object>
org.cip4.jdflib.datatypes.JDFNumList
org.cip4.jdflib.datatypes.JDFMatrix
public class JDFMatrix
This class represents a transformation matrix consisting of 6 transformation values a, b, c, d, tx, ty all values are double values. The matrix looks like:
[ x'] [ a b tx ] [ x ] [ m00x + m01y + m02 ] [ y'] = [ c d ty ] [ y ] = [ m10x + m11y + m12 ] [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes |
|---|
JDFBaseDataTypes.EnumFitsValue |
| Field Summary | |
|---|---|
static JDFMatrix |
unitMatrix
|
| Fields inherited from class java.util.Vector |
|---|
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Fields inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes |
|---|
EPSILON, MAX_CMYK_COLOR, MAX_LAB_COLOR, MAX_MATRIX_DIMENSION, MAX_RECTANGLE_DIMENSION, MAX_RGB_COLOR, MAX_SHAPE_DIMENSION, MAX_XY_DIMENSION |
| Constructor Summary | |
|---|---|
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 nl)
constructs a rectangle with all values set via a JDFNumberList |
|
JDFMatrix(JDFNumList nl)
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 |
|
| Method Summary | |
|---|---|
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 |
getB()
getB - returns the second coordinate |
double |
getC()
getC - returns the third coordinate |
double |
getD()
getD - returns the fourth coordinate |
double |
getTx()
getTx - returns the tx coordinate |
double |
getTy()
getTy - returns the ty coordinate |
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 |
void |
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 |
void |
setTx(double p_tx)
setTx - sets the tx coordinate |
void |
setTy(double p_ty)
setTy - sets the ty coordinate |
void |
shift(double tx,
double ty)
shifts Tx and Ty by the amount specified |
void |
shift(JDFXYPair point)
shift this matrix by an xypair |
| Methods inherited from class org.cip4.jdflib.datatypes.JDFNumList |
|---|
abs, clone, contains, containsAll, copyNumList, doubleAt, elementAt, getDoubleList, getIntArray, getString, getString, isValidString, matches, removeElementAt, replaceElementAt, scale, scaleFromCM, scaleFromMM, scaleToCM, scaleToMM, set, setString, subtract, toString, unify |
| Methods inherited from class java.util.Vector |
|---|
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, get, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
iterator, listIterator, listIterator |
| Field Detail |
|---|
public static final JDFMatrix unitMatrix
| Constructor Detail |
|---|
public JDFMatrix()
@Deprecated
public JDFMatrix(Vector v)
throws DataFormatException
Vector - v - the given Vector
DataFormatException - - if the Vector has not a valid format
public JDFMatrix(double degrees,
double x,
double y)
degrees - - the rotation in degreesx - the X shifty - the Y shift
DataFormatException - - if the Vector has not a valid format
public 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 transform
DataFormatException - - if the Vector has not a valid format
public JDFMatrix(String s)
throws DataFormatException
s - the given String
DataFormatException - - if the String has not a valid format
public JDFMatrix(JDFNumList nl)
throws DataFormatException
nl - the given number list
DataFormatException - - if the JDFNumberList has not a valid formatpublic JDFMatrix(JDFMatrix nl)
nl - the given number list
public 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 matrix| Method Detail |
|---|
public static JDFMatrix createMatrix(String s)
s - the string to parse
public boolean isValid()
throws DataFormatException
isValid in class JDFNumListDataFormatException - - 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 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 JDFNumListpublic int hashCode()
hashCode in interface Collection<Object>hashCode in interface List<Object>hashCode in class JDFNumListpublic AffineTransform getAffineTransform()
public void setAffineTransform(AffineTransform affineTrans)
affineTrans - matrix to be stored
public void shift(double tx,
double ty)
tx - shift in x directionty - shift in y directionpublic void rotate(double degrees)
degrees - the degrees to rotate by in counterclockwise directionpublic void concat(JDFMatrix m)
m - the matrix to concatinatepublic void shift(JDFXYPair point)
point - the point to shift by
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||