1 /*
2
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17
18 */
19 package org.apache.batik.anim.dom;
20
21
22 /**
23 * Stores information about a specific XML attribute or CSS property.
24 *
25 * @version $Id: TraitInformation.java 1733416 2016-03-03 07:07:13Z gadams $
26 */
27 public class TraitInformation {
28
29 // Constants for percentage interpretation.
30 public static final short PERCENTAGE_FONT_SIZE = AnimationTarget.PERCENTAGE_FONT_SIZE;
31 public static final short PERCENTAGE_VIEWPORT_WIDTH = AnimationTarget.PERCENTAGE_VIEWPORT_WIDTH;
32 public static final short PERCENTAGE_VIEWPORT_HEIGHT = AnimationTarget.PERCENTAGE_VIEWPORT_HEIGHT;
33 public static final short PERCENTAGE_VIEWPORT_SIZE = AnimationTarget.PERCENTAGE_VIEWPORT_SIZE;
34
35 /**
36 * Whether this trait can be animated.
37 */
38 protected boolean isAnimatable;
39
40 // /**
41 // * Whether animations of this trait can be additive.
42 // */
43 // protected boolean isAdditive;
44
45 /**
46 * The SVG type of this trait.
47 */
48 protected int type;
49
50 /**
51 * What percentages in this trait are relative to.
52 */
53 protected short percentageInterpretation;
54
55 /**
56 * Creates a new TraitInformation object.
57 */
58 public TraitInformation(boolean isAnimatable, // boolean isAdditive,
59 int type, short percentageInterpretation) {
60 this.isAnimatable = isAnimatable;
61 // this.isAdditive = isAdditive;
62 this.type = type;
63 this.percentageInterpretation = percentageInterpretation;
64 }
65
66 /**
67 * Creates a new TraitInformation object.
68 */
69 public TraitInformation(boolean isAnimatable, // boolean isAdditive,
70 int type) {
71 this.isAnimatable = isAnimatable;
72 // this.isAdditive = isAdditive;
73 this.type = type;
74 this.percentageInterpretation = -1;
75 }
76
77 /**
78 * Returns whether this trait is animatable.
79 */
80 public boolean isAnimatable() {
81 return isAnimatable;
82 }
83
84 // /**
85 // * Returns whether animations of this trait can be additive.
86 // */
87 // public boolean isAdditive() {
88 // return isAdditive;
89 // }
90
91 /**
92 * Returns the SVG type of this trait.
93 */
94 public int getType() {
95 return type;
96 }
97
98 /**
99 * Returns how percentage values in this trait are resolved.
100 */
101 public short getPercentageInterpretation() {
102 return percentageInterpretation;
103 }
104 }
105