public class Matrix extends Object implements Cloneable
Constructor and Description |
---|
Matrix()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones this object.
|
Matrix |
copy()
This will copy the text matrix data.
|
AffineTransform |
createAffineTransform()
Create an affine transform from this matrix's values.
|
Matrix |
extractScaling()
Create a new matrix with just the scaling operators.
|
Matrix |
extractTranslating()
Create a new matrix with just the translating operators.
|
static Matrix |
getScaleInstance(float x,
float y)
Convenience method to create a scaled instance.
|
static Matrix |
getTranslatingInstance(float x,
float y)
Convenience method to create a translating instance.
|
float |
getValue(int row,
int column)
This will get a matrix value at some point.
|
float[][] |
getValues()
Return a single dimension array of all values in the matrix.
|
double[][] |
getValuesAsDouble()
Return a single dimension array of all values in the matrix.
|
float |
getXPosition()
Get the x position in the matrix.
|
float |
getXScale()
Get the xscaling factor of this matrix.
|
float |
getYPosition()
Get the y position.
|
float |
getYScale()
Get the y scaling factor of this matrix.
|
Matrix |
multiply(Matrix b)
This will take the current matrix and multipy it with a matrix that is passed in.
|
Matrix |
multiply(Matrix other,
Matrix result)
This method multiplies this Matrix with the specified other Matrix, storing the product in the specified
result Matrix.
|
void |
reset()
This method resets the numbers in this Matrix to the original values, which are
the values that a newly constructed Matrix would have.
|
void |
setFromAffineTransform(AffineTransform af)
Set the values of the matrix from the AffineTransform.
|
void |
setValue(int row,
int column,
float value)
This will set a value at a position.
|
String |
toString()
This will return a string representation of the matrix.
|
public void reset()
public AffineTransform createAffineTransform()
public void setFromAffineTransform(AffineTransform af)
af
- The transform to get the values from.public float getValue(int row, int column)
row
- The row to get the value from.column
- The column to get the value from.public void setValue(int row, int column, float value)
row
- The row to set the value at.column
- the column to set the value at.value
- The value to set at the position.public float[][] getValues()
public double[][] getValuesAsDouble()
public Matrix multiply(Matrix b)
b
- The matrix to multiply by.public Matrix multiply(Matrix other, Matrix result)
other
- the second operand Matrix in the multiplicationresult
- the Matrix instance into which the result should be stored. If result is null, a new Matrix
instance is created.public Matrix extractScaling()
public static Matrix getScaleInstance(float x, float y)
x
- The xscale operator.y
- The yscale operator.public Matrix extractTranslating()
public static Matrix getTranslatingInstance(float x, float y)
x
- The x translating operator.y
- The y translating operator.public Object clone()
public Matrix copy()
public String toString()
public float getXScale()
public float getYScale()
public float getXPosition()
public float getYPosition()
Copyright © 2002-2016 The Apache Software Foundation. All Rights Reserved.