Revision 43803
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/pom.xml | ||
---|---|---|
26 | 26 |
<module>org.gvsig.symbology</module> |
27 | 27 |
<module>org.gvsig.tools.evaluator.sqljep</module> |
28 | 28 |
<module>org.gvsig.about</module> |
29 |
<module>org.gvsig.timesupport</module> |
|
30 |
<module>org.gvsig.expressionevaluator</module> |
|
29 |
<module>org.gvsig.timesupport</module>
|
|
30 |
<module>org.gvsig.expressionevaluator</module>
|
|
31 | 31 |
<module>org.gvsig.temporarystorage</module> |
32 |
<module>org.gvsig.raster</module> |
|
33 |
<module>org.gvsig.raster.legend</module> |
|
34 |
<module>org.gvsig.fmap.mapcontext.swing</module> |
|
35 |
<module>org.gvsig.raster.tools</module> |
|
32 | 36 |
</modules> |
33 | 37 |
</project> |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.desktop.library</artifactId> |
|
6 |
<version>2.0.221-SNAPSHOT</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.fmap.mapcontext.swing</artifactId> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<name>org.gvsig.fmap.mapcontext.swing</name> |
|
12 |
<modules> |
|
13 |
<module>org.gvsig.fmap.mapcontext.swing.api</module> |
|
14 |
<module>org.gvsig.fmap.mapcontext.swing.impl</module> |
|
15 |
</modules> |
|
16 |
</project> |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/BandsPanelController.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2017 gvSIG Association |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.fmap.mapcontext.raster.swing.impl.bands; |
|
24 |
|
|
25 |
import java.awt.color.ColorSpace; |
|
26 |
import java.awt.event.ActionEvent; |
|
27 |
import java.awt.event.ActionListener; |
|
28 |
import java.awt.event.ItemEvent; |
|
29 |
import java.awt.event.ItemListener; |
|
30 |
import java.io.File; |
|
31 |
import java.util.ArrayList; |
|
32 |
import java.util.Iterator; |
|
33 |
import java.util.List; |
|
34 |
import java.util.Locale; |
|
35 |
|
|
36 |
import javax.swing.JComponent; |
|
37 |
import javax.swing.JFileChooser; |
|
38 |
import javax.swing.JOptionPane; |
|
39 |
import javax.swing.ListSelectionModel; |
|
40 |
import javax.swing.event.ListSelectionEvent; |
|
41 |
import javax.swing.event.ListSelectionListener; |
|
42 |
import javax.swing.filechooser.FileFilter; |
|
43 |
import javax.swing.table.DefaultTableColumnModel; |
|
44 |
import javax.swing.table.TableColumn; |
|
45 |
import javax.swing.table.TableColumnModel; |
|
46 |
import javax.swing.table.TableModel; |
|
47 |
|
|
48 |
import org.slf4j.Logger; |
|
49 |
import org.slf4j.LoggerFactory; |
|
50 |
|
|
51 |
import org.gvsig.fmap.dal.DALLocator; |
|
52 |
import org.gvsig.fmap.dal.DataManager; |
|
53 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
|
54 |
import org.gvsig.fmap.dal.exception.DataException; |
|
55 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
56 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
57 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
58 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor; |
|
59 |
import org.gvsig.fmap.dal.raster.api.RasterStore; |
|
60 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter; |
|
61 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
|
62 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
|
63 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
64 |
import org.gvsig.fmap.mapcontext.raster.api.RasterLayer; |
|
65 |
import org.gvsig.fmap.mapcontext.raster.swing.bands.BandsPanel; |
|
66 |
import org.gvsig.raster.lib.buffer.api.BufferLocator; |
|
67 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
|
68 |
import org.gvsig.raster.lib.buffer.api.NoData; |
|
69 |
import org.gvsig.raster.lib.legend.api.RasterLegend; |
|
70 |
import org.gvsig.raster.lib.legend.api.RasterLegendLocator; |
|
71 |
import org.gvsig.raster.lib.legend.api.RasterLegendManager; |
|
72 |
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation; |
|
73 |
import org.gvsig.tools.ToolsLocator; |
|
74 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
75 |
import org.gvsig.tools.dynobject.DynObject; |
|
76 |
import org.gvsig.tools.i18n.I18nManager; |
|
77 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
78 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
|
79 |
|
|
80 |
/** |
|
81 |
* @author fdiaz |
|
82 |
* |
|
83 |
*/ |
|
84 |
public class BandsPanelController extends BandsPanelView implements BandsPanel, ActionListener, ListSelectionListener { |
|
85 |
|
|
86 |
/** |
|
87 |
* |
|
88 |
*/ |
|
89 |
private static final long serialVersionUID = 8255630092178065352L; |
|
90 |
@SuppressWarnings("unused") |
|
91 |
private static final Logger LOG = LoggerFactory.getLogger(BandsPanelController.class); |
|
92 |
private RasterLayer layer; |
|
93 |
|
|
94 |
private static final String RASTER_FILTER = "All_raster_supported"; |
|
95 |
|
|
96 |
// FLayer layer; |
|
97 |
|
|
98 |
/** |
|
99 |
* @param layer |
|
100 |
*/ |
|
101 |
@SuppressWarnings("unchecked") |
|
102 |
public BandsPanelController() { |
|
103 |
DisposeUtils.bind(this); |
|
104 |
translate(); |
|
105 |
initializeComponents(); |
|
106 |
} |
|
107 |
|
|
108 |
private void initializeComponents() { |
|
109 |
this.btnAdd.addActionListener(this); |
|
110 |
this.btnRemove.addActionListener(this); |
|
111 |
tblBands.setRowSelectionAllowed(true); |
|
112 |
tblBands.setColumnSelectionAllowed(false); |
|
113 |
tblBands.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
|
114 |
tblBands.getSelectionModel().addListSelectionListener(this); |
|
115 |
BandsTableModel model = new BandsTableModel(); |
|
116 |
tblBands.setModel(model); |
|
117 |
|
|
118 |
tblBands.setColumnModel(new DefaultTableColumnModel()); |
|
119 |
TableColumnModel columnModel = tblBands.getColumnModel(); |
|
120 |
columnModel.setColumnSelectionAllowed(false); |
|
121 |
for (int i = 0; i < model.getColumnCount(); i++) { |
|
122 |
TableColumn tableColumn = new TableColumn(i); |
|
123 |
tableColumn.setIdentifier(model.getColumnName(i)); |
|
124 |
tableColumn.setHeaderValue(model.getColumnName(i)); |
|
125 |
columnModel.addColumn(tableColumn); |
|
126 |
} |
|
127 |
|
|
128 |
cboColorSpaces.addItem(ColorInterpretation.RGB); |
|
129 |
cboColorSpaces.addItem(ColorInterpretation.CMYK); |
|
130 |
cboColorSpaces.addItem(ColorInterpretation.HSL); |
|
131 |
//FIXME: Uncomment when a operation to convert RGB to/from HSL is implemented. |
|
132 |
// cboColorSpaces.addItem(ColorInterpretation.YCBCR); |
|
133 |
cboColorSpaces.addItemListener(new ItemListener() { |
|
134 |
|
|
135 |
@Override |
|
136 |
public void itemStateChanged(ItemEvent e) { |
|
137 |
doChangeColorColumnCellEditor(); |
|
138 |
} |
|
139 |
}); |
|
140 |
|
|
141 |
// FIXME: esto ser?a lo que habr?a que cambiar si se desea implementar |
|
142 |
// otros espacios de color |
|
143 |
// columnModel.getColumn(0).setCellEditor(new ColorInterpretationCellEditor(BandsTableModel.RGBColorSpace)); |
|
144 |
columnModel.getColumn(0).setCellRenderer(new ColorInterpretationCellRenderer()); |
|
145 |
|
|
146 |
columnModel.getColumn(1).setCellRenderer(new NoDataCellRenderer()); |
|
147 |
// columnModel.getColumn(1).setCellEditor(new NoDataCellEditor()); |
|
148 |
|
|
149 |
columnModel.getColumn(2).setCellRenderer(new DataTypeCellRenderer()); |
|
150 |
|
|
151 |
} |
|
152 |
|
|
153 |
private void translate() { |
|
154 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
155 |
lblBands.setText(i18nManager.getTranslation(lblBands.getText())); |
|
156 |
lblColorSpace.setText(i18nManager.getTranslation(lblColorSpace.getText())); |
|
157 |
cboColorSpaces.setToolTipText(i18nManager.getTranslation(cboColorSpaces.getToolTipText())); |
|
158 |
btnAdd.setText(i18nManager.getTranslation(btnAdd.getText())); |
|
159 |
btnAdd.setToolTipText(i18nManager.getTranslation(btnAdd.getToolTipText())); |
|
160 |
btnRemove.setText(i18nManager.getTranslation(btnRemove.getText())); |
|
161 |
btnRemove.setToolTipText(i18nManager.getTranslation(btnRemove.getToolTipText())); |
|
162 |
} |
|
163 |
|
|
164 |
/** |
|
165 |
* @param locale |
|
166 |
* |
|
167 |
*/ |
|
168 |
public void setLocate(Locale locale) { |
|
169 |
Locale l = super.getLocale(); |
|
170 |
if (!l.equals(locale)) { |
|
171 |
translate(); |
|
172 |
} |
|
173 |
super.setLocale(locale); |
|
174 |
} |
|
175 |
|
|
176 |
/** |
|
177 |
* @param layer |
|
178 |
*/ |
|
179 |
@SuppressWarnings("unchecked") |
|
180 |
public void set(FLayer layer) { |
|
181 |
if(this.layer!=null){ |
|
182 |
DisposeUtils.dispose(this.layer); |
|
183 |
} |
|
184 |
this.layer = (RasterLayer) layer; |
|
185 |
DisposeUtils.bind(layer); |
|
186 |
RasterLegend legend = this.layer.getLegend(); |
|
187 |
ColorInterpretation colorInterpretation = null; |
|
188 |
if (legend != null) { |
|
189 |
colorInterpretation = legend.getColorInterpretation(); |
|
190 |
} |
|
191 |
RasterStore store = this.layer.getRasterStore(); |
|
192 |
addBands(store, colorInterpretation); |
|
193 |
} |
|
194 |
|
|
195 |
/** |
|
196 |
* @param colorInterpretation |
|
197 |
* @param store |
|
198 |
* @param model |
|
199 |
*/ |
|
200 |
private void addBands(RasterStore store, ColorInterpretation colorInterpretation) { |
|
201 |
String colorSpace = ""; |
|
202 |
if (colorInterpretation.hasAnyCMYKBand()) { |
|
203 |
colorSpace = ColorInterpretation.CMYK; |
|
204 |
} else if (colorInterpretation.hasAnyHSLBand()) { |
|
205 |
colorSpace = ColorInterpretation.HSL; |
|
206 |
} else if (colorInterpretation.hasAnyHSLBand()) { |
|
207 |
colorSpace = ColorInterpretation.YCBCR; |
|
208 |
} else { |
|
209 |
colorSpace = ColorInterpretation.RGB; |
|
210 |
} |
|
211 |
cboColorSpaces.setSelectedItem(colorSpace); |
|
212 |
doChangeColorColumnCellEditor(); |
|
213 |
|
|
214 |
BandsTableModel model = ((BandsTableModel) tblBands.getModel()); |
|
215 |
for (int i = 0; i < store.getBands(); i++) { |
|
216 |
BandDescriptor bandDescriptor = store.getBandDescriptor(i); |
|
217 |
|
|
218 |
RasterStoreBand rasterStoreBand = new RasterStoreBand(bandDescriptor.getStore(), bandDescriptor.getBand()); |
|
219 |
NoData noData = bandDescriptor.getNoData(); |
|
220 |
if (noData != null) { |
|
221 |
rasterStoreBand.setNoDataNumber(noData.getValue()); |
|
222 |
} |
|
223 |
rasterStoreBand.setBandName(bandDescriptor.getName()); |
|
224 |
rasterStoreBand.setDataType(bandDescriptor.getDataType()); |
|
225 |
|
|
226 |
if (colorInterpretation != null) { |
|
227 |
rasterStoreBand.setBandColorInterpretation(colorInterpretation.get(i)); |
|
228 |
} else { |
|
229 |
rasterStoreBand.setBandColorInterpretation(ColorInterpretation.UNDEFINED_BAND); |
|
230 |
} |
|
231 |
model.add(rasterStoreBand); |
|
232 |
DisposeUtils.disposeQuietly(rasterStoreBand); |
|
233 |
model.fireTableDataChanged(); |
|
234 |
} |
|
235 |
} |
|
236 |
|
|
237 |
/** |
|
238 |
* @param layer |
|
239 |
*/ |
|
240 |
public boolean fetch(FLayer layer) { |
|
241 |
RasterLayer rasterLayer = (RasterLayer) layer; |
|
242 |
RasterStore store = rasterLayer.getRasterStore(); |
|
243 |
RasterLegendManager rasterLegendManager = RasterLegendLocator.getRasterLegendManager(); |
|
244 |
if (willBeChangedBands(store)) { |
|
245 |
store.clearAdditionalBands(); |
|
246 |
BandsTableModel model = (BandsTableModel) tblBands.getModel(); |
|
247 |
BufferManager bufferManager = BufferLocator.getBufferManager(); |
|
248 |
|
|
249 |
for (int index = 0; index < model.getRowCount(); index++) { |
|
250 |
RasterStoreBand rasterStoreBand = model.getElementAt(index); |
|
251 |
RasterStore subStore = rasterStoreBand.getStore(); |
|
252 |
int band = rasterStoreBand.getBand(); |
|
253 |
if (subStore != store) { |
|
254 |
try { |
|
255 |
store.addBand(subStore, band); |
|
256 |
} catch (DataException e) { |
|
257 |
ThreadSafeDialogsManager dlgManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
258 |
String message = "_cant_add_band_XbandX_from_store_XsourceX_to_store_XtargetX"; |
|
259 |
String title = "_error_adding_bands"; |
|
260 |
dlgManager.messageDialog(message, new String[] { String.valueOf(band), subStore.getName(), |
|
261 |
store.getName() }, title, JOptionPane.WARNING_MESSAGE); |
|
262 |
LOG.warn(message, e); |
|
263 |
return false; |
|
264 |
} |
|
265 |
} |
|
266 |
BandDescriptor bandDescriptor = store.getBandDescriptor(index); |
|
267 |
NoData noData = bandDescriptor.getNoData(); |
|
268 |
Number value = null; |
|
269 |
value = rasterStoreBand.getNoDataNumber(); |
|
270 |
|
|
271 |
if (noData == null) { |
|
272 |
noData = bufferManager.createNoData(value, null); |
|
273 |
} else { |
|
274 |
noData.setValue((Number) value); |
|
275 |
} |
|
276 |
bandDescriptor.setNoData(noData); |
|
277 |
} |
|
278 |
rasterLayer.recalculateStatistics(); |
|
279 |
|
|
280 |
List<String> colorInterpretations = getColorInterpretations(); |
|
281 |
|
|
282 |
boolean createNewLegend = true; |
|
283 |
RasterLegend oldLegend = rasterLayer.getLegend(); |
|
284 |
if(oldLegend!=null){ |
|
285 |
ColorInterpretation oldColorInterpretation = oldLegend.getColorInterpretation(); |
|
286 |
if(oldColorInterpretation.length()==colorInterpretations.size()){ |
|
287 |
for (int band=0; band<oldColorInterpretation.length(); band++) { |
|
288 |
oldColorInterpretation.setColorInterpValue(band, colorInterpretations.get(band)); |
|
289 |
} |
|
290 |
createNewLegend = false; |
|
291 |
} |
|
292 |
} |
|
293 |
|
|
294 |
if(createNewLegend) { |
|
295 |
ColorInterpretation colorInterpretation = |
|
296 |
rasterLegendManager.createColorInterpretation(colorInterpretations.toArray(new String[0])); |
|
297 |
|
|
298 |
RasterLegend legend = rasterLegendManager.createLegend(colorInterpretation); |
|
299 |
rasterLayer.setLegend(legend); |
|
300 |
} |
|
301 |
|
|
302 |
|
|
303 |
rasterLayer.getMapContext().invalidate(); |
|
304 |
} |
|
305 |
|
|
306 |
return true; |
|
307 |
} |
|
308 |
|
|
309 |
private List<String> getColorInterpretations(){ |
|
310 |
List<String> colorInterpretations = new ArrayList(); |
|
311 |
BandsTableModel model = (BandsTableModel) tblBands.getModel(); |
|
312 |
|
|
313 |
for (int index = 0; index < model.getRowCount(); index++) { |
|
314 |
RasterStoreBand rasterStoreBand = model.getElementAt(index); |
|
315 |
RasterStore subStore = rasterStoreBand.getStore(); |
|
316 |
int band = rasterStoreBand.getBand(); |
|
317 |
colorInterpretations.add(rasterStoreBand.getBandColorInterpretation()); |
|
318 |
} |
|
319 |
return colorInterpretations; |
|
320 |
} |
|
321 |
|
|
322 |
private boolean willBeChangedBands(RasterStore store){ |
|
323 |
|
|
324 |
BandsTableModel model = (BandsTableModel) tblBands.getModel(); |
|
325 |
|
|
326 |
if(store.getBands()!=model.getRowCount()){ |
|
327 |
return true; |
|
328 |
} |
|
329 |
ColorInterpretation colorInterpretation = this.layer.getLegend().getColorInterpretation(); |
|
330 |
for (int index = 0; index < model.getRowCount(); index++) { |
|
331 |
RasterStoreBand rasterStoreBand = model.getElementAt(index); |
|
332 |
RasterStore subStore = rasterStoreBand.getStore(); |
|
333 |
int band = rasterStoreBand.getBand(); |
|
334 |
BandDescriptor bandDescriptor = store.getBandDescriptor(index); |
|
335 |
if (bandDescriptor.getStore() != subStore || bandDescriptor.getBand() != band |
|
336 |
|| isChangedNoData(bandDescriptor.getNoData(), rasterStoreBand.getNoDataNumber()) |
|
337 |
|| !(rasterStoreBand.getBandColorInterpretation().equals(colorInterpretation.get(index))) |
|
338 |
){ |
|
339 |
return true; |
|
340 |
} |
|
341 |
} |
|
342 |
return false; |
|
343 |
} |
|
344 |
|
|
345 |
private boolean isChangedNoData(NoData noData, Number number){ |
|
346 |
if(noData!=null){ |
|
347 |
return noData.getValue()!=number; |
|
348 |
} else { |
|
349 |
return number!=null; |
|
350 |
} |
|
351 |
} |
|
352 |
|
|
353 |
@Override |
|
354 |
public JComponent asJComponent() { |
|
355 |
return this; |
|
356 |
} |
|
357 |
|
|
358 |
@SuppressWarnings("unchecked") |
|
359 |
@Override |
|
360 |
public void actionPerformed(ActionEvent e) { |
|
361 |
if (e.getSource() == btnRemove) { |
|
362 |
BandsTableModel model = (BandsTableModel) tblBands.getModel(); |
|
363 |
model.removeElementAt(tblBands.getSelectedRow()); |
|
364 |
model.fireTableDataChanged(); |
|
365 |
|
|
366 |
} else if (e.getSource() == btnAdd) { |
|
367 |
DataManager manager = DALLocator.getDataManager(); |
|
368 |
|
|
369 |
JFileChooser fileChooser = createJFileChooser(); |
|
370 |
int result = fileChooser.showOpenDialog(this); |
|
371 |
|
|
372 |
if (result == JFileChooser.APPROVE_OPTION) { |
|
373 |
File[] files = fileChooser.getSelectedFiles(); |
|
374 |
for (File file : files) { |
|
375 |
|
|
376 |
DataServerExplorerParameters fileExplorerParams; |
|
377 |
try { |
|
378 |
fileExplorerParams = manager.createServerExplorerParameters(FilesystemServerExplorer.NAME); |
|
379 |
FilesystemServerExplorer explorer = |
|
380 |
(FilesystemServerExplorer) manager.openServerExplorer(FilesystemServerExplorer.NAME, |
|
381 |
fileExplorerParams); |
|
382 |
String type = explorer.getProviderName(file); |
|
383 |
DynObject params = manager.createStoreParameters(type); |
|
384 |
if (params.getDynClass().getDynField("file") != null) { |
|
385 |
params.setDynValue("file", file); |
|
386 |
} |
|
387 |
// FIXME: ?se le pone la proyecci?n del raster principal |
|
388 |
// o se busca la que tenga el archivo si la tiene? |
|
389 |
if (params.getDynClass().getDynField("crs") != null) { |
|
390 |
params.setDynValue("crs", this.layer.getProjection()); |
|
391 |
} |
|
392 |
RasterStore store = (RasterStore) manager.openStore(type, params); |
|
393 |
DisposeUtils.disposeQuietly(explorer); |
|
394 |
|
|
395 |
addBands(store, null); |
|
396 |
DisposeUtils.disposeQuietly(store); |
|
397 |
|
|
398 |
} catch (InitializeException | ProviderNotRegisteredException | ValidateDataParametersException e1) { |
|
399 |
LOG.warn("Can't add bands from the file '" + file.getName() + "'", e1); |
|
400 |
// e1.printStackTrace(); |
|
401 |
} |
|
402 |
} |
|
403 |
} |
|
404 |
} |
|
405 |
} |
|
406 |
|
|
407 |
@Override |
|
408 |
public void valueChanged(ListSelectionEvent e) { |
|
409 |
if (e.getSource() == tblBands.getSelectionModel()) { |
|
410 |
if (tblBands.getSelectedRow() >= 0) { |
|
411 |
if (this.layer.getRasterStore() != ((BandsTableModel) tblBands.getModel()).getElementAt( |
|
412 |
tblBands.getSelectedRow()).getStore()) { |
|
413 |
btnRemove.setEnabled(true); |
|
414 |
} else { |
|
415 |
btnRemove.setEnabled(false); |
|
416 |
} |
|
417 |
} else { |
|
418 |
btnRemove.setEnabled(false); |
|
419 |
} |
|
420 |
} |
|
421 |
} |
|
422 |
|
|
423 |
private JFileChooser createJFileChooser() { |
|
424 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
425 |
JFileChooser fileChooser = new JFileChooser(); |
|
426 |
|
|
427 |
int mode = FilesystemServerExplorer.MODE_RASTER; |
|
428 |
FilesystemServerExplorer explorer; |
|
429 |
|
|
430 |
DataManager dm = DALLocator.getDataManager(); |
|
431 |
FilesystemServerExplorerParameters param; |
|
432 |
try { |
|
433 |
param = |
|
434 |
(FilesystemServerExplorerParameters) dm.createServerExplorerParameters(FilesystemServerExplorer.NAME); |
|
435 |
explorer = (FilesystemServerExplorer) dm.openServerExplorer(FilesystemServerExplorer.NAME, param); |
|
436 |
} catch (Exception e) { |
|
437 |
throw new RuntimeException(e); |
|
438 |
} |
|
439 |
|
|
440 |
FilesystemFileFilter filter = explorer.getFilter(mode, i18nManager.getTranslation(RASTER_FILTER)); |
|
441 |
|
|
442 |
fileChooser.setMultiSelectionEnabled(true); |
|
443 |
fileChooser.setAcceptAllFileFilterUsed(false); |
|
444 |
fileChooser.setFileFilter(new MyFileFilter(filter)); |
|
445 |
DisposeUtils.dispose(explorer); |
|
446 |
|
|
447 |
return fileChooser; |
|
448 |
} |
|
449 |
|
|
450 |
/** |
|
451 |
* @author fdiaz |
|
452 |
* |
|
453 |
*/ |
|
454 |
public class MyFileFilter extends FileFilter { |
|
455 |
|
|
456 |
public FilesystemFileFilter filter = null; |
|
457 |
|
|
458 |
/** |
|
459 |
* @param params |
|
460 |
*/ |
|
461 |
public MyFileFilter(FilesystemFileFilter params) { |
|
462 |
this.filter = params; |
|
463 |
} |
|
464 |
|
|
465 |
/** |
|
466 |
* @see javax.swing.filechooser.FileFilter#accept(java.io.File) |
|
467 |
*/ |
|
468 |
public boolean accept(File f) { |
|
469 |
if (f.isDirectory()) { |
|
470 |
return true; |
|
471 |
} |
|
472 |
return filter.accept(f); |
|
473 |
|
|
474 |
} |
|
475 |
|
|
476 |
/** |
|
477 |
* @see javax.swing.filechooser.FileFilter#getDescription() |
|
478 |
*/ |
|
479 |
public String getDescription() { |
|
480 |
return filter.getDescription(); |
|
481 |
} |
|
482 |
|
|
483 |
/** |
|
484 |
* @return |
|
485 |
*/ |
|
486 |
public String getName() { |
|
487 |
return filter.getDataStoreProviderName(); |
|
488 |
} |
|
489 |
} |
|
490 |
|
|
491 |
@Override |
|
492 |
public void dispose() { |
|
493 |
if(!ToolsLocator.getDisposableManager().release(this)){ |
|
494 |
return; |
|
495 |
} |
|
496 |
DisposeUtils.dispose(this.layer); |
|
497 |
this.layer = null; |
|
498 |
|
|
499 |
BandsTableModel model = (BandsTableModel) tblBands.getModel(); |
|
500 |
|
|
501 |
for (int index = 0; index < model.getRowCount(); index++) { |
|
502 |
RasterStoreBand rasterStoreBand = model.getElementAt(index); |
|
503 |
DisposeUtils.disposeQuietly(rasterStoreBand); |
|
504 |
} |
|
505 |
} |
|
506 |
|
|
507 |
private void doChangeColorColumnCellEditor() { |
|
508 |
TableColumnModel columnModel = tblBands.getColumnModel(); |
|
509 |
|
|
510 |
String selectedItem = (String)cboColorSpaces.getSelectedItem(); |
|
511 |
if(selectedItem.equalsIgnoreCase(ColorInterpretation.RGB)){ |
|
512 |
|
|
513 |
columnModel.getColumn(0).setCellEditor(new ColorInterpretationCellEditor(BandsTableModel.RGBColorSpace)); |
|
514 |
} |
|
515 |
if(selectedItem.equalsIgnoreCase(ColorInterpretation.CMYK)){ |
|
516 |
columnModel.getColumn(0).setCellEditor(new ColorInterpretationCellEditor(BandsTableModel.CMYKColorSpace)); |
|
517 |
} |
|
518 |
if(selectedItem.equalsIgnoreCase(ColorInterpretation.HSL)){ |
|
519 |
columnModel.getColumn(0).setCellEditor(new ColorInterpretationCellEditor(BandsTableModel.HSLColorSpace)); |
|
520 |
} |
|
521 |
if(selectedItem.equalsIgnoreCase(ColorInterpretation.YCBCR)){ |
|
522 |
columnModel.getColumn(0).setCellEditor(new ColorInterpretationCellEditor(BandsTableModel.YCBCRColorSpace)); |
|
523 |
} |
|
524 |
|
|
525 |
TableModel bandModel = tblBands.getModel(); |
|
526 |
for (int i = 0; i < tblBands.getRowCount(); i++) { |
|
527 |
bandModel.setValueAt(ColorInterpretation.UNDEFINED_BAND, i, 0); |
|
528 |
} |
|
529 |
} |
|
530 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/ColorInterpretationCellEditor.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2017 gvSIG Association |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.fmap.mapcontext.raster.swing.impl.bands; |
|
24 |
|
|
25 |
import java.awt.Component; |
|
26 |
import java.util.List; |
|
27 |
|
|
28 |
import javax.swing.AbstractCellEditor; |
|
29 |
import javax.swing.JComboBox; |
|
30 |
import javax.swing.JTable; |
|
31 |
import javax.swing.table.TableCellEditor; |
|
32 |
|
|
33 |
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation; |
|
34 |
import org.gvsig.tools.ToolsLocator; |
|
35 |
|
|
36 |
|
|
37 |
/** |
|
38 |
* @author fdiaz |
|
39 |
* |
|
40 |
*/ |
|
41 |
public class ColorInterpretationCellEditor extends AbstractCellEditor implements TableCellEditor { |
|
42 |
|
|
43 |
/** |
|
44 |
* |
|
45 |
*/ |
|
46 |
private static final long serialVersionUID = 8964406967059115883L; |
|
47 |
private List<String> colorSpace; |
|
48 |
private JComboBox<ItemColor> comboBox; |
|
49 |
/** |
|
50 |
* @param colorSpace |
|
51 |
*/ |
|
52 |
public ColorInterpretationCellEditor(List<String> colorSpace) { |
|
53 |
this.colorSpace = colorSpace; |
|
54 |
} |
|
55 |
|
|
56 |
@Override |
|
57 |
public Object getCellEditorValue() { |
|
58 |
return ((ItemColor)comboBox.getSelectedItem()).key; |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { |
|
63 |
|
|
64 |
comboBox = new JComboBox<ItemColor>(); |
|
65 |
int i=0; |
|
66 |
int selected=i; |
|
67 |
comboBox.addItem(new ItemColor(ColorInterpretation.UNDEFINED_BAND)); |
|
68 |
if(ColorInterpretation.UNDEFINED_BAND.equalsIgnoreCase((String)value)){ |
|
69 |
selected=i; |
|
70 |
}; |
|
71 |
i++; |
|
72 |
for (String string : colorSpace) { |
|
73 |
comboBox.addItem(new ItemColor(string)); |
|
74 |
if(string.equalsIgnoreCase((String)value)){ |
|
75 |
selected=i; |
|
76 |
}; |
|
77 |
i++; |
|
78 |
} |
|
79 |
comboBox.addItem(new ItemColor(ColorInterpretation.GRAY_BAND)); |
|
80 |
if(ColorInterpretation.GRAY_BAND.equalsIgnoreCase((String)value)){ |
|
81 |
selected=i; |
|
82 |
}; |
|
83 |
i++; |
|
84 |
comboBox.addItem(new ItemColor(ColorInterpretation.PALETTE_BAND)); |
|
85 |
if(ColorInterpretation.PALETTE_BAND.equalsIgnoreCase((String)value)){ |
|
86 |
selected=i; |
|
87 |
}; |
|
88 |
i++; |
|
89 |
|
|
90 |
comboBox.setSelectedItem(selected); |
|
91 |
return comboBox; |
|
92 |
} |
|
93 |
|
|
94 |
class ItemColor { |
|
95 |
private String key; |
|
96 |
|
|
97 |
public ItemColor(String key){ |
|
98 |
this.key = key; |
|
99 |
} |
|
100 |
|
|
101 |
public String toString() { |
|
102 |
return ToolsLocator.getI18nManager().getTranslation(key); |
|
103 |
} |
|
104 |
|
|
105 |
} |
|
106 |
|
|
107 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/ColorInterpretationCellRenderer.java | ||
---|---|---|
1 |
package org.gvsig.fmap.mapcontext.raster.swing.impl.bands; |
|
2 |
|
|
3 |
import java.awt.Component; |
|
4 |
|
|
5 |
import javax.swing.JTable; |
|
6 |
import javax.swing.table.DefaultTableCellRenderer; |
|
7 |
|
|
8 |
import org.gvsig.tools.ToolsLocator; |
|
9 |
|
|
10 |
|
|
11 |
/** |
|
12 |
* @author fdiaz |
|
13 |
* |
|
14 |
*/ |
|
15 |
public class ColorInterpretationCellRenderer extends DefaultTableCellRenderer { |
|
16 |
|
|
17 |
/** |
|
18 |
* |
|
19 |
*/ |
|
20 |
private static final long serialVersionUID = -7247329247015852062L; |
|
21 |
|
|
22 |
@Override |
|
23 |
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, |
|
24 |
int row, int column) { |
|
25 |
|
|
26 |
Component cellComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); |
|
27 |
|
|
28 |
String colorInterpretation = ((String) value); |
|
29 |
setText(ToolsLocator.getI18nManager().getTranslation(colorInterpretation)); |
|
30 |
|
|
31 |
return cellComponent; |
|
32 |
} |
|
33 |
|
|
34 |
|
|
35 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/NoDataCellRenderer.java | ||
---|---|---|
1 |
package org.gvsig.fmap.mapcontext.raster.swing.impl.bands; |
|
2 |
|
|
3 |
import java.awt.Component; |
|
4 |
|
|
5 |
import javax.swing.JTable; |
|
6 |
import javax.swing.table.DefaultTableCellRenderer; |
|
7 |
|
|
8 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
|
9 |
|
|
10 |
|
|
11 |
/** |
|
12 |
* @author fdiaz |
|
13 |
* |
|
14 |
*/ |
|
15 |
public class NoDataCellRenderer extends DefaultTableCellRenderer { |
|
16 |
|
|
17 |
/** |
|
18 |
* |
|
19 |
*/ |
|
20 |
private static final long serialVersionUID = 7654022330175662292L; |
|
21 |
|
|
22 |
@Override |
|
23 |
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, |
|
24 |
int row, int column) { |
|
25 |
Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); |
|
26 |
if(value==null){ |
|
27 |
setText(""); |
|
28 |
} else { |
|
29 |
Number number = (Number)value; |
|
30 |
int dataType = ((Integer) table.getValueAt(row, BandsTableModel.COLUMN_DATA_TYPE)).intValue(); |
|
31 |
switch (dataType) { |
|
32 |
case BufferManager.TYPE_BYTE: |
|
33 |
setText(new Integer(number.intValue() & 0xff).toString()); |
|
34 |
break; |
|
35 |
case BufferManager.TYPE_USHORT: |
|
36 |
setText(new Integer(number.intValue() & 0xffff).toString()); |
|
37 |
break; |
|
38 |
default: |
|
39 |
setText(number.toString()); |
|
40 |
break; |
|
41 |
} |
|
42 |
} |
|
43 |
return component; |
|
44 |
} |
|
45 |
|
|
46 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/BandsTableModel.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2017 gvSIG Association |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.fmap.mapcontext.raster.swing.impl.bands; |
|
24 |
|
|
25 |
import java.util.ArrayList; |
|
26 |
import java.util.Arrays; |
|
27 |
import java.util.List; |
|
28 |
|
|
29 |
import javax.swing.table.AbstractTableModel; |
|
30 |
|
|
31 |
import org.slf4j.Logger; |
|
32 |
import org.slf4j.LoggerFactory; |
|
33 |
|
|
34 |
import org.gvsig.raster.lib.buffer.api.BufferLocator; |
|
35 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
|
36 |
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation; |
|
37 |
import org.gvsig.tools.ToolsLocator; |
|
38 |
import org.gvsig.tools.dataTypes.CoercionException; |
|
39 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
40 |
import org.gvsig.tools.i18n.I18nManager; |
|
41 |
import org.gvsig.tools.locator.LocatorException; |
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
/** |
|
46 |
* @author fdiaz |
|
47 |
* |
|
48 |
*/ |
|
49 |
public class BandsTableModel extends AbstractTableModel { |
|
50 |
|
|
51 |
/** |
|
52 |
* |
|
53 |
*/ |
|
54 |
private static final long serialVersionUID = 5993288441174158255L; |
|
55 |
private static final Logger LOG = LoggerFactory.getLogger(BandsTableModel.class); |
|
56 |
|
|
57 |
|
|
58 |
List<RasterStoreBand> rasterStoreBands; |
|
59 |
|
|
60 |
public static final List<String> RGBColorSpace = Arrays.asList(ColorInterpretation.RED_BAND, ColorInterpretation.GREEN_BAND, ColorInterpretation.BLUE_BAND, ColorInterpretation.ALPHA_BAND); |
|
61 |
public static final List<String> CMYKColorSpace = Arrays.asList(ColorInterpretation.CYAN_BAND, ColorInterpretation.MAGENTA_BAND, ColorInterpretation.YELLOW_BAND, ColorInterpretation.BLACK_BAND, ColorInterpretation.ALPHA_BAND); |
|
62 |
public static final List<String> HSLColorSpace = Arrays.asList(ColorInterpretation.HUE_BAND, ColorInterpretation.SATURATION_BAND, ColorInterpretation.LIGHTNESS_BAND, ColorInterpretation.ALPHA_BAND); |
|
63 |
public static final List<String> YCBCRColorSpace = Arrays.asList(ColorInterpretation.YCBCR_CB_BAND, ColorInterpretation.YCBCR_CR_BAND, ColorInterpretation.YCBCR_Y_BAND, ColorInterpretation.ALPHA_BAND); |
|
64 |
public static final List<List<String>> ColorSpaces = Arrays.asList(RGBColorSpace, CMYKColorSpace, HSLColorSpace, YCBCRColorSpace); |
|
65 |
public static final List<String> ColorSpaceNames = Arrays.asList(ColorInterpretation.RGB, ColorInterpretation.CMYK, ColorInterpretation.HSL, ColorInterpretation.YCBCR); |
|
66 |
|
|
67 |
public static final int COLUMN_COLOR = 0; |
|
68 |
public static final int COLUMN_NODATA = 1; |
|
69 |
public static final int COLUMN_DATA_TYPE = 2; |
|
70 |
public static final int COLUMN_STORE_NAME = 3; |
|
71 |
public static final int COLUMN_BAND = 4; |
|
72 |
public static final int COLUMN_BAND_NAME = 5; |
|
73 |
public static final int COLUMN_STORE_FULL_NAME = 6; |
|
74 |
|
|
75 |
|
|
76 |
/** |
|
77 |
* |
|
78 |
*/ |
|
79 |
public BandsTableModel() { |
|
80 |
rasterStoreBands = new ArrayList<RasterStoreBand>(); |
|
81 |
} |
|
82 |
|
|
83 |
@Override |
|
84 |
public int getRowCount() { |
|
85 |
return rasterStoreBands.size(); |
|
86 |
} |
|
87 |
|
|
88 |
@Override |
|
89 |
public int getColumnCount() { |
|
90 |
return 7; |
|
91 |
} |
|
92 |
|
|
93 |
@Override |
|
94 |
public Object getValueAt(int rowIndex, int columnIndex) { |
|
95 |
RasterStoreBand rasterStoreBand = rasterStoreBands.get(rowIndex); |
|
96 |
switch (columnIndex) { |
|
97 |
case COLUMN_COLOR: |
|
98 |
return rasterStoreBand.getBandColorInterpretation(); |
|
99 |
case COLUMN_NODATA: |
|
100 |
return rasterStoreBand.getNoDataNumber(); |
|
101 |
case COLUMN_DATA_TYPE: |
|
102 |
return rasterStoreBand.getDataType(); |
|
103 |
case COLUMN_STORE_NAME: |
|
104 |
return rasterStoreBand.getStore().getName(); |
|
105 |
case COLUMN_BAND: |
|
106 |
return rasterStoreBand.getBand(); |
|
107 |
case COLUMN_BAND_NAME: |
|
108 |
return rasterStoreBand.getBandName(); |
|
109 |
case COLUMN_STORE_FULL_NAME: |
|
110 |
return rasterStoreBand.getStore().getFullName(); |
|
111 |
} |
|
112 |
return null; |
|
113 |
} |
|
114 |
|
|
115 |
@Override |
|
116 |
public String getColumnName(int column) { |
|
117 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
118 |
switch (column) { |
|
119 |
case COLUMN_COLOR: |
|
120 |
return i18nManager.getTranslation("_color"); |
|
121 |
case COLUMN_NODATA: |
|
122 |
return i18nManager.getTranslation("_nodata"); |
|
123 |
case COLUMN_DATA_TYPE: |
|
124 |
return i18nManager.getTranslation("_data_type"); |
|
125 |
case COLUMN_STORE_NAME: |
|
126 |
return i18nManager.getTranslation("_store_name"); |
|
127 |
case COLUMN_BAND: |
|
128 |
return i18nManager.getTranslation("_band"); |
|
129 |
case COLUMN_BAND_NAME: |
|
130 |
return i18nManager.getTranslation("_band_name"); |
|
131 |
case COLUMN_STORE_FULL_NAME: |
|
132 |
return i18nManager.getTranslation("_store_full_name"); |
|
133 |
|
|
134 |
} |
|
135 |
return null; |
|
136 |
} |
|
137 |
|
|
138 |
@Override |
|
139 |
public boolean isCellEditable(int rowIndex, int columnIndex) { |
|
140 |
if(columnIndex>1){ |
|
141 |
return false; |
|
142 |
} |
|
143 |
return true; |
|
144 |
} |
|
145 |
|
|
146 |
@Override |
|
147 |
public void setValueAt(Object aValue, int rowIndex, int columnIndex) { |
|
148 |
Object value = aValue; |
|
149 |
if(columnIndex==0){ |
|
150 |
rasterStoreBands.get(rowIndex).setBandColorInterpretation((String)aValue); |
|
151 |
String colorInterpretation = ColorInterpretation.PALETTE_BAND; |
|
152 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
153 |
setUndefinedAnyOtherBand(rowIndex); |
|
154 |
} |
|
155 |
colorInterpretation = ColorInterpretation.GRAY_BAND; |
|
156 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
157 |
setUndefinedAnyOtherBand(rowIndex); |
|
158 |
} |
|
159 |
colorInterpretation = ColorInterpretation.RED_BAND; |
|
160 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
161 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
162 |
} |
|
163 |
colorInterpretation = ColorInterpretation.GREEN_BAND; |
|
164 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
165 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
166 |
} |
|
167 |
colorInterpretation = ColorInterpretation.BLUE_BAND; |
|
168 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
169 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
170 |
} |
|
171 |
colorInterpretation = ColorInterpretation.ALPHA_BAND; |
|
172 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
173 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
174 |
} |
|
175 |
|
|
176 |
colorInterpretation = ColorInterpretation.HUE_BAND; |
|
177 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
178 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
179 |
} |
|
180 |
colorInterpretation = ColorInterpretation.SATURATION_BAND; |
|
181 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
182 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
183 |
} |
|
184 |
colorInterpretation = ColorInterpretation.LIGHTNESS_BAND; |
|
185 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
186 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
187 |
} |
|
188 |
colorInterpretation = ColorInterpretation.CYAN_BAND; |
|
189 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
190 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
191 |
} |
|
192 |
colorInterpretation = ColorInterpretation.MAGENTA_BAND; |
|
193 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
194 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
195 |
} |
|
196 |
colorInterpretation = ColorInterpretation.YELLOW_BAND; |
|
197 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
198 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
199 |
} |
|
200 |
colorInterpretation = ColorInterpretation.BLACK_BAND; |
|
201 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
202 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
203 |
} |
|
204 |
colorInterpretation = ColorInterpretation.YCBCR_Y_BAND; |
|
205 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
206 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
207 |
} |
|
208 |
colorInterpretation = ColorInterpretation.YCBCR_CB_BAND; |
|
209 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
210 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
211 |
} |
|
212 |
colorInterpretation = ColorInterpretation.YCBCR_CR_BAND; |
|
213 |
if(((String)aValue).equalsIgnoreCase(colorInterpretation)){ |
|
214 |
setUndefinedAnyOtherBandWithSameColorInterpretation(rowIndex, colorInterpretation); |
|
215 |
} |
|
216 |
fireTableDataChanged(); |
|
217 |
} else if(columnIndex==1){ |
|
218 |
int dataType = rasterStoreBands.get(rowIndex).getDataType(); |
|
219 |
BufferManager bufferManager = BufferLocator.getBufferManager(); |
|
220 |
try { |
|
221 |
value = bufferManager.coerce(dataType, aValue); |
|
222 |
rasterStoreBands.get(rowIndex).setNoDataNumber((Number)value); |
|
223 |
} catch (LocatorException | CoercionException e) { |
|
224 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
225 |
LOG.warn(i18nManager.getTranslation( |
|
226 |
"_it_cant_be_reconized_XvalueX_as_a_XdatatypenameX.", |
|
227 |
new String[]{aValue.toString(), bufferManager.getTypeName(dataType)})); |
|
228 |
} |
|
229 |
} |
|
230 |
super.setValueAt(value, rowIndex, columnIndex); |
|
231 |
|
|
232 |
} |
|
233 |
|
|
234 |
/** |
|
235 |
* @param rowIndex |
|
236 |
*/ |
|
237 |
private void setUndefinedAnyOtherBand(int rowIndex) { |
|
238 |
for (int i = 0; i < getRowCount(); i++) { |
|
239 |
if(i!=rowIndex){ |
|
240 |
rasterStoreBands.get(i).setBandColorInterpretation(ColorInterpretation.UNDEFINED_BAND); |
|
241 |
} |
|
242 |
} |
|
243 |
} |
|
244 |
|
|
245 |
/** |
|
246 |
* Sets undefined the color interpretation of any other band with the same color interpretation |
|
247 |
* or with a color interpretation incompatible with the color space of the colorInterpretation parameter. |
|
248 |
* @param rowIndex |
|
249 |
* @param colorInterpretation |
|
250 |
*/ |
|
251 |
private void setUndefinedAnyOtherBandWithSameColorInterpretation(int rowIndex, String colorInterpretation) { |
|
252 |
for (int i = 0; i < getRowCount(); i++) { |
|
253 |
if(i!=rowIndex){ |
|
254 |
if(((String)getValueAt(i, 0)).equalsIgnoreCase(colorInterpretation)){ |
|
255 |
rasterStoreBands.get(i).setBandColorInterpretation(ColorInterpretation.UNDEFINED_BAND); |
|
256 |
} |
|
257 |
if(!areCompatible(colorInterpretation, ((String)getValueAt(i, 0)))){ |
|
258 |
rasterStoreBands.get(i).setBandColorInterpretation(ColorInterpretation.UNDEFINED_BAND); |
|
259 |
} |
|
260 |
} |
|
261 |
} |
|
262 |
} |
|
263 |
|
|
264 |
private boolean areCompatible(String colorInterpretation, String colorInterpretation2) { |
|
265 |
for(List<String> colorSpace : ColorSpaces) { |
|
266 |
if(colorSpace.contains(colorInterpretation)){ |
|
267 |
if(colorSpace.contains(colorInterpretation2)){ |
|
268 |
return true; |
|
269 |
} |
|
270 |
} |
|
271 |
} |
|
272 |
return false; |
|
273 |
} |
|
274 |
|
|
275 |
/** |
|
276 |
* @param rasterStoreBand |
|
277 |
*/ |
|
278 |
public void add(RasterStoreBand rasterStoreBand) { |
|
279 |
rasterStoreBands.add(rasterStoreBand); |
|
280 |
DisposeUtils.bind(rasterStoreBand); |
|
281 |
} |
|
282 |
|
|
283 |
/** |
|
284 |
* @param selectedRow |
|
285 |
*/ |
|
286 |
public void removeElementAt(int selectedRow) { |
|
287 |
RasterStoreBand rasterStoreBand = rasterStoreBands.get(selectedRow); |
|
288 |
rasterStoreBands.remove(selectedRow); |
|
289 |
DisposeUtils.disposeQuietly(rasterStoreBand); |
|
290 |
|
|
291 |
} |
|
292 |
|
|
293 |
public RasterStoreBand getElementAt(int selectedRow) { |
|
294 |
return rasterStoreBands.get(selectedRow); |
|
295 |
} |
|
296 |
|
|
297 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/BandsPanelView.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/paco/projects/externals/gvsig-desktop/RasterRefactoring/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.fmap.mapcontext.raster.swing/org.gvsig.fmap.mapcontext.raster.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/BandsPanelView.xml</at> |
|
28 |
<at name="path">RasterRefactoring/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.fmap.mapcontext.raster.swing/org.gvsig.fmap.mapcontext.raster.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/BandsPanelView.xml</at> |
|
29 |
<at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:GROW(1.0),CENTER:2DLU:NONE</at> |
|
30 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE</at> |
|
31 |
<at name="components"> |
|
32 |
<object classname="java.util.LinkedList"> |
|
33 |
<item > |
|
34 |
<at name="value"> |
|
35 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
36 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
37 |
<at name="cellconstraints"> |
|
38 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
39 |
<at name="column">2</at> |
|
40 |
<at name="row">2</at> |
|
41 |
<at name="colspan">6</at> |
|
42 |
<at name="rowspan">1</at> |
|
43 |
<at name="halign">default</at> |
|
44 |
<at name="valign">default</at> |
|
45 |
<at name="insets" object="insets">0,0,0,0</at> |
|
46 |
</object> |
|
47 |
</at> |
|
48 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
49 |
</super> |
|
50 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
51 |
<at name="beanclass">com.jeta.forms.components.separator.TitledSeparator</at> |
|
52 |
<at name="beanproperties"> |
|
53 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
54 |
<at name="classname">com.jeta.forms.components.separator.TitledSeparator</at> |
|
55 |
<at name="properties"> |
|
56 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
57 |
<at name="border"> |
|
58 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
59 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
60 |
<at name="name">border</at> |
|
61 |
</super> |
|
62 |
<at name="borders"> |
|
63 |
<object classname="java.util.LinkedList"> |
|
64 |
<item > |
|
65 |
<at name="value"> |
|
66 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
67 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
68 |
<at name="name">border</at> |
|
69 |
</super> |
|
70 |
</object> |
|
71 |
</at> |
|
72 |
</item> |
|
73 |
</object> |
|
74 |
</at> |
|
75 |
</object> |
|
76 |
</at> |
|
77 |
<at name="name">lblBands</at> |
|
78 |
<at name="width">932</at> |
|
79 |
<at name="text">_bands</at> |
|
80 |
<at name="height">15</at> |
|
81 |
</object> |
|
82 |
</at> |
|
83 |
</object> |
|
84 |
</at> |
|
85 |
</object> |
|
86 |
</at> |
|
87 |
</item> |
|
88 |
<item > |
|
89 |
<at name="value"> |
|
90 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
91 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
92 |
<at name="cellconstraints"> |
|
93 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
94 |
<at name="column">7</at> |
|
95 |
<at name="row">6</at> |
|
96 |
<at name="colspan">1</at> |
|
97 |
<at name="rowspan">1</at> |
|
98 |
<at name="halign">default</at> |
|
99 |
<at name="valign">top</at> |
|
100 |
<at name="insets" object="insets">0,0,0,0</at> |
|
101 |
</object> |
|
102 |
</at> |
|
103 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
104 |
</super> |
|
105 |
<at name="id">embedded.1683347175</at> |
|
106 |
<at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE</at> |
|
107 |
<at name="colspecs">FILL:DEFAULT:NONE</at> |
|
108 |
<at name="components"> |
|
109 |
<object classname="java.util.LinkedList"> |
|
110 |
<item > |
|
111 |
<at name="value"> |
|
112 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
113 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
114 |
<at name="cellconstraints"> |
|
115 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
116 |
<at name="column">1</at> |
|
117 |
<at name="row">1</at> |
|
118 |
<at name="colspan">1</at> |
|
119 |
<at name="rowspan">1</at> |
|
120 |
<at name="halign">default</at> |
|
121 |
<at name="valign">default</at> |
|
122 |
<at name="insets" object="insets">0,0,0,0</at> |
|
123 |
</object> |
|
124 |
</at> |
|
125 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
126 |
</super> |
|
127 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
128 |
<at name="beanclass">javax.swing.JButton</at> |
|
129 |
<at name="beanproperties"> |
|
130 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
131 |
<at name="classname">javax.swing.JButton</at> |
|
132 |
<at name="properties"> |
|
133 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
134 |
<at name="border"> |
|
135 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
136 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
137 |
<at name="name">border</at> |
|
138 |
</super> |
|
139 |
<at name="borders"> |
|
140 |
<object classname="java.util.LinkedList"> |
|
141 |
<item > |
|
142 |
<at name="value"> |
|
143 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
144 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
145 |
<at name="name">border</at> |
|
146 |
</super> |
|
147 |
</object> |
|
148 |
</at> |
|
149 |
</item> |
|
150 |
</object> |
|
151 |
</at> |
|
152 |
</object> |
|
153 |
</at> |
|
154 |
<at name="actionCommand">JButton</at> |
|
155 |
<at name="name">btnAdd</at> |
|
156 |
<at name="width">81</at> |
|
157 |
<at name="text">_add</at> |
|
158 |
<at name="toolTipText">_add_foreign_band</at> |
|
159 |
<at name="height">22</at> |
|
160 |
</object> |
|
161 |
</at> |
|
162 |
</object> |
|
163 |
</at> |
|
164 |
</object> |
|
165 |
</at> |
|
166 |
</item> |
|
167 |
<item > |
|
168 |
<at name="value"> |
|
169 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
170 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
171 |
<at name="cellconstraints"> |
|
172 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
173 |
<at name="column">1</at> |
|
174 |
<at name="row">3</at> |
|
175 |
<at name="colspan">1</at> |
|
176 |
<at name="rowspan">1</at> |
|
177 |
<at name="halign">default</at> |
|
178 |
<at name="valign">default</at> |
|
179 |
<at name="insets" object="insets">0,0,0,0</at> |
|
180 |
</object> |
|
181 |
</at> |
|
182 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
183 |
</super> |
|
184 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
185 |
<at name="beanclass">javax.swing.JButton</at> |
|
186 |
<at name="beanproperties"> |
|
187 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
188 |
<at name="classname">javax.swing.JButton</at> |
|
189 |
<at name="properties"> |
|
190 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
191 |
<at name="border"> |
|
192 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
193 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
194 |
<at name="name">border</at> |
|
195 |
</super> |
|
196 |
<at name="borders"> |
|
197 |
<object classname="java.util.LinkedList"> |
|
198 |
<item > |
|
199 |
<at name="value"> |
|
200 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
201 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
202 |
<at name="name">border</at> |
|
203 |
</super> |
|
204 |
</object> |
|
205 |
</at> |
|
206 |
</item> |
|
207 |
</object> |
|
208 |
</at> |
|
209 |
</object> |
|
210 |
</at> |
|
211 |
<at name="actionCommand">JButton</at> |
|
212 |
<at name="name">btnRemove</at> |
|
213 |
<at name="width">81</at> |
|
214 |
<at name="text">_remove</at> |
|
215 |
<at name="enabled">false</at> |
|
216 |
<at name="toolTipText">_remove_foreign_band</at> |
|
217 |
<at name="height">22</at> |
|
218 |
</object> |
|
219 |
</at> |
|
220 |
</object> |
|
221 |
</at> |
|
222 |
</object> |
|
223 |
</at> |
|
224 |
</item> |
|
225 |
</object> |
|
226 |
</at> |
|
227 |
<at name="properties"> |
|
228 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
229 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
230 |
<at name="properties"> |
|
231 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
232 |
<at name="border"> |
|
233 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
234 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
235 |
<at name="name">border</at> |
|
236 |
</super> |
|
237 |
<at name="borders"> |
|
238 |
<object classname="java.util.LinkedList"/> |
|
239 |
</at> |
|
240 |
</object> |
|
241 |
</at> |
|
242 |
<at name="name"></at> |
|
243 |
<at name="fill"> |
|
244 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
245 |
<at name="name">fill</at> |
|
246 |
</object> |
|
247 |
</at> |
|
248 |
<at name="scollBars"> |
|
249 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
250 |
<at name="name">scollBars</at> |
|
251 |
<at name="verticalpolicy">21</at> |
|
252 |
<at name="horizontalpolicy">31</at> |
|
253 |
<at name="border"> |
|
254 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
255 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
256 |
<at name="name">border</at> |
|
257 |
</super> |
|
258 |
<at name="borders"> |
|
259 |
<object classname="java.util.LinkedList"> |
|
260 |
<item > |
|
261 |
<at name="value"> |
|
262 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
263 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
264 |
<at name="name">border</at> |
|
265 |
</super> |
|
266 |
</object> |
|
267 |
</at> |
|
268 |
</item> |
|
269 |
</object> |
|
270 |
</at> |
|
271 |
</object> |
|
272 |
</at> |
|
273 |
</object> |
|
274 |
</at> |
|
275 |
</object> |
|
276 |
</at> |
|
277 |
</object> |
|
278 |
</at> |
|
279 |
<at name="cellpainters"> |
|
280 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
281 |
<at name="rows"> |
|
282 |
<object classname="[Ljava.lang.Object;" size="3"> |
|
283 |
<at name="item" index="0"> |
|
284 |
<object classname="[Ljava.lang.Object;" size="1"/> |
|
285 |
</at> |
|
286 |
<at name="item" index="1"> |
|
287 |
<object classname="[Ljava.lang.Object;" size="1"/> |
|
288 |
</at> |
|
289 |
<at name="item" index="2"> |
|
290 |
<object classname="[Ljava.lang.Object;" size="1"/> |
|
291 |
</at> |
|
292 |
</object> |
|
293 |
</at> |
|
294 |
</object> |
|
295 |
</at> |
|
296 |
<at name="rowgroups"> |
|
297 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
298 |
<at name="groups"> |
|
299 |
<object classname="java.util.HashMap"/> |
|
300 |
</at> |
|
301 |
</object> |
|
302 |
</at> |
|
303 |
<at name="colgroups"> |
|
304 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
305 |
<at name="groups"> |
|
306 |
<object classname="java.util.HashMap"/> |
|
307 |
</at> |
|
308 |
</object> |
|
309 |
</at> |
|
310 |
</object> |
|
311 |
</at> |
|
312 |
</item> |
|
313 |
<item > |
|
314 |
<at name="value"> |
|
315 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
316 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
317 |
<at name="cellconstraints"> |
|
318 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
319 |
<at name="column">2</at> |
|
320 |
<at name="row">6</at> |
|
321 |
<at name="colspan">4</at> |
|
322 |
<at name="rowspan">1</at> |
|
323 |
<at name="halign">fill</at> |
|
324 |
<at name="valign">fill</at> |
|
325 |
<at name="insets" object="insets">0,0,0,0</at> |
|
326 |
</object> |
|
327 |
</at> |
|
328 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
329 |
</super> |
|
330 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
331 |
<at name="beanclass">javax.swing.JTable</at> |
|
332 |
<at name="beanproperties"> |
|
333 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
334 |
<at name="classname">javax.swing.JTable</at> |
|
335 |
<at name="properties"> |
|
336 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
337 |
<at name="border"> |
|
338 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
339 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
340 |
<at name="name">border</at> |
|
341 |
</super> |
|
342 |
<at name="borders"> |
|
343 |
<object classname="java.util.LinkedList"> |
|
344 |
<item > |
|
345 |
<at name="value"> |
|
346 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
347 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
348 |
<at name="name">border</at> |
|
349 |
</super> |
|
350 |
</object> |
|
351 |
</at> |
|
352 |
</item> |
|
353 |
</object> |
|
354 |
</at> |
|
355 |
</object> |
|
356 |
</at> |
|
357 |
<at name="name">tblBands</at> |
|
358 |
<at name="width">833</at> |
|
359 |
<at name="scollBars"> |
|
360 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
361 |
<at name="name">scollBars</at> |
|
362 |
<at name="verticalpolicy">20</at> |
|
363 |
<at name="horizontalpolicy">30</at> |
|
364 |
<at name="border"> |
|
365 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
366 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
367 |
<at name="name">border</at> |
|
368 |
</super> |
|
369 |
<at name="borders"> |
|
370 |
<object classname="java.util.LinkedList"> |
|
371 |
<item > |
|
372 |
<at name="value"> |
|
373 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
374 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
375 |
<at name="name">border</at> |
|
376 |
</super> |
|
377 |
</object> |
|
378 |
</at> |
|
379 |
</item> |
|
380 |
</object> |
|
381 |
</at> |
|
382 |
</object> |
|
383 |
</at> |
|
384 |
</object> |
|
385 |
</at> |
|
386 |
<at name="height">32</at> |
|
387 |
</object> |
|
388 |
</at> |
|
389 |
</object> |
|
390 |
</at> |
|
391 |
</object> |
|
392 |
</at> |
|
393 |
</item> |
|
394 |
<item > |
|
395 |
<at name="value"> |
|
396 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
397 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
398 |
<at name="cellconstraints"> |
|
399 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
400 |
<at name="column">2</at> |
|
401 |
<at name="row">4</at> |
|
402 |
<at name="colspan">1</at> |
|
403 |
<at name="rowspan">1</at> |
|
404 |
<at name="halign">default</at> |
|
405 |
<at name="valign">default</at> |
|
406 |
<at name="insets" object="insets">0,0,0,0</at> |
|
407 |
</object> |
|
408 |
</at> |
|
409 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
410 |
</super> |
|
411 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
412 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
413 |
<at name="beanproperties"> |
|
414 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
415 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
416 |
<at name="properties"> |
Also available in: Unified diff