Package slash.navigation.gui.actions

Examples of slash.navigation.gui.actions.DialogAction


        labelLabel.setText(format(RouteConverter.getBundle().getString("add-file-label"), categoryTreeNode.getName()));
        textFieldFile.setText(createReadablePath(file));
        textFieldLength.setText(formatDoubleAsString(length / 1000.0, 1));
        textFieldDescription.setText(description);

        buttonAdd.addActionListener(new DialogAction(this) {
            public void run() {
                addFile();
            }
        });

        buttonCancel.addActionListener(new DialogAction(this) {
            public void run() {
                cancel();
            }
        });

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                cancel();
            }
        });

        contentPane.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                cancel();
            }
        }, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    }
View Full Code Here


        setContentPane(contentPane);

        RouteConverter r = RouteConverter.getInstance();

        setMnemonic(buttonSelectAll, "select-all-action-mnemonic");
        buttonSelectAll.addActionListener(new DialogAction(this) {
            public void run() {
                selectAll();
            }
        });

        setMnemonic(buttonClearSelection, "clear-selection-mnemonic");
        buttonClearSelection.addActionListener(new DialogAction(this) {
            public void run() {
                clearSelection();
            }
        });

        setMnemonic(buttonInsertAllWaypoints, "insert-all-waypoints-mnemonic");
        buttonInsertAllWaypoints.addActionListener(new DialogAction(this) {
            public void run() {
                insertAllWaypoints();
            }
        });

        setMnemonic(buttonInsertOnlyTurnpoints, "insert-only-turnpoints-mnemonic");
        buttonInsertOnlyTurnpoints.addActionListener(new DialogAction(this) {
            public void run() {
                insertOnlyTurnpoints();
            }
        });

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                close();
            }
        });

        contentPane.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                close();
            }
        }, getKeyStroke(VK_ESCAPE, 0), WHEN_IN_FOCUSED_WINDOW);
View Full Code Here

        super(RouteConverter.getInstance().getFrame(), "find-place");
        setTitle(RouteConverter.getBundle().getString("find-place-title"));
        setContentPane(contentPane);

        setMnemonic(buttonSearchPositions, "search-position-mnemonic");
        buttonSearchPositions.addActionListener(new DialogAction(this) {
            public void run() {
                searchPositions();
            }
        });

        setMnemonic(buttonInsertPosition, "insert-mnemonic");
        buttonInsertPosition.addActionListener(new DialogAction(this) {
            public void run() {
                insertPosition();
            }
        });

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                close();
            }
        });

        contentPane.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                close();
            }
        }, KeyStroke.getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

        RouteConverter r = RouteConverter.getInstance();

        textFieldSearch.setText(r.getSearchPositionPreference());
        textFieldSearch.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                searchPositions();
            }
        }, KeyStroke.getKeyStroke(VK_ENTER, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
View Full Code Here

                startBrowserForDouglasPeucker(DeletePositionsDialog.this);
            }
        });

        setMnemonic(buttonSelectByDistance, "select-mnemonic");
        buttonSelectByDistance.addActionListener(new DialogAction(this) {
            public void run() {
                selectByDistance();
            }
        });

        setMnemonic(buttonSelectByOrder, "select-mnemonic");
        buttonSelectByOrder.addActionListener(new DialogAction(this) {
            public void run() {
                selectByOrder();
            }
        });

        setMnemonic(buttonSelectBySignificance, "select-mnemonic");
        buttonSelectBySignificance.addActionListener(new DialogAction(this) {
            public void run() {
                selectBySignificance();
            }
        });

        setMnemonic(buttonClearSelection, "clear-selection-mnemonic");
        buttonClearSelection.addActionListener(new DialogAction(this) {
            public void run() {
                clearSelection();
            }
        });

        setMnemonic(buttonDeletePositions, "delete-selected-positions-mnemonic");
        buttonDeletePositions.addActionListener(new DialogAction(this) {
            public void run() {
                deletePositions();
            }
        });

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                close();
            }
        });

        contentPane.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                close();
            }
        }, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
