99 |
public void event(MouseEvent ev, EventHandling.MousePressState p_state, |
public void event(MouseEvent ev, EventHandling.MousePressState p_state, |
100 |
Object[] obs) { |
Object[] obs) { |
101 |
try { |
try { |
|
pa("Add photo!"); |
|
|
|
|
102 |
JFileChooser fc = new JFileChooser(); |
JFileChooser fc = new JFileChooser(); |
103 |
int returnVal = fc.showOpenDialog(null); |
int returnVal = fc.showOpenDialog(null); |
104 |
|
|
105 |
if (returnVal == JFileChooser.APPROVE_OPTION) { |
if (returnVal == JFileChooser.APPROVE_OPTION) { |
106 |
File file = fc.getSelectedFile(); |
File file = fc.getSelectedFile(); |
|
//this is where a real application would open the file. |
|
|
pa("Opening: IMG:" + file.getPath() ); |
|
|
|
|
107 |
Cell c = context.getAccursed(); |
Cell c = context.getAccursed(); |
108 |
// XXX no checks!! |
// XXX no checks!! |
109 |
c = space.getCell(ppactions.newNote(c.h(ppv.d.contains).getId(), |
ppactions.newNote(c.h(ppv.d.contains).getId(), |
110 |
(int)ppv.panx, (int)ppv.pany, |
(int)ppv.panx, (int)ppv.pany, |
111 |
"IMG:" + file.getPath() |
"IMG:" + file.getPath())); |
|
) |
|
|
); |
|
112 |
} else { |
} else { |
113 |
pa("Open command cancelled by user."); |
pa("Open command cancelled by user."); |
114 |
} |
} |
|
|
|
|
//ppactions.newPaper(); |
|
115 |
} catch (Exception e) { pa(e.getMessage()); } |
} catch (Exception e) { pa(e.getMessage()); } |
116 |
AbstractUpdateManager.chg(); |
AbstractUpdateManager.chg(); |
117 |
} |
} |