Package org.openstreetmap.josm.gui.download.BookmarkList

Examples of org.openstreetmap.josm.gui.download.BookmarkList.Bookmark


        bookmarks = new BookmarkList();
        bookmarks.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent e) {
                Bookmark b = bookmarks.getSelectedValue();
                if (b != null) {
                    gui.boundingBoxChanged(b.getArea(),BookmarkSelection.this);
                }
            }
        });
        bookmarks.addMouseListener(new DoubleClickAdapter());
View Full Code Here


                        tr("Information"),
                        JOptionPane.INFORMATION_MESSAGE
                );
                return;
            }
            Bookmark b = new Bookmark();
            b.setName(
                    JOptionPane.showInputDialog(
                            Main.parent,tr("Please enter a name for the bookmarked download area."),
                            tr("Name of location"),
                            JOptionPane.QUESTION_MESSAGE)
            );
            b.setArea(currentArea);
            if (b.getName() != null && !b.getName().isEmpty()) {
                ((DefaultListModel<BookmarkList.Bookmark>)bookmarks.getModel()).addElement(b);
                bookmarks.save();
            }
        }
View Full Code Here

        @Override
        public void actionPerformed(ActionEvent e) {
            List<Bookmark> sels = bookmarks.getSelectedValuesList();
            if (sels == null || sels.size() != 1)
                return;
            Bookmark b = sels.get(0);
            Object value =
                JOptionPane.showInputDialog(
                        Main.parent,tr("Please enter a name for the bookmarked download area."),
                        tr("Name of location"),
                        JOptionPane.QUESTION_MESSAGE,
                        null,
                        null,
                        b.getName()
                );
            if (value != null) {
                b.setName(value.toString());
                bookmarks.save();
                bookmarks.repaint();
            }
        }
View Full Code Here

            if (!(SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2))
                return;
            int idx = bookmarks.locationToIndex(e.getPoint());
            if (idx < 0 || idx >= bookmarks.getModel().getSize())
                return;
            Bookmark b = bookmarks.getModel().getElementAt(idx);
            parent.startDownload(b.getArea());
        }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.gui.download.BookmarkList.Bookmark

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.