001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package com.sun.perseus.model;
028:
029: /**
030: * The <code>BaseValue</code> interface is used to abstract either the
031: * original value of a trait (like 'x' on a <rect>) or a pseudo-trait
032: * (like '#text' on a <text> or '#motion' on <code>SVGLocatable</code>).
033: * It is implemented by <code>TraitAnim</code> and <code>Animation</code>
034: *
035: * @version $Id: BaseValue.java,v 1.4 2006/06/29 10:47:29 ln156897 Exp $
036: */
037: public interface BaseValue {
038: /**
039: * Returns the BaseValue as an array of objects. The dimensions of the
040: * returned value depend on the number of components in the trait. There are
041: * as many values as there are 'components' in the value. For example,
042: * a stroke-dash array trait value has as many components as there are dask
043: * lengths in the value. An SVGMatrix trait has six components.
044: * A coordinate trait has a single component.
045: *
046: * Then each object value can be a String or a float array. In the case of
047: * float arrays, each float array has as many entries as there are
048: * dimensions in the component value. For example, each stroke-dash array
049: * component has only one entry, because there is only on dimension for each
050: * dash or gap length. An RGB trait has 3 dimensions (one for r, one for g
051: * and one for b).
052: *
053: * The following table summarizes the trait types and their number of
054: * components and dimensions:
055: * <table>
056: * <th>
057: * <td>Trait Type</td>
058: * <td># components</td>
059: * <td># dimensions</td>
060: * </th>
061: * <tr>
062: * <td>String</td>
063: * <td>1</td>
064: * <td>NA</td>
065: * </tr>
066: * <tr>
067: * <td>Number</td>
068: * <td>1</td>
069: * <td>1</td>
070: * </tr>
071: * <tr>
072: * <td>Length/Coordinate</td>
073: * <td>1</td>
074: * <td>1</td>
075: * </tr>
076: * <tr>
077: * <td>List of XXX</td>
078: * <td>Number of entries in the list</td>
079: * <td>Same number of components as list entries.</td>
080: * </tr>
081: * <tr>
082: * <td>Angle</td>
083: * <td>1</td>
084: * <td>1</td>
085: * </tr>
086: * <tr>
087: * <td>Color</td>
088: * <td>1</td>
089: * <td>3</td>
090: * </tr>
091: * <tr>
092: * <td>transform list</td>
093: * <td>1</td>
094: * <td>6</td>
095: * </tr>
096: * <tr>
097: * <td>URI</td>
098: * <td>NA</td>
099: * <td>NA</td>
100: * </tr>
101: * </table>
102: * @return the base value as an Object array. The dimensions of the
103: * returned array depend on the trait.
104: */
105: Object[] getBaseValue();
106: }
|