Revision 20905 trunk/extensions/extSymbology/src/org/gvsig/symbology/gui/styling/PictureMarker.java
PictureMarker.java | ||
---|---|---|
52 | 52 |
import java.util.ArrayList; |
53 | 53 |
|
54 | 54 |
import javax.swing.JButton; |
55 |
import javax.swing.JFileChooser; |
|
56 | 55 |
import javax.swing.JLabel; |
57 | 56 |
import javax.swing.JPanel; |
58 | 57 |
import javax.swing.filechooser.FileFilter; |
59 | 58 |
|
60 | 59 |
import org.gvsig.gui.beans.swing.GridBagLayoutPanel; |
60 |
import org.gvsig.gui.beans.swing.JFileChooser; |
|
61 | 61 |
import org.gvsig.gui.beans.swing.JIncrementalNumberField; |
62 | 62 |
import org.gvsig.symbology.fmap.symbols.PictureMarkerSymbol; |
63 | 63 |
|
... | ... | |
138 | 138 |
return PluginServices.getText(this, "bitmap_and_svg_image_files"); |
139 | 139 |
} |
140 | 140 |
}; |
141 |
JFileChooser jfc = new JFileChooser(lastDir);
|
|
141 |
JUrlFileChooser jfc = new JUrlFileChooser(getName(), null);
|
|
142 | 142 |
jfc.setFileFilter(ff); |
143 | 143 |
jfc.setFileSelectionMode(JFileChooser.FILES_ONLY); |
144 | 144 |
jfc.setSelectedFile(picFile); |
145 | 145 |
jfc.setMultiSelectionEnabled(false); |
146 | 146 |
int returnVal = jfc.showOpenDialog(PictureMarker.this.owner); |
147 | 147 |
if(returnVal == JFileChooser.APPROVE_OPTION) { |
148 |
File myFile = jfc.getSelectedFile(); |
|
148 |
|
|
149 |
URL url = jfc.getSelectedURL(); |
|
150 |
if (url == null) return; |
|
149 | 151 |
lastDir = jfc.getCurrentDirectory(); |
150 |
if (myFile != null && myFile.exists()) { |
|
151 |
if (isSelection) { |
|
152 |
selPicFile = myFile; |
|
153 |
} else { |
|
154 |
picFile = myFile; |
|
155 |
} |
|
156 |
try { |
|
157 |
targetLbl.setText(myFile.toURL().toString()); |
|
158 |
} catch (MalformedURLException e1) { |
|
159 |
NotificationManager.addError(PluginServices.getText(this, "Error en la creaci?n" + |
|
160 |
"de la URL"), e1); |
|
161 |
} |
|
162 |
fireSymbolChangedEvent(); |
|
163 |
} |
|
152 |
targetLbl.setText(url.toString()); |
|
153 |
fireSymbolChangedEvent(); |
|
164 | 154 |
} |
155 |
// if(returnVal == JFileChooser.APPROVE_OPTION) { |
|
156 |
// File myFile = jfc.getSelectedFile(); |
|
157 |
// lastDir = jfc.getCurrentDirectory(); |
|
158 |
// if (myFile != null && myFile.exists()) { |
|
159 |
// if (isSelection) { |
|
160 |
// selPicFile = myFile; |
|
161 |
// } else { |
|
162 |
// picFile = myFile; |
|
163 |
// } |
|
164 |
// try { |
|
165 |
// targetLbl.setText(myFile.toURL().toString()); |
|
166 |
// } catch (MalformedURLException e1) { |
|
167 |
// NotificationManager.addError(PluginServices.getText(this, "Error en la creaci?n" + |
|
168 |
// "de la URL"), e1); |
|
169 |
// } |
|
170 |
// fireSymbolChangedEvent(); |
|
171 |
// } |
|
172 |
// } |
|
165 | 173 |
|
166 | 174 |
|
167 | 175 |
} |
Also available in: Unified diff