001: /*
002:
003: Licensed to the Apache Software Foundation (ASF) under one or more
004: contributor license agreements. See the NOTICE file distributed with
005: this work for additional information regarding copyright ownership.
006: The ASF licenses this file to You under the Apache License, Version 2.0
007: (the "License"); you may not use this file except in compliance with
008: the License. You may obtain a copy of the License at
009:
010: http://www.apache.org/licenses/LICENSE-2.0
011:
012: Unless required by applicable law or agreed to in writing, software
013: distributed under the License is distributed on an "AS IS" BASIS,
014: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: See the License for the specific language governing permissions and
016: limitations under the License.
017:
018: */
019: package org.apache.batik.css.engine.value;
020:
021: import org.w3c.dom.DOMException;
022:
023: /**
024: * This class represents a computed property value.
025: *
026: * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
027: * @version $Id: ComputedValue.java 475477 2006-11-15 22:44:28Z cam $
028: */
029: public class ComputedValue implements Value {
030:
031: /**
032: * The cascaded value.
033: */
034: protected Value cascadedValue;
035:
036: /**
037: * The computed value.
038: */
039: protected Value computedValue;
040:
041: /**
042: * Creates a new ComputedValue object.
043: * @param cv The cascaded value.
044: */
045: public ComputedValue(Value cv) {
046: cascadedValue = cv;
047: }
048:
049: /**
050: * Returns the computed value.
051: */
052: public Value getComputedValue() {
053: return computedValue;
054: }
055:
056: /**
057: * Returns the cascaded value.
058: */
059: public Value getCascadedValue() {
060: return cascadedValue;
061: }
062:
063: /**
064: * Sets the computed value.
065: */
066: public void setComputedValue(Value v) {
067: computedValue = v;
068: }
069:
070: /**
071: * Implements {@link Value#getCssText()}.
072: */
073: public String getCssText() {
074: return computedValue.getCssText();
075: }
076:
077: /**
078: * Implements {@link Value#getCssValueType()}.
079: */
080: public short getCssValueType() {
081: return computedValue.getCssValueType();
082: }
083:
084: /**
085: * Implements {@link Value#getPrimitiveType()}.
086: */
087: public short getPrimitiveType() {
088: return computedValue.getPrimitiveType();
089: }
090:
091: /**
092: * Implements {@link Value#getFloatValue()}.
093: */
094: public float getFloatValue() throws DOMException {
095: return computedValue.getFloatValue();
096: }
097:
098: /**
099: * Implements {@link Value#getStringValue()}.
100: */
101: public String getStringValue() throws DOMException {
102: return computedValue.getStringValue();
103: }
104:
105: /**
106: * Implements {@link Value#getRed()}.
107: */
108: public Value getRed() throws DOMException {
109: return computedValue.getRed();
110: }
111:
112: /**
113: * Implements {@link Value#getGreen()}.
114: */
115: public Value getGreen() throws DOMException {
116: return computedValue.getGreen();
117: }
118:
119: /**
120: * Implements {@link Value#getBlue()}.
121: */
122: public Value getBlue() throws DOMException {
123: return computedValue.getBlue();
124: }
125:
126: /**
127: * Implements {@link Value#getLength()}.
128: */
129: public int getLength() throws DOMException {
130: return computedValue.getLength();
131: }
132:
133: /**
134: * Implements {@link Value#item(int)}.
135: */
136: public Value item(int index) throws DOMException {
137: return computedValue.item(index);
138: }
139:
140: /**
141: * Implements {@link Value#getTop()}.
142: */
143: public Value getTop() throws DOMException {
144: return computedValue.getTop();
145: }
146:
147: /**
148: * Implements {@link Value#getRight()}.
149: */
150: public Value getRight() throws DOMException {
151: return computedValue.getRight();
152: }
153:
154: /**
155: * Implements {@link Value#getBottom()}.
156: */
157: public Value getBottom() throws DOMException {
158: return computedValue.getBottom();
159: }
160:
161: /**
162: * Implements {@link Value#getLeft()}.
163: */
164: public Value getLeft() throws DOMException {
165: return computedValue.getLeft();
166: }
167:
168: /**
169: * Implements {@link Value#getIdentifier()}.
170: */
171: public String getIdentifier() throws DOMException {
172: return computedValue.getIdentifier();
173: }
174:
175: /**
176: * Implements {@link Value#getListStyle()}.
177: */
178: public String getListStyle() throws DOMException {
179: return computedValue.getListStyle();
180: }
181:
182: /**
183: * Implements {@link Value#getSeparator()}.
184: */
185: public String getSeparator() throws DOMException {
186: return computedValue.getSeparator();
187: }
188: }
|