Ignore:
Timestamp:
2016-06-20T17:58:21+02:00 (8 years ago)
Author:
stoecker
Message:

see #12994 - Old style SideButton

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java

    r10378 r10438  
    2424import javax.swing.DefaultListSelectionModel;
    2525import javax.swing.ImageIcon;
     26import javax.swing.JButton;
    2627import javax.swing.JComponent;
    2728import javax.swing.JFrame;
     
    4950import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    5051import org.openstreetmap.josm.gui.JosmUserIdentityManager;
    51 import org.openstreetmap.josm.gui.SideButton;
    5252import org.openstreetmap.josm.gui.dialogs.changeset.query.ChangesetQueryDialog;
    5353import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
     
    7171public class ChangesetCacheManager extends JFrame {
    7272
    73     // CHECKSTYLE.OFF: SingleSpaceSeparator
    74     /** The changeset download icon **/
    75     public static final ImageIcon DOWNLOAD_CONTENT_ICON = ImageProvider.get("dialogs/changeset", "downloadchangesetcontent");
    76     /** The changeset update icon **/
    77     public static final ImageIcon UPDATE_CONTENT_ICON   = ImageProvider.get("dialogs/changeset", "updatechangesetcontent");
    78     // CHECKSTYLE.ON: SingleSpaceSeparator
    79 
    8073    /** the unique instance of the cache manager  */
    8174    private static volatile ChangesetCacheManager instance;
     
    134127        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
    135128
    136         SideButton btn = new SideButton(new QueryAction());
     129        JButton btn = new JButton(new QueryAction());
    137130        pnl.add(btn);
    138131        pnl.add(new SingleChangesetDownloadPanel());
    139         pnl.add(new SideButton(new DownloadMyChangesets()));
     132        pnl.add(new JButton(new DownloadMyChangesets()));
    140133
    141134        return pnl;
     
    151144
    152145        //-- cancel and close action
    153         pnl.add(new SideButton(new CancelAction()));
     146        pnl.add(new JButton(new CancelAction()));
    154147
    155148        //-- help action
    156         pnl.add(new SideButton(new ContextSensitiveHelpAction(HelpUtil.ht("/Dialog/ChangesetManager"))));
     149        pnl.add(new JButton(new ContextSensitiveHelpAction(HelpUtil.ht("/Dialog/ChangesetManager"))));
    157150
    158151        return pnl;
     
    359352        CancelAction() {
    360353            putValue(NAME, tr("Close"));
    361             putValue(SMALL_ICON, ImageProvider.get("cancel"));
     354            new ImageProvider("cancel").getResource().attachImageIcon(this);
    362355            putValue(SHORT_DESCRIPTION, tr("Close the dialog"));
    363356        }
     
    380373        QueryAction() {
    381374            putValue(NAME, tr("Query"));
    382             putValue(SMALL_ICON, ImageProvider.get("dialogs", "search"));
     375            new ImageProvider("dialogs", "search").getResource().attachImageIcon(this);
    383376            putValue(SHORT_DESCRIPTION, tr("Launch the dialog for querying changesets"));
    384377            setEnabled(!Main.isOffline(OnlineResource.OSM_API));
     
    416409        RemoveFromCacheAction(ChangesetCacheManagerModel model) {
    417410            putValue(NAME, tr("Remove from cache"));
    418             putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
     411            new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this);
    419412            putValue(SHORT_DESCRIPTION, tr("Remove the selected changesets from the local cache"));
    420413            this.model = model;
     
    446439        CloseSelectedChangesetsAction(ChangesetCacheManagerModel model) {
    447440            putValue(NAME, tr("Close"));
    448             putValue(SMALL_ICON, ImageProvider.get("closechangeset"));
     441            new ImageProvider("closechangeset").getResource().attachImageIcon(this);
    449442            putValue(SHORT_DESCRIPTION, tr("Close the selected changesets"));
    450443            this.model = model;
     
    490483        DownloadSelectedChangesetsAction(ChangesetCacheManagerModel model) {
    491484            putValue(NAME, tr("Update changeset"));
    492             putValue(SMALL_ICON, ImageProvider.get("dialogs/changeset", "updatechangeset"));
     485            new ImageProvider("dialogs/changeset", "updatechangeset").getResource().attachImageIcon(this);
    493486            putValue(SHORT_DESCRIPTION, tr("Updates the selected changesets with current data from the OSM server"));
    494487            this.model = model;
     
    523516        DownloadSelectedChangesetContentAction(ChangesetCacheManagerModel model) {
    524517            putValue(NAME, tr("Download changeset content"));
    525             putValue(SMALL_ICON, DOWNLOAD_CONTENT_ICON);
     518            new ImageProvider("dialogs/changeset", "downloadchangesetcontent").getResource().attachImageIcon(this);
    526519            putValue(SHORT_DESCRIPTION, tr("Download the content of the selected changesets from the server"));
    527520            this.model = model;
     
    570563        DownloadMyChangesets() {
    571564            putValue(NAME, tr("My changesets"));
    572             putValue(SMALL_ICON, ImageProvider.get("dialogs/changeset", "downloadchangeset"));
     565            new ImageProvider("dialogs/changeset", "downloadchangeset").getResource().attachImageIcon(this);
    573566            putValue(SHORT_DESCRIPTION, tr("Download my changesets from the OSM server (max. 100 changesets)"));
    574567            setEnabled(!Main.isOffline(OnlineResource.OSM_API));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java

    r10413 r10438  
    253253        ShowHistoryAction() {
    254254            putValue(NAME, tr("Show history"));
    255             putValue(SMALL_ICON, ImageProvider.get("dialogs", "history"));
     255            new ImageProvider("dialogs", "history").getResource().attachImageIcon(this);
    256256            putValue(SHORT_DESCRIPTION, tr("Download and show the history of the selected objects"));
    257257            updateEnabledState();
     
    371371        SelectInCurrentLayerAction() {
    372372            putValue(NAME, tr("Select in layer"));
    373             putValue(SMALL_ICON, ImageProvider.get("dialogs", "select"));
     373            new ImageProvider("dialogs", "select").getResource().attachImageIcon(this);
    374374            putValue(SHORT_DESCRIPTION, tr("Select the corresponding primitives in the current data layer"));
    375375            updateEnabledState();
     
    394394        ZoomInCurrentLayerAction() {
    395395            putValue(NAME, tr("Zoom to in layer"));
    396             putValue(SMALL_ICON, ImageProvider.get("dialogs/autoscale", "selection"));
     396            new ImageProvider("dialogs/autoscale", "selection").getResource().attachImageIcon(this);
    397397            putValue(SHORT_DESCRIPTION, tr("Zoom to the corresponding objects in the current data layer"));
    398398            updateEnabledState();
     
    442442                putValue(NAME, tr("Download now"));
    443443                putValue(SHORT_DESCRIPTION, tr("Download the changeset content"));
    444                 putValue(SMALL_ICON, ChangesetCacheManager.DOWNLOAD_CONTENT_ICON);
     444                new ImageProvider("dialogs/changeset", "downloadchangesetcontent").getResource().attachImageIcon(this);
    445445            }
    446446
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java

    r10413 r10438  
    273273        RemoveFromCacheAction() {
    274274            putValue(NAME, tr("Remove from cache"));
    275             putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
     275            new ImageProvider("dialogs", "delete").getResource().attachImageIcon(this);
    276276            putValue(SHORT_DESCRIPTION, tr("Remove the changeset in the detail view panel from the local cache"));
    277277        }
     
    296296        UpdateChangesetAction() {
    297297            putValue(NAME, tr("Update changeset"));
    298             putValue(SMALL_ICON, ChangesetCacheManager.UPDATE_CONTENT_ICON);
     298            new ImageProvider("dialogs/changeset", "updatechangesetcontent").getResource().attachImageIcon(this);
    299299            putValue(SHORT_DESCRIPTION, tr("Update the changeset from the OSM server"));
    300300        }
     
    324324        SelectInCurrentLayerAction() {
    325325            putValue(NAME, tr("Select in layer"));
    326             putValue(SMALL_ICON, ImageProvider.get("dialogs", "select"));
     326            new ImageProvider("dialogs", "select").getResource().attachImageIcon(this);
    327327            putValue(SHORT_DESCRIPTION, tr("Select the primitives in the content of this changeset in the current data layer"));
    328328            updateEnabledState();
     
    385385        ZoomInCurrentLayerAction() {
    386386            putValue(NAME, tr("Zoom to in layer"));
    387             putValue(SMALL_ICON, ImageProvider.get("dialogs/autoscale", "selection"));
     387            new ImageProvider("dialogs/autoscale", "selection").getResource().attachImageIcon(this);
    388388            putValue(SHORT_DESCRIPTION, tr("Zoom to the objects in the content of this changeset in the current data layer"));
    389389            updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanel.java

    r10124 r10438  
    2525import org.openstreetmap.josm.data.osm.Changeset;
    2626import org.openstreetmap.josm.io.OnlineResource;
     27import org.openstreetmap.josm.tools.ImageProvider;
    2728
    2829/**
     
    6465        UpdateChangesetDiscussionAction() {
    6566            putValue(NAME, tr("Update changeset discussion"));
    66             putValue(SMALL_ICON, ChangesetCacheManager.UPDATE_CONTENT_ICON);
     67            new ImageProvider("dialogs/changeset", "updatechangesetcontent").getResource().attachImageIcon(this);
    6768            putValue(SHORT_DESCRIPTION, tr("Update the changeset discussion from the OSM server"));
    6869        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/DownloadChangesetContentAction.java

    r10124 r10438  
    1111import org.openstreetmap.josm.actions.downloadtasks.ChangesetContentDownloadTask;
    1212import org.openstreetmap.josm.tools.CheckParameterUtil;
     13import org.openstreetmap.josm.tools.ImageProvider;
    1314
    1415/**
     
    2627        CheckParameterUtil.ensureParameterNotNull(component, "component");
    2728        putValue(NAME, tr("Download content"));
    28         putValue(SMALL_ICON, ChangesetCacheManager.DOWNLOAD_CONTENT_ICON);
     29        new ImageProvider("dialogs/changeset", "downloadchangesetcontent").getResource().attachImageIcon(this);
    2930        putValue(SHORT_DESCRIPTION, tr("Download the changeset content from the OSM server"));
    3031        this.component = component;
     
    5152        if (component.getCurrentChangeset().getContent() == null) {
    5253            putValue(NAME, tr("Download content"));
    53             putValue(SMALL_ICON, ChangesetCacheManager.DOWNLOAD_CONTENT_ICON);
     54            new ImageProvider("dialogs/changeset", "downloadchangesetcontent").getResource().attachImageIcon(this);
    5455            putValue(SHORT_DESCRIPTION, tr("Download the changeset content from the OSM server"));
    5556        } else {
    5657            putValue(NAME, tr("Update content"));
    57             putValue(SMALL_ICON, ChangesetCacheManager.UPDATE_CONTENT_ICON);
     58            new ImageProvider("dialogs/changeset", "updatechangesetcontent").getResource().attachImageIcon(this);
    5859            putValue(SHORT_DESCRIPTION, tr("Update the changeset content from the OSM server"));
    5960        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/SingleChangesetDownloadPanel.java

    r10378 r10438  
    2222import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    2323import org.openstreetmap.josm.io.OnlineResource;
     24import org.openstreetmap.josm.tools.ImageProvider;
    2425
    2526/**
     
    8081
    8182        DownloadAction() {
    82             putValue(SMALL_ICON, ChangesetCacheManager.DOWNLOAD_CONTENT_ICON);
     83            new ImageProvider("dialogs/changeset", "downloadchangesetcontent").getResource().attachImageIcon(this);
    8384            putValue(SHORT_DESCRIPTION, tr("Download the changeset with the specified id, including the changeset content"));
    8485            updateEnabledState();
Note: See TracChangeset for help on using the changeset viewer.