Statistics
| Revision:

svn-gvsig-desktop / trunk / prototypes / mobile / desktop / extensions / extExportMobile / src / es / prodevelop / gvsig / exportMobile / xml / Bounds.java @ 19124

History | View | Annotate | Download (1.17 KB)

1
package es.prodevelop.gvsig.exportMobile.xml;
2

    
3
import java.awt.geom.Rectangle2D;
4
import com.iver.cit.gvsig.fmap.rendering.XmlBuilder;
5

    
6
/**
7
 * Get bounds of view and create new tags to the xml project
8
 * @author Anabel Moreno
9
 *
10
 */
11
public class Bounds extends Rectangle2D.Double implements XMLgetter {
12
        public static final String tag = "bounds";
13
        
14
        public XmlBuilder xml;
15
        
16
        public static Bounds createBounds(Rectangle2D rect){
17
                Bounds bounds = new Bounds();
18
                bounds.setRect(rect);
19
                return bounds;
20
        }
21
        
22
        public void setXML(XmlBuilder xml_builder){
23
                
24
                this.xml = xml_builder;
25
        }
26
        
27
        public void createXML(){
28
                
29
                //<Bounds>
30
                xml.openTag(XmlProjectTags.B_BOX);
31
                
32
                        //<xMin>
33
                        xml.writeTag(XmlProjectTags.X_MIN,java.lang.Double.toString(this.getMinX()));
34
                        //</xMin>
35
                        
36
                        //<xMax>
37
                        xml.writeTag(XmlProjectTags.X_MAX,java.lang.Double.toString(this.getMaxX()));
38
                        //</xMax>
39
                        
40
                        //<yMin>
41
                        xml.writeTag(XmlProjectTags.Y_MIN,java.lang.Double.toString(this.getMinY()));
42
                        //</yMin>
43
                        
44
                        //<yMax>
45
                        xml.writeTag(XmlProjectTags.Y_MAX,java.lang.Double.toString(this.getMaxY()));
46
                        //</yMax>
47
                        
48
                xml.closeTag();
49
                //</Bounds>
50
        }
51
        
52
}