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.css.engine.value.svg;
20
21 import org.apache.batik.css.engine.value.IdentifierManager;
22 import org.apache.batik.css.engine.value.StringMap;
23 import org.apache.batik.css.engine.value.Value;
24 import org.apache.batik.css.engine.value.ValueManager;
25 import org.apache.batik.util.CSSConstants;
26 import org.apache.batik.util.SVGTypes;
27
28 /**
29  * This class provides a manager for the 'alignment-baseline' property values.
30  *
31  * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
32  * @version $Id: DominantBaselineManager.java 1733416 2016-03-03 07:07:13Z gadams $
33  */

34 public class DominantBaselineManager extends IdentifierManager {
35
36     /**
37      * The identifier values.
38      */

39     protected static final StringMap values = new StringMap();
40     static {
41         values.put(CSSConstants.CSS_AUTO_VALUE,
42                    SVGValueConstants.AUTO_VALUE);
43         values.put(CSSConstants.CSS_ALPHABETIC_VALUE,
44                    SVGValueConstants.ALPHABETIC_VALUE);
45         values.put(CSSConstants.CSS_CENTRAL_VALUE,
46                    SVGValueConstants.CENTRAL_VALUE);
47         values.put(CSSConstants.CSS_HANGING_VALUE,
48                    SVGValueConstants.HANGING_VALUE);
49         values.put(CSSConstants.CSS_IDEOGRAPHIC_VALUE,
50                    SVGValueConstants.IDEOGRAPHIC_VALUE);
51         values.put(CSSConstants.CSS_MATHEMATICAL_VALUE,
52                    SVGValueConstants.MATHEMATICAL_VALUE);
53         values.put(CSSConstants.CSS_MIDDLE_VALUE,
54                    SVGValueConstants.MIDDLE_VALUE);
55         values.put(CSSConstants.CSS_NO_CHANGE_VALUE,
56                    SVGValueConstants.NO_CHANGE_VALUE);
57         values.put(CSSConstants.CSS_RESET_SIZE_VALUE,
58                    SVGValueConstants.RESET_SIZE_VALUE);
59         values.put(CSSConstants.CSS_TEXT_AFTER_EDGE_VALUE,
60                    SVGValueConstants.TEXT_AFTER_EDGE_VALUE);
61         values.put(CSSConstants.CSS_TEXT_BEFORE_EDGE_VALUE,
62                    SVGValueConstants.TEXT_BEFORE_EDGE_VALUE);
63         values.put(CSSConstants.CSS_TEXT_BOTTOM_VALUE,
64                    SVGValueConstants.TEXT_BOTTOM_VALUE);
65         values.put(CSSConstants.CSS_TEXT_TOP_VALUE,
66                    SVGValueConstants.TEXT_TOP_VALUE);
67         values.put(CSSConstants.CSS_USE_SCRIPT_VALUE,
68                    SVGValueConstants.USE_SCRIPT_VALUE);
69     }
70
71     /**
72      * Implements {@link
73      * org.apache.batik.css.engine.value.ValueManager#isInheritedProperty()}.
74      */

75     public boolean isInheritedProperty() {
76         return false;
77     }
78
79     /**
80      * Implements {@link ValueManager#isAnimatableProperty()}.
81      */

82     public boolean isAnimatableProperty() {
83         return true;
84     }
85
86     /**
87      * Implements {@link ValueManager#isAdditiveProperty()}.
88      */

89     public boolean isAdditiveProperty() {
90         return false;
91     }
92
93     /**
94      * Implements {@link ValueManager#getPropertyType()}.
95      */

96     public int getPropertyType() {
97         return SVGTypes.TYPE_IDENT;
98     }
99
100     /**
101      * Implements {@link
102      * org.apache.batik.css.engine.value.ValueManager#getPropertyName()}.
103      */

104     public String getPropertyName() {
105         return CSSConstants.CSS_DOMINANT_BASELINE_PROPERTY;
106     }
107
108     /**
109      * Implements {@link
110      * org.apache.batik.css.engine.value.ValueManager#getDefaultValue()}.
111      */

112     public Value getDefaultValue() {
113         return SVGValueConstants.AUTO_VALUE;
114     }
115
116     /**
117      * Implements {@link IdentifierManager#getIdentifiers()}.
118      */

119     public StringMap getIdentifiers() {
120         return values;
121     }
122 }
123