| Line | |
|---|
| 1 | package org.openstreetmap.josm.actions;
|
|---|
| 2 |
|
|---|
| 3 | import java.awt.event.ActionEvent;
|
|---|
| 4 | import java.awt.event.KeyEvent;
|
|---|
| 5 | import java.io.File;
|
|---|
| 6 |
|
|---|
| 7 | import javax.swing.AbstractAction;
|
|---|
| 8 | import javax.swing.ImageIcon;
|
|---|
| 9 | import javax.swing.JFileChooser;
|
|---|
| 10 |
|
|---|
| 11 | import org.openstreetmap.josm.gui.Main;
|
|---|
| 12 |
|
|---|
| 13 | /**
|
|---|
| 14 | * Export the current selected window's DataSet as gpx values. Remember, that some
|
|---|
| 15 | * information could be lost. If so, an information message will ask the user to proceed.
|
|---|
| 16 | * (Means, if all information can be saved, no warning message appears).
|
|---|
| 17 | *
|
|---|
| 18 | * @author imi
|
|---|
| 19 | */
|
|---|
| 20 | public class SaveGpxAction extends AbstractAction {
|
|---|
| 21 |
|
|---|
| 22 | /**
|
|---|
| 23 | * Construct the action with "Save GPX" as label.
|
|---|
| 24 | */
|
|---|
| 25 | public SaveGpxAction() {
|
|---|
| 26 | super("Save GPX", new ImageIcon("images/savegpx.png"));
|
|---|
| 27 | putValue(MNEMONIC_KEY, KeyEvent.VK_S);
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | @SuppressWarnings("unchecked")
|
|---|
| 31 | public void actionPerformed(ActionEvent e) {
|
|---|
| 32 | JFileChooser fc = new JFileChooser("data");
|
|---|
| 33 | fc.showSaveDialog(Main.main);
|
|---|
| 34 | File gpxFile = fc.getSelectedFile();
|
|---|
| 35 | if (gpxFile == null)
|
|---|
| 36 | return;
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.