gvsig-raster / org.gvsig.raster.tools / trunk / org.gvsig.raster.tools / org.gvsig.raster.tools.app / org.gvsig.raster.tools.app.basic / src / main / java / org / gvsig / raster / tools / app / basic / tool / infobypoint / gui / InfoByPointDataModel.java @ 1148
History | View | Annotate | Download (2.75 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* 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 |
*/
|
22 |
package org.gvsig.raster.tools.app.basic.tool.infobypoint.gui; |
23 |
|
24 |
import java.awt.geom.Point2D; |
25 |
import java.util.ArrayList; |
26 |
import java.util.List; |
27 |
|
28 |
public class InfoByPointDataModel { |
29 |
private static final int LONG_STRING = 22; |
30 |
public int bands = 0; |
31 |
public List<Double> bandsValues = new ArrayList<Double>(); |
32 |
public Point2D pixelPoint = new Point2D.Double(); |
33 |
public Point2D worldPoint = new Point2D.Double(); |
34 |
public Point2D viewPoint = new Point2D.Double(); |
35 |
public int[] argb = new int[4]; |
36 |
public double[] cmyk = new double[4]; |
37 |
public double[] hsl = new double[3]; |
38 |
public List<String> layers = new ArrayList<String>(); |
39 |
|
40 |
public void setBandValues(double[] list) { |
41 |
bandsValues.clear(); |
42 |
for (int i = 0; i < list.length; i++) { |
43 |
bandsValues.add(list[i]); |
44 |
} |
45 |
} |
46 |
|
47 |
public void setNumberOfBands(int n) { |
48 |
this.bands = n;
|
49 |
} |
50 |
|
51 |
public void setLayerList(String[] list) { |
52 |
layers.clear(); |
53 |
for (int i = 0; i < list.length; i++) { |
54 |
layers.add(list[i]); |
55 |
} |
56 |
} |
57 |
|
58 |
public void setARGB(int a, int r, int g, int b) { |
59 |
argb[0] = a;
|
60 |
argb[1] = r;
|
61 |
argb[2] = g;
|
62 |
argb[3] = b;
|
63 |
} |
64 |
|
65 |
public void setCMYK(double[] cmyk) { |
66 |
this.cmyk = cmyk;
|
67 |
} |
68 |
|
69 |
public void setHSL(double h, double s, double l) { |
70 |
hsl[0] = h;
|
71 |
hsl[1] = s;
|
72 |
hsl[2] = l;
|
73 |
} |
74 |
|
75 |
public void setPixelPoint(double x, double y) { |
76 |
pixelPoint.setLocation(x, y); |
77 |
} |
78 |
|
79 |
public void setWorldPoint(double x, double y) { |
80 |
worldPoint.setLocation(x, y); |
81 |
} |
82 |
|
83 |
public void setViewPoint(double x, double y) { |
84 |
viewPoint.setLocation(x, y); |
85 |
} |
86 |
|
87 |
public String getFormatedLayerName(int i) { |
88 |
return "..." + layers.get(i).substring(layers.get(i).length() - LONG_STRING, layers.get(i).length()); |
89 |
} |
90 |
} |