01: /*
02:
03: Licensed to the Apache Software Foundation (ASF) under one or more
04: contributor license agreements. See the NOTICE file distributed with
05: this work for additional information regarding copyright ownership.
06: The ASF licenses this file to You under the Apache License, Version 2.0
07: (the "License"); you may not use this file except in compliance with
08: the License. You may obtain a copy of the License at
09:
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.LengthManager;
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.w3c.css.sac.LexicalUnit;
27: import org.apache.batik.util.SVGTypes;
28:
29: import org.w3c.dom.DOMException;
30:
31: /**
32: * This class provides a factory for the 'stroke-dashoffset' property values.
33: *
34: * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
35: * @version $Id: StrokeDashoffsetManager.java 475685 2006-11-16 11:16:05Z cam $
36: */
37: public class StrokeDashoffsetManager extends LengthManager {
38:
39: /**
40: * Implements {@link ValueManager#isInheritedProperty()}.
41: */
42: public boolean isInheritedProperty() {
43: return true;
44: }
45:
46: /**
47: * Implements {@link ValueManager#isAnimatableProperty()}.
48: */
49: public boolean isAnimatableProperty() {
50: return true;
51: }
52:
53: /**
54: * Implements {@link ValueManager#isAdditiveProperty()}.
55: */
56: public boolean isAdditiveProperty() {
57: return true;
58: }
59:
60: /**
61: * Implements {@link ValueManager#getPropertyType()}.
62: */
63: public int getPropertyType() {
64: return SVGTypes.TYPE_LENGTH_OR_INHERIT;
65: }
66:
67: /**
68: * Implements {@link ValueManager#getPropertyName()}.
69: */
70: public String getPropertyName() {
71: return CSSConstants.CSS_STROKE_DASHOFFSET_PROPERTY;
72: }
73:
74: /**
75: * Implements {@link ValueManager#getDefaultValue()}.
76: */
77: public Value getDefaultValue() {
78: return SVGValueConstants.NUMBER_0;
79: }
80:
81: /**
82: * Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
83: */
84: public Value createValue(LexicalUnit lu, CSSEngine engine)
85: throws DOMException {
86: if (lu.getLexicalUnitType() == LexicalUnit.SAC_INHERIT) {
87: return SVGValueConstants.INHERIT_VALUE;
88: }
89: return super .createValue(lu, engine);
90: }
91:
92: /**
93: * Indicates the orientation of the property associated with
94: * this manager.
95: */
96: protected int getOrientation() {
97: return BOTH_ORIENTATION;
98: }
99: }
|