Statistics
| Revision:

svn-gvsig-desktop / branches / v10 / extensions / DielmoOpenLidar / src / com / dielmo / gvsig / lidar / extensions / LiDAR_Mapping.java @ 25419

History | View | Annotate | Download (3.13 KB)

1
/* DielmoOpenLiDAR
2
 *
3
 * Copyright (C) 2008 DIELMO 3D S.L. (DIELMO) and Infrastructures  
4
 * and Transports Department of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 *
21
 * For more information, contact:
22
 *
23
 * DIELMO 3D S.L.
24
 * Plaza Vicente Andr?s Estell?s 1 Bajo E
25
 * 46950 Xirivella, Valencia
26
 * SPAIN
27
 *   
28
 * +34 963137212
29
 * dielmo@dielmo.com
30
 * www.dielmo.com
31
 * 
32
 * or
33
 * 
34
 * Generalitat Valenciana
35
 * Conselleria d'Infraestructures i Transport
36
 * Av. Blasco Ib??ez, 50
37
 * 46010 VALENCIA
38
 * SPAIN
39
 *
40
 * +34 963862235
41
 * gvsig@gva.es
42
 * www.gvsig.gva.es
43
 */
44

    
45
/*
46
 * AUTHORS (In addition to DIELMO and CIT):
47
 *  
48
 */
49

    
50
package com.dielmo.gvsig.lidar.extensions;
51

    
52
import com.iver.andami.PluginServices;
53
import com.iver.utiles.XMLEntity;
54

    
55

    
56
/**
57
 * Mapping of Lidar layers.
58
 *
59
 * @author Oscar Garcia
60
 */
61
public class LiDAR_Mapping {
62
        public static String DEFAULTPATH = "";
63
    public static String DEFAULT_PATH_LEGEND = "default_path_legend_text";
64
    public static int SIZE_PIXEL = 5;
65
    public static String DEFAULT_MAX_SIZE_PIXEL = "default_max_size_pixel";
66
   
67
        public static PluginServices ps = null;
68
        static {
69
                new LiDAR_Mapping();
70
        }
71
    public LiDAR_Mapping() {
72
            ps = PluginServices.getPluginServices(this);
73
                XMLEntity xml = ps.getPersistentXML();
74

    
75
                // default legend
76
                if (xml.contains(DEFAULT_PATH_LEGEND)) {        
77
                        String text=xml.getStringProperty(DEFAULT_PATH_LEGEND);
78
                        LiDAR_Mapping.DEFAULTPATH=text;
79
                }else{
80
                        LiDAR_Mapping.DEFAULTPATH="";
81
                }
82
                
83
                // size of pixel
84
                if (xml.contains(DEFAULT_MAX_SIZE_PIXEL)) {        
85
                        int valueSize = xml.getIntProperty(DEFAULT_MAX_SIZE_PIXEL);
86
                        LiDAR_Mapping.SIZE_PIXEL=valueSize;
87
                }else{
88
                        LiDAR_Mapping.SIZE_PIXEL=5;
89
                }
90
    }
91
  
92
    /**
93
     * Path of legend predefined
94
     *
95
     * @return Path of legend predefined in preferences
96
     */
97
    public String getPathLegend() {
98
        return DEFAULTPATH;
99
    }
100
    
101
    /**
102
     * get maximum size of pixel.
103
     *
104
     * @return maximum size of pixel
105
     */
106
    public int getSizePixel() {
107
        return SIZE_PIXEL;
108
    }
109

    
110
    /**
111
     * set path of legend
112
     * 
113
     * @param path of the new legend.
114
     */
115
        public static void storeValuesLegend(String text) {
116
                XMLEntity xml = ps.getPersistentXML();
117

    
118
                xml.putProperty(DEFAULT_PATH_LEGEND,text);
119
        }
120

    
121
        /**
122
         * set size of pixel.
123
         * 
124
         * @param size new size of the pixel
125
         */
126
        public static void storeValuesSizePixel(int size) {
127
                XMLEntity xml = ps.getPersistentXML();
128
                xml.putProperty(DEFAULT_MAX_SIZE_PIXEL,size);
129
        }
130
}