KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > css > engine > value > svg > StrokeWidthManager


1 /*
2
3    Copyright 2002-2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.css.engine.value.svg;
19
20 import org.apache.batik.css.engine.CSSEngine;
21 import org.apache.batik.css.engine.value.LengthManager;
22 import org.apache.batik.css.engine.value.Value;
23 import org.apache.batik.css.engine.value.ValueManager;
24 import org.apache.batik.util.CSSConstants;
25 import org.w3c.css.sac.LexicalUnit;
26 import org.w3c.dom.DOMException JavaDoc;
27
28 /**
29  * This class provides a factory for the 'stroke-width' property values.
30  *
31  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
32  * @version $Id: StrokeWidthManager.java,v 1.5 2005/03/27 08:58:31 cam Exp $
33  */

34 public class StrokeWidthManager extends LengthManager {
35     
36     /**
37      * Implements {@link ValueManager#isInheritedProperty()}.
38      */

39     public boolean isInheritedProperty() {
40     return true;
41     }
42
43     /**
44      * Implements {@link ValueManager#getPropertyName()}.
45      */

46     public String JavaDoc getPropertyName() {
47     return CSSConstants.CSS_STROKE_WIDTH_PROPERTY;
48     }
49     
50     /**
51      * Implements {@link ValueManager#getDefaultValue()}.
52      */

53     public Value getDefaultValue() {
54         return SVGValueConstants.NUMBER_1;
55     }
56
57     /**
58      * Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
59      */

60     public Value createValue(LexicalUnit lu, CSSEngine engine)
61         throws DOMException JavaDoc {
62         if (lu.getLexicalUnitType() == LexicalUnit.SAC_INHERIT) {
63             return SVGValueConstants.INHERIT_VALUE;
64         }
65         return super.createValue(lu, engine);
66     }
67
68
69     /**
70      * Indicates the orientation of the property associated with
71      * this manager.
72      */

73     protected int getOrientation() {
74         return BOTH_ORIENTATION;
75     }
76 }
77
Popular Tags