FileDocCategorySizeDatePackage
TransformAttribute.javaAPI DocJava SE 5 API2919Fri Aug 26 14:56:52 BST 2005java.awt.font

TransformAttribute

public final class TransformAttribute extends Object implements Serializable
The TransformAttribute class provides an immutable wrapper for a transform so that it is safe to use as an attribute.

Fields Summary
private AffineTransform
transform
The AffineTransform for this TransformAttribute, or null if AffineTransform is the identity transform.
static final long
serialVersionUID
Constructors Summary
public TransformAttribute(AffineTransform transform)
Wraps the specified transform. The transform is cloned and a reference to the clone is kept. The original transform is unchanged.

param
transform the specified {@link AffineTransform} to be wrapped

	if (transform == null) {
	    throw new IllegalArgumentException("transform may not be null");
	}

	if (!transform.isIdentity()) {
	    this.transform = new AffineTransform(transform);
	}
    
Methods Summary
public java.awt.geom.AffineTransformgetTransform()
Returns a copy of the wrapped transform.

return
a AffineTransform that is a copy of the wrapped transform of this TransformAttribute.

	AffineTransform at = transform;
	return (at == null) ? new AffineTransform() : new AffineTransform(at);
    
public booleanisIdentity()
Returns true if the wrapped transform is an identity transform.

return
true if the wrapped transform is an identity transform; false otherwise.
since
1.4

	return (transform == null);
    
private voidwriteObject(java.io.ObjectOutputStream s)

        // sigh -- 1.3 expects transform is never null, so we need to always write one out
	if (this.transform == null) {
	    this.transform = new AffineTransform();
	}
	s.defaultWriteObject();