Changeset 435 in josm for trunk/src/org/openstreetmap/josm/gui/download
- Timestamp:
- 2007-10-27T18:09:50+02:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/download
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
r298 r435 8 8 import java.awt.event.ActionEvent; 9 9 import java.awt.event.ActionListener; 10 import java.awt.event.MouseListener; 11 import java.awt.event.MouseAdapter; 12 import java.awt.event.MouseEvent; 10 13 11 14 import javax.swing.DefaultListModel; … … 33 36 public class BookmarkSelection implements DownloadSelection { 34 37 35 private Preferences.Bookmark tempBookmark= null; 38 private Preferences.Bookmark tempBookmark = null; 36 39 private BookmarkList bookmarks; 37 40 … … 42 45 43 46 bookmarks = new BookmarkList(); 47 48 /* add a handler for "double click" mouse events */ 49 MouseListener mouseListener = new MouseAdapter() { 50 @Override public void mouseClicked(MouseEvent e) { 51 if (e.getClickCount() == 2) { 52 int index = bookmarks.locationToIndex(e.getPoint()); 53 gui.closeDownloadDialog(true); 54 } 55 } 56 }; 57 bookmarks.addMouseListener(mouseListener); 58 44 59 bookmarks.getSelectionModel().addListSelectionListener(new ListSelectionListener() { 45 60 public void valueChanged(ListSelectionEvent e) { -
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r434 r435 10 10 import javax.swing.JCheckBox; 11 11 import javax.swing.JLabel; 12 import javax.swing.JOptionPane; 12 13 import javax.swing.JPanel; 13 14 import javax.swing.JTabbedPane; … … 33 34 public class DownloadDialog extends JPanel { 34 35 35 36 // the JOptionPane that contains this dialog. required for the closeDialog() method. 37 private JOptionPane optionPane; 38 36 39 public interface DownloadTask { 37 40 /** … … 138 141 return tabpane.getSelectedIndex(); 139 142 } 143 144 /** 145 * Closes the download dialog. This is intended to be called by one of 146 * the various download area selection "plugins". 147 * 148 * @param download true to download selected data, false to cancel download 149 */ 150 public void closeDownloadDialog(boolean download) { 151 optionPane.setValue(download ? JOptionPane.OK_OPTION : JOptionPane.CANCEL_OPTION); 152 } 153 154 /** 155 * Has to be called after this dialog has been added to a JOptionPane. 156 * @param optionPane 157 */ 158 public void setOptionPane(JOptionPane optionPane) { 159 this.optionPane = optionPane; 160 } 140 161 }
Note:
See TracChangeset
for help on using the changeset viewer.