Statistics
| Revision:

root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / gui / layout / Size.java @ 2984

History | View | Annotate | Download (2.53 KB)

1 312 fernando
/*
2
 * Created on 19-may-2004
3
 *
4
 */
5 1103 fjp
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45 312 fernando
package com.iver.cit.gvsig.gui.layout;
46
47
import com.iver.utiles.XMLEntity;
48
49
50
/**
51
 * Clase que almacena la altura y anchura de un folio.
52
 *
53
 * @author Vicente Caballero Navarro
54
 */
55
public class Size {
56 1074 vcaballero
        private double alto;
57
        private double ancho;
58 312 fernando
59 1074 vcaballero
        /**
60
         * Creates a new Size object.
61
         *
62
         * @param al Altura
63
         * @param an Anchura
64
         */
65
        public Size(double al, double an) {
66
                alto = al;
67
                ancho = an;
68
        }
69 312 fernando
70 1074 vcaballero
        /**
71
         * Devuelve el alto del folio.
72
         *
73
         * @return altura.
74
         */
75
        public double getAlto() {
76
                return alto;
77
        }
78 312 fernando
79 1074 vcaballero
        /**
80
         * Devuelve la anchura del folio.
81
         *
82
         * @return Anchura.
83
         */
84
        public double getAncho() {
85
                return ancho;
86
        }
87 312 fernando
88 1074 vcaballero
        /**
89
         * Devuelve un Objeto XMLEntity con la informaci?n los atributos necesarios
90
         * para poder despu?s volver a crear el objeto original.
91
         *
92
         * @return XMLEntity.
93
         */
94
        public XMLEntity getXMLEntity() {
95
                XMLEntity xml = new XMLEntity();
96 1094 vcaballero
                xml.putProperty("className",this.getClass().getName());
97 1074 vcaballero
                xml.putProperty("ancho", ancho);
98
                xml.putProperty("alto", alto);
99 312 fernando
100 1074 vcaballero
                return xml;
101
        }
102 312 fernando
103 1074 vcaballero
        /**
104
         * Crea un Objeto de esta clase a partir de la informaci?n del XMLEntity.
105
         *
106
         * @param xml XMLEntity
107
         *
108
         * @return Objeto de esta clase.
109
         */
110
        public static Size createSize(XMLEntity xml) {
111
                Size size = new Size(xml.getDoubleProperty("alto"),
112
                                xml.getDoubleProperty("ancho"));
113 312 fernando
114 1074 vcaballero
                return size;
115
        }
116 312 fernando
}