Package org.openstreetmap.josm.gui

Examples of org.openstreetmap.josm.gui.SideButton


     * @return the toolbar panel
     */
    protected JPanel buildToolbarPanel() {
        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));

        SideButton btn = new SideButton(new QueryAction());
        pnl.add(btn);
        pnl.add(new SingleChangesetDownloadPanel());
        pnl.add(new SideButton(new DownloadMyChangesets()));

        return pnl;
    }
View Full Code Here


     */
    protected JPanel buildButtonPanel() {
        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.CENTER));

        //-- cancel and close action
        pnl.add(new SideButton(new CancelAction()));

        //-- help action
        pnl.add(new SideButton(
                new ContextSensitiveHelpAction(
                        HelpUtil.ht("/Dialog/ChangesetCacheManager"))
        )
        );

View Full Code Here

        adaptTo(showHideLayerAction, selectionModel);

        //-- layer opacity action
        LayerOpacityAction layerOpacityAction = new LayerOpacityAction();
        adaptTo(layerOpacityAction, selectionModel);
        opacityButton = new SideButton(layerOpacityAction, false);

        // -- merge layer action
        MergeAction mergeLayerAction = new MergeAction();
        adaptTo(mergeLayerAction, model);
        adaptTo(mergeLayerAction,selectionModel);

        // -- duplicate layer action
        DuplicateAction duplicateLayerAction = new DuplicateAction();
        adaptTo(duplicateLayerAction, model);
        adaptTo(duplicateLayerAction, selectionModel);

        //-- delete layer action
        DeleteLayerAction deleteLayerAction = new DeleteLayerAction();
        layerList.getActionMap().put("deleteLayer", deleteLayerAction);
        adaptTo(deleteLayerAction, selectionModel);
        getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
                KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),"delete"
                );
        getActionMap().put("delete", deleteLayerAction);

        // Activate layer on Enter key press
        InputMapUtils.addEnterAction(layerList, new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent e) {
                activateLayerAction.actionPerformed(null);
                layerList.requestFocus();
            }
        });

        // Show/Activate layer on Enter key press
        InputMapUtils.addSpacebarAction(layerList, showHideLayerAction);

        createLayout(layerList, true, Arrays.asList(new SideButton[] {
                new SideButton(moveUpAction, false),
                new SideButton(moveDownAction, false),
                new SideButton(activateLayerAction, false),
                new SideButton(showHideLayerAction, false),
                opacityButton,
                new SideButton(mergeLayerAction, false),
                new SideButton(duplicateLayerAction, false),
                new SideButton(deleteLayerAction, false)
        }));

        createVisibilityToggleShortcuts();
    }
View Full Code Here

        JPanel pane = new JPanel(new BorderLayout());
        pane.add(filter, BorderLayout.NORTH);
        pane.add(new JScrollPane(displaylist), BorderLayout.CENTER);
        createLayout(pane, false, Arrays.asList(new SideButton[]{
                new SideButton(newAction, false),
                new SideButton(editAction, false),
                new SideButton(duplicateAction, false),
                new SideButton(deleteRelationsAction, false),
                new SideButton(selectRelationAction, false)
        }));

        InputMapUtils.unassignCtrlShiftUpDown(displaylist, JComponent.WHEN_FOCUSED);

        // Select relation on Ctrl-Enter
View Full Code Here

     */
    protected JPanel buildOkCancelButtonPanel() {
        JPanel pnl = new JPanel();
        pnl.setLayout(new FlowLayout(FlowLayout.CENTER));

        pnl.add(new SideButton(new OKAction()));
        pnl.add(new SideButton(new CancelAction()));
        pnl.add(new SideButton(new ContextSensitiveHelpAction(ht("/Dialog/RelationEditor"))));
        return pnl;
    }
View Full Code Here

                        tfRole.setEnabled(memberTable.getSelectedRowCount() > 0);
                    }
                }
        );
        tfRole.setEnabled(memberTable.getSelectedRowCount() > 0);
        SideButton btnApply = new SideButton(setRoleAction);
        btnApply.setPreferredSize(new Dimension(20,20));
        btnApply.setText("");
        p3.add(btnApply);

        gc.gridx = 1;
        gc.gridy = 2;
        gc.fill = GridBagConstraints.HORIZONTAL;
View Full Code Here

        lstPrimitives.setSelectionModel(selectionModel);
        lstPrimitives.setCellRenderer(new OsmPrimitivRenderer());
        lstPrimitives.setTransferHandler(null); // Fix #6290. Drag & Drop is not supported anyway and Copy/Paste is better propagated to main window

        // the select action
        final SideButton selectButton = new SideButton(actSelect);
        lstPrimitives.getSelectionModel().addListSelectionListener(actSelect);
        selectButton.createArrow(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                SelectionHistoryPopup.launch(selectButton, model.getSelectionHistory());
            }
        });

        // the search button
        final SideButton searchButton = new SideButton(actSearch);
        searchButton.createArrow(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                SearchPopupMenu.launch(searchButton);
            }
        });
View Full Code Here

        add(browser, BorderLayout.CENTER);

        JPanel pnl = new JPanel();
        pnl.setLayout(new FlowLayout(FlowLayout.CENTER));

        SideButton btn = new SideButton(new ReloadAction());
        btn.setName("btn.reload");
        pnl.add(btn);

        btn = new SideButton(closeAction = new CloseAction());
        final String closeHistoryBrowserDialogKey = "CloseHistoryBrowserDialog";
        KeyStroke escapeKey = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);
        getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(escapeKey, closeHistoryBrowserDialogKey);
        getRootPane().getActionMap().put(closeHistoryBrowserDialogKey, closeAction);
        btn.setName("btn.close");
        pnl.add(btn);

        btn = new SideButton(new ContextSensitiveHelpAction(ht("/Dialog/HistoryBrowser")));
        btn.setName("btn.help");
        pnl.add(btn);
        add(pnl, BorderLayout.SOUTH);

        HelpUtil.setHelpContext(getRootPane(), ht("/Dialog/HistoryBrowser"));
    }
View Full Code Here

        });
        historyTable.addMouseListener(new ShowHistoryMouseAdapter());
        historyTable.setTableHeader(null);

        createLayout(historyTable, true, Arrays.asList(new SideButton[] {
            new SideButton(reloadAction = new ReloadAction()),
            new SideButton(showHistoryAction = new ShowHistoryAction())
        }));

        // wire actions
        //
        historyTable.getSelectionModel().addListSelectionListener(showHistoryAction);
View Full Code Here

        add(tfChangesetId = new ChangesetIdTextField());
        tfChangesetId.setToolTipText(tr("Enter a changeset id"));
        SelectAllOnFocusGainedDecorator.decorate(tfChangesetId);

        actDownload = new DownloadAction();
        SideButton btn = new SideButton(actDownload);
        tfChangesetId.addActionListener(actDownload);
        tfChangesetId.getDocument().addDocumentListener(actDownload);
        add(btn);

        if (Main.pref.getBoolean("downloadchangeset.autopaste", true)) {
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.gui.SideButton

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.