Moved static factory methods to top of class.
This commit is contained in:
@@ -28,6 +28,51 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
public static final int TYPE_MASK_SCALE = TYPE_UNIFORM_SCALE | TYPE_GENERAL_SCALE;
|
public static final int TYPE_MASK_SCALE = TYPE_UNIFORM_SCALE | TYPE_GENERAL_SCALE;
|
||||||
public static final int TYPE_MASK_ROTATION = TYPE_QUADRANT_ROTATION | TYPE_GENERAL_ROTATION;
|
public static final int TYPE_MASK_ROTATION = TYPE_QUADRANT_ROTATION | TYPE_GENERAL_ROTATION;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified translation.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getTranslateInstance (double tx, double ty) {
|
||||||
|
AffineTransform t = new AffineTransform();
|
||||||
|
t.setToTranslation(tx, ty);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified scale.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getScaleInstance (double scx, double scY) {
|
||||||
|
AffineTransform t = new AffineTransform();
|
||||||
|
t.setToScale(scx, scY);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified shear.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getShearInstance (double shx, double shy) {
|
||||||
|
AffineTransform m = new AffineTransform();
|
||||||
|
m.setToShear(shx, shy);
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified rotation.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getRotateInstance (double angle) {
|
||||||
|
AffineTransform t = new AffineTransform();
|
||||||
|
t.setToRotation(angle);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified rotation.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getRotateInstance (double angle, double x, double y) {
|
||||||
|
AffineTransform t = new AffineTransform();
|
||||||
|
t.setToRotation(angle, x, y);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an identity transform.
|
* Constructs an identity transform.
|
||||||
*/
|
*/
|
||||||
@@ -295,51 +340,6 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
type = TYPE_UNKNOWN;
|
type = TYPE_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified translation.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getTranslateInstance (double tx, double ty) {
|
|
||||||
AffineTransform t = new AffineTransform();
|
|
||||||
t.setToTranslation(tx, ty);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified scale.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getScaleInstance (double scx, double scY) {
|
|
||||||
AffineTransform t = new AffineTransform();
|
|
||||||
t.setToScale(scx, scY);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified shear.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getShearInstance (double shx, double shy) {
|
|
||||||
AffineTransform m = new AffineTransform();
|
|
||||||
m.setToShear(shx, shy);
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified rotation.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getRotateInstance (double angle) {
|
|
||||||
AffineTransform t = new AffineTransform();
|
|
||||||
t.setToRotation(angle);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified rotation.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getRotateInstance (double angle, double x, double y) {
|
|
||||||
AffineTransform t = new AffineTransform();
|
|
||||||
t.setToRotation(angle, x, y);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Concatenates the specified translation to this transform.
|
* Concatenates the specified translation to this transform.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -28,6 +28,51 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
public static final int TYPE_MASK_SCALE = TYPE_UNIFORM_SCALE | TYPE_GENERAL_SCALE;
|
public static final int TYPE_MASK_SCALE = TYPE_UNIFORM_SCALE | TYPE_GENERAL_SCALE;
|
||||||
public static final int TYPE_MASK_ROTATION = TYPE_QUADRANT_ROTATION | TYPE_GENERAL_ROTATION;
|
public static final int TYPE_MASK_ROTATION = TYPE_QUADRANT_ROTATION | TYPE_GENERAL_ROTATION;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified translation.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getTranslateInstance (float tx, float ty) {
|
||||||
|
AffineTransform t = new AffineTransform();
|
||||||
|
t.setToTranslation(tx, ty);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified scale.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getScaleInstance (float scx, float scY) {
|
||||||
|
AffineTransform t = new AffineTransform();
|
||||||
|
t.setToScale(scx, scY);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified shear.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getShearInstance (float shx, float shy) {
|
||||||
|
AffineTransform m = new AffineTransform();
|
||||||
|
m.setToShear(shx, shy);
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified rotation.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getRotateInstance (float angle) {
|
||||||
|
AffineTransform t = new AffineTransform();
|
||||||
|
t.setToRotation(angle);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a transform that performs the specified rotation.
|
||||||
|
*/
|
||||||
|
public static AffineTransform getRotateInstance (float angle, float x, float y) {
|
||||||
|
AffineTransform t = new AffineTransform();
|
||||||
|
t.setToRotation(angle, x, y);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an identity transform.
|
* Constructs an identity transform.
|
||||||
*/
|
*/
|
||||||
@@ -293,51 +338,6 @@ public class AffineTransform implements Cloneable, Serializable
|
|||||||
type = TYPE_UNKNOWN;
|
type = TYPE_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified translation.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getTranslateInstance (float tx, float ty) {
|
|
||||||
AffineTransform t = new AffineTransform();
|
|
||||||
t.setToTranslation(tx, ty);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified scale.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getScaleInstance (float scx, float scY) {
|
|
||||||
AffineTransform t = new AffineTransform();
|
|
||||||
t.setToScale(scx, scY);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified shear.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getShearInstance (float shx, float shy) {
|
|
||||||
AffineTransform m = new AffineTransform();
|
|
||||||
m.setToShear(shx, shy);
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified rotation.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getRotateInstance (float angle) {
|
|
||||||
AffineTransform t = new AffineTransform();
|
|
||||||
t.setToRotation(angle);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a transform that performs the specified rotation.
|
|
||||||
*/
|
|
||||||
public static AffineTransform getRotateInstance (float angle, float x, float y) {
|
|
||||||
AffineTransform t = new AffineTransform();
|
|
||||||
t.setToRotation(angle, x, y);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Concatenates the specified translation to this transform.
|
* Concatenates the specified translation to this transform.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user