18 |
// needed by swing and JFileChooser |
// needed by swing and JFileChooser |
19 |
//** uncomment if you need for demo |
//** uncomment if you need for demo |
20 |
import java.io.*; |
import java.io.*; |
21 |
import javax.swing.JFileChooser; |
// import javax.swing.JFileChooser; |
22 |
|
import java.awt.FileDialog; |
23 |
|
import java.awt.Frame; |
24 |
//*/ |
//*/ |
25 |
|
|
26 |
|
|
161 |
|
|
162 |
// /* |
// /* |
163 |
try { |
try { |
164 |
|
/* |
165 |
JFileChooser fc = new JFileChooser(); |
JFileChooser fc = new JFileChooser(); |
166 |
int returnVal = fc.showOpenDialog(null); |
int returnVal = fc.showOpenDialog(null); |
167 |
|
|
175 |
} else { |
} else { |
176 |
pa("Open command cancelled by user."); |
pa("Open command cancelled by user."); |
177 |
} |
} |
178 |
|
*/ |
179 |
|
Cell c = context.getAccursed(); |
180 |
|
Frame f = new Frame(); |
181 |
|
FileDialog fd = new FileDialog(f, "Valitse liitettava kuva", |
182 |
|
FileDialog.LOAD); |
183 |
|
fd.setModal(true); |
184 |
|
fd.show(); |
185 |
|
fd.hide(); |
186 |
|
pa("photo to be added: "+fd.getDirectory()+fd.getFile()); |
187 |
|
if (fd.getDirectory() != null) { |
188 |
|
// XXX no checks!! |
189 |
|
ppactions.newNote(c.h(ppv.d.contains).getId(), |
190 |
|
(int)ppv.panx, (int)ppv.pany, |
191 |
|
"IMG:" + fd.getDirectory() + |
192 |
|
fd.getFile()); |
193 |
|
} else { |
194 |
|
pa("Open command cancelled by user."); |
195 |
|
} |
196 |
|
|
197 |
} catch (Exception e) { pa(e.getMessage()); } |
} catch (Exception e) { pa(e.getMessage()); } |
198 |
AbstractUpdateManager.chg(); |
AbstractUpdateManager.chg(); |
199 |
// */ |
// */ |