01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Ilya S. Okomin
19: * @version $Revision$
20: */package java.awt.font;
21:
22: import java.awt.geom.AffineTransform;
23: import java.io.Serializable;
24:
25: import org.apache.harmony.awt.internal.nls.Messages;
26:
27: public final class TransformAttribute implements Serializable {
28: private static final long serialVersionUID = 3356247357827709530L;
29:
30: // affine transform of this TransformAttribute instance
31: private AffineTransform fTransform;
32:
33: public TransformAttribute(AffineTransform transform) {
34: if (transform == null) {
35: // awt.94=transform can not be null
36: throw new IllegalArgumentException(Messages
37: .getString("awt.94")); //$NON-NLS-1$
38: }
39: if (!transform.isIdentity()) {
40: this .fTransform = new AffineTransform(transform);
41: }
42: }
43:
44: public AffineTransform getTransform() {
45: if (fTransform != null) {
46: return new AffineTransform(fTransform);
47: }
48: return new AffineTransform();
49: }
50:
51: public boolean isIdentity() {
52: return (fTransform == null);
53: }
54:
55: }
|