Moved static factory methods to top of class.

This commit is contained in:
Michael Bayne
2011-07-01 16:34:05 -07:00
parent fd11be72ee
commit 71debc6a17
2 changed files with 90 additions and 90 deletions
+45 -45
View File
@@ -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_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.
*/
@@ -295,51 +340,6 @@ public class AffineTransform implements Cloneable, Serializable
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.
*/
+45 -45
View File
@@ -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_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.
*/
@@ -293,51 +338,6 @@ public class AffineTransform implements Cloneable, Serializable
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.
*/