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.css2;
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.ValueConstants;
25 import org.apache.batik.css.engine.value.ValueManager;
26 import org.apache.batik.util.CSSConstants;
27 import org.apache.batik.util.SVGTypes;
28
29 /**
30  * This class provides a manager for the 'display' property values.
31  *
32  * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
33  * @version $Id: DisplayManager.java 1733416 2016-03-03 07:07:13Z gadams $
34  */

35 public class DisplayManager extends IdentifierManager {
36
37     /**
38      * The identifier values.
39      */

40     protected static final StringMap values = new StringMap();
41     static {
42         values.put(CSSConstants.CSS_BLOCK_VALUE,
43                    ValueConstants.BLOCK_VALUE);
44         values.put(CSSConstants.CSS_COMPACT_VALUE,
45                    ValueConstants.COMPACT_VALUE);
46         values.put(CSSConstants.CSS_INLINE_VALUE,
47                    ValueConstants.INLINE_VALUE);
48         values.put(CSSConstants.CSS_INLINE_TABLE_VALUE,
49                    ValueConstants.INLINE_TABLE_VALUE);
50         values.put(CSSConstants.CSS_LIST_ITEM_VALUE,
51                    ValueConstants.LIST_ITEM_VALUE);
52         values.put(CSSConstants.CSS_MARKER_VALUE,
53                    ValueConstants.MARKER_VALUE);
54         values.put(CSSConstants.CSS_NONE_VALUE,
55                    ValueConstants.NONE_VALUE);
56         values.put(CSSConstants.CSS_RUN_IN_VALUE,
57                    ValueConstants.RUN_IN_VALUE);
58         values.put(CSSConstants.CSS_TABLE_VALUE,
59                    ValueConstants.TABLE_VALUE);
60         values.put(CSSConstants.CSS_TABLE_CAPTION_VALUE,
61                    ValueConstants.TABLE_CAPTION_VALUE);
62         values.put(CSSConstants.CSS_TABLE_CELL_VALUE,
63                    ValueConstants.TABLE_CELL_VALUE);
64         values.put(CSSConstants.CSS_TABLE_COLUMN_VALUE,
65                    ValueConstants.TABLE_COLUMN_VALUE);
66         values.put(CSSConstants.CSS_TABLE_COLUMN_GROUP_VALUE,
67                    ValueConstants.TABLE_COLUMN_GROUP_VALUE);
68         values.put(CSSConstants.CSS_TABLE_FOOTER_GROUP_VALUE,
69                    ValueConstants.TABLE_FOOTER_GROUP_VALUE);
70         values.put(CSSConstants.CSS_TABLE_HEADER_GROUP_VALUE,
71                    ValueConstants.TABLE_HEADER_GROUP_VALUE);
72         values.put(CSSConstants.CSS_TABLE_ROW_VALUE,
73                    ValueConstants.TABLE_ROW_VALUE);
74         values.put(CSSConstants.CSS_TABLE_ROW_GROUP_VALUE,
75                    ValueConstants.TABLE_ROW_GROUP_VALUE);
76     }
77
78     /**
79      * Implements {@link
80      * org.apache.batik.css.engine.value.ValueManager#isInheritedProperty()}.
81      */

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

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

96     public boolean isAdditiveProperty() {
97         return false;
98     }
99
100     /**
101      * Implements {@link ValueManager#getPropertyType()}.
102      */

103     public int getPropertyType() {
104         return SVGTypes.TYPE_IDENT;
105     }
106
107     /**
108      * Implements {@link
109      * org.apache.batik.css.engine.value.ValueManager#getPropertyName()}.
110      */

111     public String getPropertyName() {
112         return CSSConstants.CSS_DISPLAY_PROPERTY;
113     }
114
115     /**
116      * Implements {@link
117      * org.apache.batik.css.engine.value.ValueManager#getDefaultValue()}.
118      */

119     public Value getDefaultValue() {
120         return ValueConstants.INLINE_VALUE;
121     }
122
123     /**
124      * Implements {@link IdentifierManager#getIdentifiers()}.
125      */

126     public StringMap getIdentifiers() {
127         return values;
128     }
129 }
130