Revision 7143 branches/v10/applications/appgvSIG/src/com/iver/cit/gvsig/gui/FileOpenDialog.java
FileOpenDialog.java | ||
---|---|---|
53 | 53 |
import java.util.HashSet; |
54 | 54 |
import java.util.Iterator; |
55 | 55 |
import java.util.TreeSet; |
56 |
import java.util.prefs.Preferences; |
|
56 | 57 |
|
57 | 58 |
import javax.swing.DefaultListModel; |
58 | 59 |
import javax.swing.JFileChooser; |
... | ... | |
75 | 76 |
* @author Vicente Caballero Navarro |
76 | 77 |
*/ |
77 | 78 |
public class FileOpenDialog extends JPanel{ |
78 |
// TODO LWS ?los m_Files ... ?tendr?an que ser GeoFiles (Projected y dem?s)?
|
|
79 |
// TODO LWS ?los m_Files ... ?tendr?an que ser GeoFiles (Projected y dem?s)? |
|
79 | 80 |
private static String lastPath = null; |
80 | 81 |
private static DriverFileFilter lastFileFilter = null; |
81 | 82 |
private ArrayList m_Files; |
... | ... | |
86 | 87 |
private String title = PluginServices.getText(this,"Capas"); |
87 | 88 |
|
88 | 89 |
private ProjChooserPanel jPanelProj = null; |
89 |
//private JLabel jLabel = null; |
|
90 |
//private JComboBox jCboProjections = null; |
|
91 | 90 |
private ListManagerSkin listManagerDemoSkin = null; |
92 | 91 |
private boolean proj; |
92 |
|
|
93 | 93 |
public FileOpenDialog(Class[] driverClasses) { |
94 | 94 |
init(driverClasses, true); |
95 | 95 |
} |
... | ... | |
134 | 134 |
this.setLayout(new BorderLayout()); |
135 | 135 |
this.setSize(514, 280); |
136 | 136 |
this.setLayout(null); |
137 |
// this.setBorder(javax.swing.BorderFactory.createBevelBorder( |
|
138 |
// javax.swing.border.BevelBorder.RAISED)); |
|
139 | 137 |
this.add(getJPanel2(), null); |
140 | 138 |
} |
141 | 139 |
|
... | ... | |
250 | 248 |
} |
251 | 249 |
} |
252 | 250 |
}); |
253 |
/* jPanel = new JLabel(); |
|
254 |
jPanel.setBounds(11, 214, 448, 37); |
|
255 |
jLabel.setText("Seleccione la proyecci?n:"); |
|
256 |
jPanel.add(jLabel, null); |
|
257 |
jPanel.add(getJCboProjections(), null);*/ |
|
251 |
|
|
258 | 252 |
} |
259 | 253 |
return jPanelProj; |
260 | 254 |
} |
261 |
/* |
|
262 |
* This method initializes jComboBox |
|
263 |
* |
|
264 |
* @return javax.swing.JComboBox |
|
265 |
* / |
|
266 |
private JComboBox getJCboProjections() { |
|
267 |
if (jCboProjections == null) { |
|
268 |
Iterator it = ProjectionPool.iterator(); |
|
269 |
Vector vector = new Vector(); |
|
270 |
int selected = -1; |
|
271 |
int i=0; |
|
272 |
while (it.hasNext()) |
|
273 |
{ |
|
274 |
IProjection auxP =(IProjection) it.next(); |
|
275 |
if (auxP == FOpenDialog.getLastProjection()) |
|
276 |
selected = i; |
|
277 |
vector.add(auxP.getAbrev()); |
|
278 |
i++; |
|
279 |
} |
|
280 |
DefaultComboBoxModel cModel = new DefaultComboBoxModel(vector); |
|
281 |
cModel.setSelectedItem(vector.get(selected)); |
|
282 |
jCboProjections = new JComboBox(cModel); |
|
283 |
jCboProjections.setPreferredSize(new java.awt.Dimension(124,19)); |
|
284 |
jCboProjections.addActionListener(new java.awt.event.ActionListener() { |
|
285 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
286 |
System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed() |
|
287 |
String strProj = (String) jCboProjections.getSelectedItem(); |
|
288 |
FOpenDialog.setLastProjection(ProjectionPool.get(strProj)); |
|
289 |
} |
|
290 |
}); |
|
291 |
} |
|
292 |
return jCboProjections; |
|
293 |
}*/ |
|
294 | 255 |
|
295 | 256 |
public class MyFile { |
296 | 257 |
private File f; |
... | ... | |
329 | 290 |
return dff1.driver.getName().compareTo(dff2.driver.getName()); |
330 | 291 |
} |
331 | 292 |
}); |
293 |
|
|
294 |
if (lastPath == null) { |
|
295 |
Preferences prefs = Preferences.userRoot().node( "gvsig.foldering" ); |
|
296 |
lastPath = prefs.get("DataFolder", null); |
|
297 |
} |
|
332 | 298 |
fileChooser = new JFileChooser(lastPath); |
333 | 299 |
fileChooser.setMultiSelectionEnabled(true); |
334 | 300 |
fileChooser.setAcceptAllFileFilterUsed(false); |
... | ... | |
408 | 374 |
} |
409 | 375 |
else |
410 | 376 |
return new Object[0]; |
411 |
|
|
412 |
// DefaultListModel lstModel = new DefaultListModel(); |
|
413 |
/* |
|
414 |
for (int iFile = 0; iFile < newFiles.length; |
|
415 |
iFile++) { |
|
416 |
File theFile = newFiles[iFile]; |
|
417 |
String absolutePath = theFile.getAbsolutePath(); |
|
418 |
lastPath = theFile.getParent(); |
|
419 |
// Miramos por si es un ecwp: |
|
420 |
int test = absolutePath.indexOf("ecwp:"); |
|
421 |
if (test == -1) |
|
422 |
m_lstModel.addElement(absolutePath); |
|
423 |
else |
|
424 |
m_lstModel.addElement(absolutePath.substring(test)); |
|
425 |
} |
|
426 |
|
|
427 |
getJListLayers().setModel(m_lstModel);*/ |
|
428 |
|
|
429 | 377 |
} |
430 | 378 |
|
431 | 379 |
public Object getProperties(Object selected) { |
Also available in: Unified diff