001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/model/csct/resources/XDimension2D.java $
002    /*----------------    FILE HEADER  ------------------------------------------
003    
004    This file is part of deegree.
005    Copyright (C) 2001 by:
006    EXSE, Department of Geography, University of Bonn
007    http://www.giub.uni-bonn.de/exse/
008    lat/lon GmbH
009    http://www.lat-lon.de
010    
011    It has been implemented within SEAGIS - An OpenSource implementation of OpenGIS specification
012    (C) 2001, Institut de Recherche pour le D�veloppement (http://sourceforge.net/projects/seagis/)
013    SEAGIS Contacts:  Surveillance de l'Environnement Assist�e par Satellite
014                      Institut de Recherche pour le D�veloppement / US-Espace
015                      mailto:seasnet@teledetection.fr
016    
017    
018    This library is free software; you can redistribute it and/or
019    modify it under the terms of the GNU Lesser General Public
020    License as published by the Free Software Foundation; either
021    version 2.1 of the License, or (at your option) any later version.
022    
023    This library is distributed in the hope that it will be useful,
024    but WITHOUT ANY WARRANTY; without even the implied warranty of
025    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
026    Lesser General Public License for more details.
027    
028    You should have received a copy of the GNU Lesser General Public
029    License along with this library; if not, write to the Free Software
030    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
031    
032    Contact:
033    
034    Andreas Poth
035    lat/lon GmbH
036    Aennchenstr. 19
037    53115 Bonn
038    Germany
039    E-Mail: poth@lat-lon.de
040    
041    Klaus Greve
042    Department of Geography
043    University of Bonn
044    Meckenheimer Allee 166
045    53115 Bonn
046    Germany
047    E-Mail: klaus.greve@uni-bonn.de
048    
049                     
050     ---------------------------------------------------------------------------*/
051    package org.deegree.model.csct.resources;
052    
053    // Miscellaneous
054    import java.awt.geom.Dimension2D;
055    import java.io.Serializable;
056    
057    
058    /**
059     * Implement float and double version of {@link Dimension2D}. This class
060     * is only temporary; it will disaspear if <em>JavaSoft</em> implements
061     * <code>Dimension2D.Float</code> and <code>Dimension2D.Double</code>.
062     *
063     * @version 1.0
064     * @author Martin Desruisseaux
065     */
066    public final class XDimension2D
067    {
068        /**
069         * Do not allow instantiation of this class.
070         */
071        private XDimension2D()
072        {}
073    
074        /**
075         * Implement float version of {@link Dimension2D}. This class is
076         * temporary;  it will disaspear if <em>JavaSoft</em> implements
077         * <code>Dimension2D.Float</code> and <code>Dimension2D.Double</code>.
078         *
079         * @version 1.0
080         * @author Martin Desruisseaux
081         */
082        public static final class Float extends Dimension2D implements Serializable
083        {
084            /**
085             * Largeur de la dimension.
086             */
087            public float width;
088    
089            /**
090             * Hauteur de la dimension.
091             */
092            public float height;
093    
094            /**
095             * Construit un objet avec les dimensions (0,0).
096             */
097            public Float()
098            {}
099    
100            /**
101             * Construit un objet avec les dimensions sp�cifi�es.
102             * @param w largeur.
103             * @param h hauteur.
104             */
105            public Float(final float w, final float h)
106            {width=w; height=h;}
107    
108            /**
109             * Change les dimensions de cet objet.
110             * @param w largeur.
111             * @param h hauteur.
112             */
113            public void setSize(final double w, final double h)
114            {width=(float) w; height=(float) h;}
115    
116            /**
117             * Retourne la largeur.
118             */
119            public double getWidth()
120            {return width;}
121    
122            /**
123             * Retourne la hauteur.
124             */
125            public double getHeight()
126            {return height;}
127    
128            /**
129             * Retourne la dimension sous forme de cha�ne de caract�res.
130             * La cha�ne sera de la forme "<code>Dimension2D[45,76]</code>".
131             */
132            public String toString()
133            {return "Dimension2D["+width+','+height+']';}
134        }
135    
136        /**
137         * Implement double version of {@link Dimension2D}. This class is
138         * temporary;  it will disaspear if <em>JavaSoft</em> implements
139         * <code>Dimension2D.Float</code> and <code>Dimension2D.Double</code>.
140         *
141         * @version 1.0
142         * @author Martin Desruisseaux
143         */
144        public static final class Double extends Dimension2D implements Serializable
145        {
146            /**
147             * Largeur de la dimension.
148             */
149            public double width;
150    
151            /**
152             * Hauteur de la dimension.
153             */
154            public double height;
155    
156            /**
157             * Construit un objet avec les dimensions (0,0).
158             */
159            public Double()
160            {}
161    
162            /**
163             * Construit un objet avec les dimensions sp�cifi�es.
164             * @param w largeur.
165             * @param h hauteur.
166             */
167            public Double(final double w, final double h)
168            {width=w; height=h;}
169    
170            /**
171             * Change les dimensions de cet objet.
172             * @param w largeur.
173             * @param h hauteur.
174             */
175            public void setSize(final double w, final double h)
176            {width=w; height=h;}
177    
178            /**
179             * Retourne la largeur.
180             */
181            public double getWidth()
182            {return width;}
183    
184            /**
185             * Retourne la hauteur.
186             */
187            public double getHeight()
188            {return height;}
189    
190            /**
191             * Retourne la dimension sous forme de cha�ne de caract�res.
192             * La cha�ne sera de la forme "<code>Dimension2D[45,76]</code>".
193             */
194            public String toString()
195            {return "Dimension2D["+width+','+height+']';}
196        }
197    }