Revision 22364 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/colortable/ui/library/ColorTableLibraryPanel.java
ColorTableLibraryPanel.java | ||
---|---|---|
44 | 44 |
import org.gvsig.raster.datastruct.io.exceptions.RasterLegendIONotFound; |
45 | 45 |
import org.gvsig.raster.datastruct.persistence.ColorTableLibraryPersistence; |
46 | 46 |
import org.gvsig.raster.util.ExtendedFileFilter; |
47 |
import org.gvsig.raster.util.PanelBase;
|
|
47 |
import org.gvsig.raster.util.BasePanel;
|
|
48 | 48 |
import org.gvsig.raster.util.RasterToolsUtil; |
49 | 49 |
import org.gvsig.raster.util.RasterUtilities; |
50 | 50 |
|
... | ... | |
57 | 57 |
* 19/02/2008 |
58 | 58 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
59 | 59 |
*/ |
60 |
public class ColorTableLibraryPanel extends PanelBase implements ActionListener, ListViewListener { |
|
60 |
public class ColorTableLibraryPanel extends BasePanel implements ActionListener, ListViewListener { |
|
61 |
private static final long serialVersionUID = 1L; |
|
61 | 62 |
private JPanel panelButtons = null; |
62 | 63 |
private JButton buttonAdd = null; |
63 | 64 |
private JButton buttonDel = null; |
... | ... | |
73 | 74 |
File.separator + |
74 | 75 |
"gvSIG" + // PluginServices.getArguments()[0] + |
75 | 76 |
File.separator + "colortable"; |
76 |
|
|
77 |
|
|
78 |
/** |
|
79 |
*Inicializa componentes gr?ficos y traduce |
|
80 |
*/ |
|
77 | 81 |
public ColorTableLibraryPanel() { |
78 |
initialize(); |
|
82 |
init(); |
|
83 |
translate(); |
|
79 | 84 |
} |
80 | 85 |
|
81 |
/** |
|
82 |
* Inicializa el panel de la libreria de tablas de color |
|
86 |
/* |
|
87 |
* (non-Javadoc) |
|
88 |
* @see org.gvsig.raster.util.BasePanel#init() |
|
83 | 89 |
*/ |
84 |
private void initialize() {
|
|
85 |
getPanel().setLayout(new BorderLayout());
|
|
90 |
protected void init() {
|
|
91 |
setLayout(new BorderLayout()); |
|
86 | 92 |
|
87 | 93 |
JPanel panel = new JPanel(); |
88 | 94 |
panel.setLayout(new BorderLayout()); |
... | ... | |
93 | 99 |
jScrollPane.setAutoscrolls(true); |
94 | 100 |
|
95 | 101 |
panel.add(jScrollPane, BorderLayout.CENTER); |
96 |
getPanel().add(panel, BorderLayout.CENTER);
|
|
97 |
getPanel().add(getPanelButtons(), BorderLayout.SOUTH);
|
|
98 |
getPanel().setPreferredSize(new Dimension(0, 192));
|
|
102 |
add(panel, BorderLayout.CENTER); |
|
103 |
add(getPanelButtons(), BorderLayout.SOUTH); |
|
104 |
setPreferredSize(new Dimension(0, 192)); |
|
99 | 105 |
|
100 | 106 |
loadDiskLibrary(); |
101 | 107 |
} |
108 |
|
|
109 |
/* |
|
110 |
* (non-Javadoc) |
|
111 |
* @see org.gvsig.raster.util.BasePanel#translate() |
|
112 |
*/ |
|
113 |
protected void translate() { |
|
114 |
} |
|
102 | 115 |
|
103 | 116 |
private void loadDiskLibrary() { |
104 | 117 |
ArrayList fileList = ColorTableLibraryPersistence.getPaletteFileList(palettesPath); |
... | ... | |
253 | 266 |
public void actionPerformed(ActionEvent e) { |
254 | 267 |
if (e.getSource() == getButtonAdd()) { |
255 | 268 |
AddLibrary addLibrary = new AddLibrary(); |
256 |
if (addLibrary.showConfirm(getPanel()) == JOptionPane.OK_OPTION) {
|
|
269 |
if (addLibrary.showConfirm(this) == JOptionPane.OK_OPTION) {
|
|
257 | 270 |
ColorTable colorTable = addLibrary.getColorTable(); |
258 | 271 |
if (colorTable != null) { |
259 | 272 |
ListViewItem item = new ListViewItem(new ColorTableIconPainter(colorTable), colorTable.getName()); |
... | ... | |
294 | 307 |
if (firstFileFilter != null) |
295 | 308 |
chooser.setFileFilter(firstFileFilter); |
296 | 309 |
|
297 |
int returnVal = chooser.showSaveDialog(getPanel());
|
|
310 |
int returnVal = chooser.showSaveDialog(this);
|
|
298 | 311 |
if (returnVal == JFileChooser.APPROVE_OPTION) { |
299 | 312 |
try { |
300 | 313 |
ExtendedFileFilter filter = (ExtendedFileFilter) chooser.getFileFilter(); |
... | ... | |
336 | 349 |
chooser.addChoosableFileFilter(allFilters); |
337 | 350 |
chooser.setFileFilter(allFilters); |
338 | 351 |
|
339 |
int returnVal = chooser.showOpenDialog(getPanel());
|
|
352 |
int returnVal = chooser.showOpenDialog(this);
|
|
340 | 353 |
|
341 | 354 |
if (returnVal == JFileChooser.APPROVE_OPTION) { |
342 | 355 |
try { |
... | ... | |
499 | 512 |
((ColorTableIconPainter) getListViewComponent().getSelectedValue().getIcon()).getColorTable().createPaletteFromColorItems(colorTable.getColorItems(), false); |
500 | 513 |
getListViewComponent().repaint(); |
501 | 514 |
} |
515 |
|
|
502 | 516 |
} |
Also available in: Unified diff