1 7 8 22 23 package java.awt.font; 24 25 import java.awt.geom.AffineTransform ; 26 import java.io.Serializable ; 27 28 32 public final class TransformAttribute implements Serializable { 33 34 39 private AffineTransform transform; 40 41 46 public TransformAttribute(AffineTransform transform) { 47 if (transform == null) { 48 throw new IllegalArgumentException ("transform may not be null"); 49 } 50 51 if (!transform.isIdentity()) { 52 this.transform = new AffineTransform (transform); 53 } 54 } 55 56 61 public AffineTransform getTransform() { 62 AffineTransform at = transform; 63 return (at == null) ? new AffineTransform () : new AffineTransform (at); 64 } 65 66 73 public boolean isIdentity() { 74 return (transform == null); 75 } 76 77 private void writeObject(java.io.ObjectOutputStream s) 78 throws java.lang.ClassNotFoundException , 79 java.io.IOException 80 { 81 if (this.transform == null) { 83 this.transform = new AffineTransform (); 84 } 85 s.defaultWriteObject(); 86 } 87 88 static final long serialVersionUID = 3356247357827709530L; 90 91 } 92 | Popular Tags |