001: /*
002:
003: Licensed to the Apache Software Foundation (ASF) under one or more
004: contributor license agreements. See the NOTICE file distributed with
005: this work for additional information regarding copyright ownership.
006: The ASF licenses this file to You under the Apache License, Version 2.0
007: (the "License"); you may not use this file except in compliance with
008: the License. You may obtain a copy of the License at
009:
010: http://www.apache.org/licenses/LICENSE-2.0
011:
012: Unless required by applicable law or agreed to in writing, software
013: distributed under the License is distributed on an "AS IS" BASIS,
014: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: See the License for the specific language governing permissions and
016: limitations under the License.
017:
018: */
019: package org.apache.batik.dom.svg;
020:
021: import org.apache.batik.dom.anim.AnimationTarget;
022:
023: /**
024: * Stores information about a specific XML attribute or CSS property.
025: *
026: * @version $Id: PreferenceDialog.java 498555 2007-01-22 08:09:33Z cam $
027: */
028: public class TraitInformation {
029:
030: // Constants for percentage interpretation.
031: public static final short PERCENTAGE_FONT_SIZE = AnimationTarget.PERCENTAGE_FONT_SIZE;
032: public static final short PERCENTAGE_VIEWPORT_WIDTH = AnimationTarget.PERCENTAGE_VIEWPORT_WIDTH;
033: public static final short PERCENTAGE_VIEWPORT_HEIGHT = AnimationTarget.PERCENTAGE_VIEWPORT_HEIGHT;
034: public static final short PERCENTAGE_VIEWPORT_SIZE = AnimationTarget.PERCENTAGE_VIEWPORT_SIZE;
035:
036: /**
037: * Whether this trait can be animated.
038: */
039: protected boolean isAnimatable;
040:
041: // /**
042: // * Whether animations of this trait can be additive.
043: // */
044: // protected boolean isAdditive;
045:
046: /**
047: * The SVG type of this trait.
048: */
049: protected int type;
050:
051: /**
052: * What percentages in this trait are relative to.
053: */
054: protected short percentageInterpretation;
055:
056: /**
057: * Creates a new TraitInformation object.
058: */
059: public TraitInformation(boolean isAnimatable, // boolean isAdditive,
060: int type, short percentageInterpretation) {
061: this .isAnimatable = isAnimatable;
062: // this.isAdditive = isAdditive;
063: this .type = type;
064: this .percentageInterpretation = percentageInterpretation;
065: }
066:
067: /**
068: * Creates a new TraitInformation object.
069: */
070: public TraitInformation(boolean isAnimatable, // boolean isAdditive,
071: int type) {
072: this .isAnimatable = isAnimatable;
073: // this.isAdditive = isAdditive;
074: this .type = type;
075: this .percentageInterpretation = -1;
076: }
077:
078: /**
079: * Returns whether this trait is animatable.
080: */
081: public boolean isAnimatable() {
082: return isAnimatable;
083: }
084:
085: // /**
086: // * Returns whether animations of this trait can be additive.
087: // */
088: // public boolean isAdditive() {
089: // return isAdditive;
090: // }
091:
092: /**
093: * Returns the SVG type of this trait.
094: */
095: public int getType() {
096: return type;
097: }
098:
099: /**
100: * Returns how percentage values in this trait are resolved.
101: */
102: public short getPercentageInterpretation() {
103: return percentageInterpretation;
104: }
105: }
|