Changeset 10424 in josm


Ignore:
Timestamp:
2016-06-19T13:33:02+02:00 (5 years ago)
Author:
stoecker
Message:

see #12994 - don't use SideButton outside side panel

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r10378 r10424  
    6262import org.openstreetmap.josm.gui.DefaultNameFormatter;
    6363import org.openstreetmap.josm.gui.MainMenu;
    64 import org.openstreetmap.josm.gui.SideButton;
    6564import org.openstreetmap.josm.gui.dialogs.relation.actions.AddSelectedAfterSelection;
    6665import org.openstreetmap.josm.gui.dialogs.relation.actions.AddSelectedAtEndAction;
     
    358357    protected static JPanel buildOkCancelButtonPanel(OKAction okAction, CancelAction cancelAction) {
    359358        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
    360         pnl.add(new SideButton(okAction));
    361         pnl.add(new SideButton(cancelAction));
    362         pnl.add(new SideButton(new ContextSensitiveHelpAction(ht("/Dialog/RelationEditor"))));
     359        pnl.add(new JButton(okAction));
     360        pnl.add(new JButton(cancelAction));
     361        pnl.add(new JButton(new ContextSensitiveHelpAction(ht("/Dialog/RelationEditor"))));
    363362        return pnl;
    364363    }
     
    489488        );
    490489        tfRole.setEnabled(memberTable.getSelectedRowCount() > 0);
    491         SideButton btnApply = new SideButton(setRoleAction);
     490        JButton btnApply = new JButton(setRoleAction);
    492491        btnApply.setPreferredSize(new Dimension(20, 20));
    493492        btnApply.setText("");
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java

    r10378 r10424  
    1111
    1212import javax.swing.AbstractAction;
     13import javax.swing.JButton;
    1314import javax.swing.JCheckBox;
    1415import javax.swing.JList;
     
    2425import org.openstreetmap.josm.data.osm.Relation;
    2526import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
    26 import org.openstreetmap.josm.gui.SideButton;
    2727import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2828import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
     
    6868        ReloadAction reloadAction = new ReloadAction();
    6969        referrers.getModel().addListDataListener(reloadAction);
    70         pnl.add(new SideButton(reloadAction));
     70        pnl.add(new JButton(reloadAction));
    7171        pnl.add(cbReadFull);
    7272
    7373        editAction = new EditAction();
    7474        referrers.getSelectionModel().addListSelectionListener(editAction);
    75         pnl.add(new SideButton(editAction));
     75        pnl.add(new JButton(editAction));
    7676        add(pnl, BorderLayout.SOUTH);
    7777    }
     
    9292        ReloadAction() {
    9393            putValue(SHORT_DESCRIPTION, tr("Load parent relations"));
    94             putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh"));
     94            new ImageProvider("dialogs", "refresh").getResource().attachImageIcon(this);
    9595            putValue(NAME, tr("Reload"));
    9696            refreshEnabled();
     
    146146        EditAction() {
    147147            putValue(SHORT_DESCRIPTION, tr("Edit the currently selected relation"));
    148             putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit"));
     148            new ImageProvider("dialogs", "edit").getResource().attachImageIcon(this);
    149149            putValue(NAME, tr("Edit"));
    150150            refreshEnabled();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/CancelAction.java

    r9665 r10424  
    4343        super(memberTable, memberTableModel, tagModel, layer, editor, tfRole);
    4444        putValue(SHORT_DESCRIPTION, tr("Cancel the updates and close the dialog"));
    45         putValue(SMALL_ICON, ImageProvider.get("cancel"));
     45        new ImageProvider("cancel").getResource().attachImageIcon(this);
    4646        putValue(NAME, tr("Cancel"));
    4747
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/OKAction.java

    r9665 r10424  
    3333        super(memberTable, memberTableModel, tagModel, layer, editor, tfRole);
    3434        putValue(SHORT_DESCRIPTION, tr("Apply the updates and close the dialog"));
    35         putValue(SMALL_ICON, ImageProvider.get("ok"));
     35        new ImageProvider("ok").getResource().attachImageIcon(this);
    3636        putValue(NAME, tr("OK"));
    3737        setEnabled(true);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SetRoleAction.java

    r9665 r10424  
    3636        this.tfRole = tfRole;
    3737        putValue(SHORT_DESCRIPTION, tr("Sets a role for the selected members"));
    38         putValue(SMALL_ICON, ImageProvider.get("apply"));
     38        new ImageProvider("apply").getResource().attachImageIcon(this);
    3939        putValue(NAME, tr("Apply Role"));
    4040        updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java

    r10378 r10424  
    2323
    2424import javax.swing.AbstractAction;
     25import javax.swing.JButton;
    2526import javax.swing.JCheckBox;
    2627import javax.swing.JComponent;
     
    3839import org.openstreetmap.josm.data.Bounds;
    3940import org.openstreetmap.josm.gui.MapView;
    40 import org.openstreetmap.josm.gui.SideButton;
    4141import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
    4242import org.openstreetmap.josm.gui.help.HelpUtil;
     
    8484    /** the download action and button */
    8585    private final DownloadAction actDownload = new DownloadAction();
    86     protected final SideButton btnDownload = new SideButton(actDownload);
     86    protected final JButton btnDownload = new JButton(actDownload);
    8787
    8888    private void makeCheckBoxRespondToEnter(JCheckBox cb) {
     
    199199
    200200        // -- cancel button
    201         SideButton btnCancel;
     201        JButton btnCancel;
    202202        CancelAction actCancel = new CancelAction();
    203         btnCancel = new SideButton(actCancel);
     203        btnCancel = new JButton(actCancel);
    204204        pnl.add(btnCancel);
    205205        InputMapUtils.enableEnter(btnCancel);
     
    210210
    211211        // -- help button
    212         SideButton btnHelp = new SideButton(new ContextSensitiveHelpAction(getRootPane().getClientProperty("help").toString()));
     212        JButton btnHelp = new JButton(new ContextSensitiveHelpAction(getRootPane().getClientProperty("help").toString()));
    213213        pnl.add(btnHelp);
    214214        InputMapUtils.enableEnter(btnHelp);
     
    484484        CancelAction() {
    485485            putValue(NAME, tr("Cancel"));
    486             putValue(SMALL_ICON, ImageProvider.get("cancel"));
     486            new ImageProvider("cancel").getResource().attachImageIcon(this);
    487487            putValue(SHORT_DESCRIPTION, tr("Click to close the dialog and to abort downloading"));
    488488        }
     
    502502        DownloadAction() {
    503503            putValue(NAME, tr("Download"));
    504             putValue(SMALL_ICON, ImageProvider.get("download"));
     504            new ImageProvider("download").getResource().attachImageIcon(this);
    505505            putValue(SHORT_DESCRIPTION, tr("Click to download the currently selected area"));
    506506            setEnabled(!Main.isOffline(OnlineResource.OSM_API));
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java

    r10420 r10424  
    1919import javax.swing.AbstractAction;
    2020import javax.swing.BorderFactory;
     21import javax.swing.JButton;
    2122import javax.swing.JCheckBox;
    2223import javax.swing.JLabel;
     
    2627import org.openstreetmap.josm.data.oauth.OAuthParameters;
    2728import org.openstreetmap.josm.data.oauth.OAuthToken;
    28 import org.openstreetmap.josm.gui.SideButton;
    2929import org.openstreetmap.josm.gui.oauth.AdvancedOAuthPropertiesPanel;
    3030import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
     
    200200            gc.fill = GridBagConstraints.NONE;
    201201            gc.weightx = 0.0;
    202             add(new SideButton(new AuthoriseNowAction()), gc);
     202            add(new JButton(new AuthoriseNowAction()), gc);
    203203
    204204            // filler - grab remaining space
     
    273273            // -- action buttons
    274274            JPanel btns = new JPanel(new FlowLayout(FlowLayout.LEFT));
    275             btns.add(new SideButton(new RenewAuthorisationAction()));
    276             btns.add(new SideButton(new TestAuthorisationAction()));
     275            btns.add(new JButton(new RenewAuthorisationAction()));
     276            btns.add(new JButton(new TestAuthorisationAction()));
    277277            gc.gridy = 4;
    278278            gc.gridx = 0;
     
    312312            putValue(NAME, tr("Authorize now"));
    313313            putValue(SHORT_DESCRIPTION, tr("Click to step through the OAuth authorization process"));
    314             putValue(SMALL_ICON, ImageProvider.get("oauth", "oauth-small"));
     314            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
    315315        }
    316316
     
    342342            putValue(NAME, tr("New Access Token"));
    343343            putValue(SHORT_DESCRIPTION, tr("Click to step through the OAuth authorization process and generate a new Access Token"));
    344             putValue(SMALL_ICON, ImageProvider.get("oauth", "oauth-small"));
     344            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
    345345        }
    346346    }
     
    356356            putValue(NAME, tr("Test Access Token"));
    357357            putValue(SHORT_DESCRIPTION, tr("Click test access to the OSM server with the current access token"));
    358             putValue(SMALL_ICON, ImageProvider.get("oauth", "oauth-small"));
    359 
     358            new ImageProvider("oauth", "oauth-small").getResource().attachImageIcon(this);
    360359        }
    361360
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r10378 r10424  
    1717
    1818import javax.swing.AbstractAction;
     19import javax.swing.JButton;
    1920import javax.swing.JCheckBox;
    2021import javax.swing.JComponent;
     
    2829import org.openstreetmap.josm.Main;
    2930import org.openstreetmap.josm.data.preferences.CollectionProperty;
    30 import org.openstreetmap.josm.gui.SideButton;
    3131import org.openstreetmap.josm.gui.help.HelpUtil;
    3232import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator;
     
    5353    private final HistoryComboBox tfOsmServerUrl = new HistoryComboBox();
    5454    private transient ApiUrlValidator valOsmServerUrl;
    55     private SideButton btnTest;
     55    private JButton btnTest;
    5656    /** indicates whether to use the default OSM URL or not */
    5757    private JCheckBox cbUseDefaultServerUrl;
     
    116116        ValidateApiUrlAction actTest = new ValidateApiUrlAction();
    117117        tfOsmServerUrl.getEditorComponent().getDocument().addDocumentListener(actTest);
    118         btnTest = new SideButton(actTest);
     118        btnTest = new JButton(actTest);
    119119        add(btnTest, gc);
    120120    }
Note: See TracChangeset for help on using the changeset viewer.