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.CSSEngine;
22 import org.apache.batik.css.engine.value.AbstractValueFactory;
23 import org.apache.batik.css.engine.value.ShorthandManager;
24 import org.apache.batik.css.engine.value.ValueManager;
25 import org.apache.batik.util.CSSConstants;
26 import org.w3c.css.sac.LexicalUnit;
27 import org.w3c.dom.DOMException;
28
29 /**
30 * This class represents an object which provide support for the
31 * 'marker' shorthand properties.
32 *
33 * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
34 * @version $Id: MarkerShorthandManager.java 1733416 2016-03-03 07:07:13Z gadams $
35 */
36 public class MarkerShorthandManager
37 extends AbstractValueFactory
38 implements ShorthandManager {
39
40 /**
41 * Implements {@link ValueManager#getPropertyName()}.
42 */
43 public String getPropertyName() {
44 return CSSConstants.CSS_MARKER_PROPERTY;
45 }
46
47 /**
48 * Implements {@link ShorthandManager#isAnimatableProperty()}.
49 */
50 public boolean isAnimatableProperty() {
51 return true;
52 }
53
54 /**
55 * Implements {@link ShorthandManager#isAdditiveProperty()}.
56 */
57 public boolean isAdditiveProperty() {
58 return false;
59 }
60
61 /**
62 * Implements {@link ShorthandManager#setValues(CSSEngine,ShorthandManager.PropertyHandler,LexicalUnit,boolean)}.
63 */
64 public void setValues(CSSEngine eng,
65 ShorthandManager.PropertyHandler ph,
66 LexicalUnit lu,
67 boolean imp)
68 throws DOMException {
69 ph.property(CSSConstants.CSS_MARKER_END_PROPERTY, lu, imp);
70 ph.property(CSSConstants.CSS_MARKER_MID_PROPERTY, lu, imp);
71 ph.property(CSSConstants.CSS_MARKER_START_PROPERTY, lu, imp);
72 }
73 }
74