View Full Code Here

                String timeZoneId = String.valueOf(e.getItem());
                r.setTimeZonePreference(timeZoneId);
            }
        });

        buttonClose.addActionListener(new DialogAction(this) {
            public void run() {
                close();
            }
        });

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                close();
            }
        });

        contentPane.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                close();
            }
        }, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    }
View Full Code Here

        setModal(true);
        getRootPane().setDefaultButton(buttonSend);

        textAreaLog.setText(LoggingHelper.getInstance().getLogFileAsString());

        buttonChooseFilePath.addActionListener(new DialogAction(this) {
            public void run() {
                chooseFilePath();
            }
        });

        buttonSend.addActionListener(new DialogAction(this) {
            public void run() {
                send();
            }
        });

        buttonCancel.addActionListener(new DialogAction(this) {
            public void run() {
                cancel();
            }
        });
View Full Code Here

        if (featuredTo != null) {
            labelFeature.setText(format(RouteConverter.getBundle().getString("featured-to"), featuredTo));
            labelFeature.setVisible(true);
        }

        buttonClose.addActionListener(new DialogAction(this) {
            public void run() {
                close();
            }
        });

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                close();
            }
        });

        contentPane.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                close();
            }
        }, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    }
View Full Code Here

        setTitle(RouteConverter.getBundle().getString("complete-flight-plan-title"));
        setContentPane(contentPane);
        setModal(true);
        getRootPane().setDefaultButton(buttonNextOrFinish);

        buttonPrevious.addActionListener(new DialogAction(this) {
            public void run() {
                if (index > 0) {
                    index--;
                    updateView();
                }
            }
        });

        buttonNextOrFinish.addActionListener(new DialogAction(this) {
            public void run() {
                if (index < route.getPositionCount() - 1) {
                    index++;
                    updateView();
                } else
                    close();
            }
        });

        textFieldDescription.addKeyListener(new KeyAdapter() {
            protected void update() {
                getPosition().setDescription(textFieldDescription.getText());
                validateModel();
            }
        });
        textFieldIdentifier.addKeyListener(new KeyAdapter() {
            protected void update() {
                getPosition().setIdentifier(textFieldIdentifier.getText());
                validateModel();
            }
        });

        comboBoxCountryCode.setRenderer(new CountryCodeListCellRenderer());
        comboBoxCountryCode.setModel(new DefaultComboBoxModel(CountryCode.values()));
        comboBoxCountryCode.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() != SELECTED)
                    return;
                CountryCode countryCode = (CountryCode) e.getItem();
                getPosition().setCountryCode(countryCode);
                validateModel();
            }
        });
        comboBoxWaypointType.setRenderer(new WaypointTypeListCellRenderer());
        comboBoxWaypointType.setModel(new DefaultComboBoxModel(WaypointType.values()));
        comboBoxWaypointType.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() != SELECTED)
                    return;
                WaypointType waypointType = (WaypointType) e.getItem();
                getPosition().setWaypointType(waypointType);
                validateModel();
            }
        });

        updateView();

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                close();
            }
        });

        contentPane.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                close();
            }
        }, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    }
View Full Code Here

        labelLabel.setText(format(RouteConverter.getBundle().getString("add-url-label"), category.getName()));
        textFieldDescription.setText(description);
        textFieldUrl.setText(url);

        buttonAdd.addActionListener(new DialogAction(this) {
            public void run() {
                addUrl();
            }
        });

        buttonCancel.addActionListener(new DialogAction(this) {
            public void run() {
                cancel();
            }
        });

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                cancel();
            }
        });

        contentPane.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                cancel();
            }
        }, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    }
View Full Code Here

                return d1.getState().compareTo(d2.getState());
            }
        });
        tableDownloads.setRowSorter(sorter);

        buttonClose.addActionListener(new DialogAction(this) {
            public void run() {
                close();
            }
        });

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                close();
            }
        });

        contentPane.registerKeyboardAction(new DialogAction(this) {
            public void run() {
                close();
            }
        }, getKeyStroke(VK_ESCAPE, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    }
View Full Code Here

TOP

Related Classes of slash.navigation.gui.actions.DialogAction

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.