java.awt.font
public final class: TransformAttribute [javadoc |
source]
java.lang.Object
java.awt.font.TransformAttribute
All Implemented Interfaces:
java$io$Serializable
The
TransformAttribute
class provides an immutable
wrapper for a transform so that it is safe to use as an attribute.
Field Summary |
---|
public static final TransformAttribute | IDENTITY | A TransformAttribute representing the identity transform. |
static final long | serialVersionUID | |
Constructor: |
public TransformAttribute(AffineTransform transform) {
if (transform != null && !transform.isIdentity()) {
this.transform = new AffineTransform(transform);
}
}
Wraps the specified transform. The transform is cloned and a
reference to the clone is kept. The original transform is unchanged.
If null is passed as the argument, this constructor behaves as though
it were the identity transform. (Note that it is preferable to use
#IDENTITY in this case.) Parameters:
transform - the specified AffineTransform to be wrapped,
or null.
|
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from java.awt.font.TransformAttribute Detail: |
public boolean equals(Object rhs) {
try {
TransformAttribute that = (TransformAttribute)rhs;
if (transform == null) {
return that.transform == null;
}
return transform.equals(that.transform);
}
catch (ClassCastException e) {
}
return false;
}
Returns true if rhs is a TransformAttribute
whose transform is equal to this TransformAttribute 's
transform. |
public AffineTransform getTransform() {
AffineTransform at = transform;
return (at == null) ? new AffineTransform() : new AffineTransform(at);
}
Returns a copy of the wrapped transform. |
public int hashCode() {
return transform == null ? 0 : transform.hashCode();
}
|
public boolean isIdentity() {
return transform == null;
}
Returns true if the wrapped transform is
an identity transform. |