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 'color-interpolation' property values.
30 *
31 * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
32 * @version $Id: ColorInterpolationManager.java 1733416 2016-03-03 07:07:13Z gadams $
33 */
34 public class ColorInterpolationManager 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_LINEARRGB_VALUE,
44 SVGValueConstants.LINEARRGB_VALUE);
45 values.put(CSSConstants.CSS_SRGB_VALUE,
46 SVGValueConstants.SRGB_VALUE);
47 }
48
49 /**
50 * Implements {@link
51 * org.apache.batik.css.engine.value.ValueManager#isInheritedProperty()}.
52 */
53 public boolean isInheritedProperty() {
54 return true;
55 }
56
57 /**
58 * Implements {@link ValueManager#isAnimatableProperty()}.
59 */
60 public boolean isAnimatableProperty() {
61 return true;
62 }
63
64 /**
65 * Implements {@link ValueManager#isAdditiveProperty()}.
66 */
67 public boolean isAdditiveProperty() {
68 return false;
69 }
70
71 /**
72 * Implements {@link ValueManager#getPropertyType()}.
73 */
74 public int getPropertyType() {
75 return SVGTypes.TYPE_IDENT;
76 }
77
78 /**
79 * Implements {@link
80 * org.apache.batik.css.engine.value.ValueManager#getPropertyName()}.
81 */
82 public String getPropertyName() {
83 return CSSConstants.CSS_COLOR_INTERPOLATION_PROPERTY;
84 }
85
86 /**
87 * Implements {@link
88 * org.apache.batik.css.engine.value.ValueManager#getDefaultValue()}.
89 */
90 public Value getDefaultValue() {
91 return SVGValueConstants.SRGB_VALUE;
92 }
93
94 /**
95 * Implements {@link IdentifierManager#getIdentifiers()}.
96 */
97 public StringMap getIdentifiers() {
98 return values;
99 }
100 }
101