root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / properties / panels / EnhancedPanel.java @ 10740
History | View | Annotate | Download (3.75 KB)
1 |
/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
|
20 |
package org.gvsig.rastertools.properties.panels; |
21 |
|
22 |
import java.awt.GridLayout; |
23 |
|
24 |
import javax.swing.JPanel; |
25 |
|
26 |
import org.gvsig.raster.grid.filter.RasterFilterList; |
27 |
import org.gvsig.raster.shared.IRasterDataset; |
28 |
import org.gvsig.raster.shared.IRasterProperties; |
29 |
import org.gvsig.rastertools.properties.dialog.IRegistrablePanel; |
30 |
|
31 |
import com.iver.andami.PluginServices; |
32 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
33 |
|
34 |
|
35 |
/**
|
36 |
* Panel para los controles de brillo y contrase .
|
37 |
*
|
38 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
39 |
*/
|
40 |
public class EnhancedPanel extends JPanel implements IRegistrablePanel{ |
41 |
final private static long serialVersionUID = 0; |
42 |
private EnhancedBrightnessContrastPanel bcPanel = null; |
43 |
private EnhancedWithTrimPanel trimPanel = null; |
44 |
private String id = "realce"; |
45 |
private EnhancedControl enhancedControl = null; |
46 |
|
47 |
/**
|
48 |
* Contructor
|
49 |
*/
|
50 |
public EnhancedPanel(){
|
51 |
super();
|
52 |
bcPanel = new EnhancedBrightnessContrastPanel();
|
53 |
trimPanel = new EnhancedWithTrimPanel();
|
54 |
id = PluginServices.getText(this, id);
|
55 |
initialize(); |
56 |
} |
57 |
|
58 |
|
59 |
private void initialize() { |
60 |
setLayout(new GridLayout(1, 2)); |
61 |
add(bcPanel); |
62 |
add(trimPanel); |
63 |
} |
64 |
|
65 |
|
66 |
/**
|
67 |
* Obtiene el panel de brillo y contraste
|
68 |
* @return EnhancedBrightnessContrastPanel
|
69 |
*/
|
70 |
public EnhancedBrightnessContrastPanel getBrightnessContrastPanel(){
|
71 |
return bcPanel;
|
72 |
} |
73 |
|
74 |
/**
|
75 |
* Obtiene el panel de realce con recorte de colas
|
76 |
* @return EnhancedWithTrimPanel
|
77 |
*/
|
78 |
public EnhancedWithTrimPanel getEnhancedWithTrimPanel(){
|
79 |
return trimPanel;
|
80 |
} |
81 |
|
82 |
/*
|
83 |
* (non-Javadoc)
|
84 |
* @see org.gvsig.rastertools.properties.dialog.IRegistrablePanel#accept()
|
85 |
*/
|
86 |
public void accept() { |
87 |
enhancedControl.accept(); |
88 |
} |
89 |
|
90 |
/*
|
91 |
* (non-Javadoc)
|
92 |
* @see org.gvsig.rastertools.properties.dialog.IRegistrablePanel#apply()
|
93 |
*/
|
94 |
public void apply() { |
95 |
enhancedControl.apply(); |
96 |
} |
97 |
|
98 |
/*
|
99 |
* (non-Javadoc)
|
100 |
* @see org.gvsig.rastertools.properties.dialog.IRegistrablePanel#cancel()
|
101 |
*/
|
102 |
public void cancel() { |
103 |
enhancedControl.cancel(); |
104 |
} |
105 |
|
106 |
/*
|
107 |
* (non-Javadoc)
|
108 |
* @see org.gvsig.rastertools.properties.dialog.IRegistrablePanel#getID()
|
109 |
*/
|
110 |
public String getID() { |
111 |
return id;
|
112 |
} |
113 |
|
114 |
/*
|
115 |
* (non-Javadoc)
|
116 |
* @see org.gvsig.rastertools.properties.dialog.IRegistrablePanel#setLayer(com.iver.cit.gvsig.fmap.layers.FLayer)
|
117 |
*/
|
118 |
public void setLayer(FLayer lyr) { |
119 |
IRasterDataset dataset = null;
|
120 |
RasterFilterList rfl = null;
|
121 |
|
122 |
if(lyr instanceof IRasterDataset) |
123 |
dataset = (IRasterDataset)lyr; |
124 |
|
125 |
if(lyr instanceof IRasterProperties) |
126 |
rfl = (((IRasterProperties)lyr).getRenderFilterList()); |
127 |
|
128 |
enhancedControl = new EnhancedControl(this, dataset, lyr, rfl); |
129 |
} |
130 |
|
131 |
/*
|
132 |
* (non-Javadoc)
|
133 |
* @see org.gvsig.rastertools.properties.dialog.IResizable#setComponentSize(int, int)
|
134 |
*/
|
135 |
public void setComponentSize(int w, int h) { |
136 |
} |
137 |
|
138 |
/*
|
139 |
* (non-Javadoc)
|
140 |
* @see org.gvsig.rastertools.properties.dialog.IRegistrablePanel#selectTab(java.lang.String)
|
141 |
*/
|
142 |
public void selectTab(String id) { |
143 |
} |
144 |
} |
145 |
|