Changeset 12279 in josm for trunk


Ignore:
Timestamp:
2017-05-30T15:12:36+02:00 (7 years ago)
Author:
Don-vip
Message:

sonar - squid:S3878 - Arrays should not be created for varargs parameters

Location:
trunk/src/org/openstreetmap/josm
Files:
80 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r10713 r12279  
    110110
    111111        GuiHelper.prepareResizeableOptionPane(panel, panel.getPreferredSize());
    112         int ret = new ExtendedDialog(Main.parent, tr("About JOSM..."), new String[] {tr("OK"), tr("Report bug")})
    113             .setButtonIcons(new String[] {"ok", "bug"})
     112        int ret = new ExtendedDialog(Main.parent, tr("About JOSM..."), tr("OK"), tr("Report bug"))
     113            .setButtonIcons("ok", "bug")
    114114            .setContent(panel, false)
    115115            .showDialog().getValue();
  • trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java

    r11885 r12279  
    114114            return targetLayers[0];
    115115        }
    116         ExtendedDialog ed = new ExtendedDialog(Main.parent, title, new String[] {buttonText, tr("Cancel")});
    117         ed.setButtonIcons(new String[] {buttonIcon, "cancel"});
     116        ExtendedDialog ed = new ExtendedDialog(Main.parent, title, buttonText, tr("Cancel"));
     117        ed.setButtonIcons(buttonIcon, "cancel");
    118118        ed.setContent(pnl);
    119119        ed.showDialog();
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r11657 r12279  
    4949    static class SelectWmsLayersDialog extends ExtendedDialog {
    5050        SelectWmsLayersDialog(WMSLayerTree tree, JComboBox<String> formats) {
    51             super(Main.parent, tr("Select WMS layers"), new String[]{tr("Add layers"), tr("Cancel")});
     51            super(Main.parent, tr("Select WMS layers"), tr("Add layers"), tr("Cancel"));
    5252            final JScrollPane scrollPane = new JScrollPane(tree.getLayerTree());
    5353            scrollPane.setPreferredSize(new Dimension(400, 400));
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r11553 r12279  
    6161
    6262    protected static boolean confirmChangeDirectionOfWays() {
    63         ExtendedDialog ed = new ExtendedDialog(Main.parent,
     63        return new ExtendedDialog(Main.parent,
    6464                tr("Change directions?"),
    65                 new String[] {tr("Reverse and Combine"), tr("Cancel")});
    66         ed.setButtonIcons(new String[] {"wayflip", "cancel"});
    67         ed.setContent(tr("The ways can not be combined in their current directions.  "
    68                 + "Do you want to reverse some of them?"));
    69         ed.toggleEnable("combineway-reverse");
    70         ed.showDialog();
    71         return ed.getValue() == 1;
     65                tr("Reverse and Combine"), tr("Cancel"))
     66            .setButtonIcons("wayflip", "cancel")
     67            .setContent(tr("The ways can not be combined in their current directions.  "
     68                + "Do you want to reverse some of them?"))
     69            .toggleEnable("combineway-reverse")
     70            .showDialog()
     71            .getValue() == 1;
    7272    }
    7373
  • trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java

    r10383 r12279  
    5858         */
    5959        public HistoryObjectIDDialog() {
    60             super(Main.parent, tr("Show history"), new String[]{tr("Show history"), tr("Cancel")});
    61             setButtonIcons(new String[]{"dialogs/history", "cancel"});
     60            super(Main.parent, tr("Show history"), tr("Show history"), tr("Cancel"));
     61            setButtonIcons("dialogs/history", "cancel");
    6262            init();
    6363        }
  • trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java

    r12093 r12279  
    217217                    new String[] {tr("OK"), tr("Cancel")},
    218218                    false);
    219             setButtonIcons(new String[] {"ok", "cancel"});
     219            setButtonIcons("ok", "cancel");
    220220            contentInsets = new Insets(10, 15, 5, 15);
    221221            JPanel pnl = new JPanel(new GridBagLayout());
     
    294294                    Main.parent,
    295295                    tr("Overwrite"),
    296                     new String[] {tr("Overwrite"), tr("Cancel")}
     296                    tr("Overwrite"), tr("Cancel")
    297297            ) { {
    298298                contentInsets = new Insets(10, 15, 10, 15);
    299299            } };
    300300            dialog.setContent(tr("Offset bookmark already exists. Overwrite?"));
    301             dialog.setButtonIcons(new String[] {"ok.png", "cancel.png"});
     301            dialog.setButtonIcons("ok", "cancel");
    302302            dialog.setupDialog();
    303303            dialog.setVisible(true);
  • trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java

    r10604 r12279  
    162162        ExtendedDialog diag = new ExtendedDialog(Main.parent,
    163163                tr("Add Rectified Image"),
    164 
    165                 new String[] {tr("Add Rectified Image"), tr("Cancel")});
    166         diag.setContent(panel);
    167         diag.setButtonIcons(new String[] {"OLmarker", "cancel"});
     164                tr("Add Rectified Image"), tr("Cancel"))
     165            .setContent(panel)
     166            .setButtonIcons("OLmarker", "cancel");
    168167
    169168        // This repeatedly shows the dialog in case there has been an error.
  • trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java

    r11986 r12279  
    6565        WhichTasksToPerformDialog(JList<DownloadTask> list) {
    6666            super(Main.parent, tr("Which tasks to perform?"), new String[]{tr("Ok"), tr("Cancel")}, true);
    67             setButtonIcons(new String[]{"ok", "cancel"});
     67            setButtonIcons("ok", "cancel");
    6868            final JPanel pane = new JPanel(new GridLayout(2, 1));
    6969            pane.add(new JLabel(tr("Which tasks to perform?")));
     
    138138        ExtendedDialog dialog = new ExtendedDialog(Main.parent,
    139139                tr("Download Location"),
    140                 new String[] {tr("Download URL"), tr("Cancel")}
    141         );
    142         dialog.setContent(all, false /* don't embedded content in JScrollpane  */);
    143         dialog.setButtonIcons(new String[] {"download", "cancel"});
    144         dialog.setToolTipTexts(new String[] {
     140                tr("Download URL"), tr("Cancel"))
     141            .setContent(all, false /* don't embedded content in JScrollpane  */)
     142            .setButtonIcons("download", "cancel")
     143            .setToolTipTexts(
    145144                tr("Start downloading data"),
    146                 tr("Close dialog and cancel downloading")
    147         });
    148         dialog.configureContextsensitiveHelp("/Action/OpenLocation", true /* show help button */);
    149         dialog.showDialog();
    150         if (dialog.getValue() == 1) {
     145                tr("Close dialog and cancel downloading"))
     146            .configureContextsensitiveHelp("/Action/OpenLocation", true /* show help button */);
     147        if (dialog.showDialog().getValue() == 1) {
    151148            USE_NEW_LAYER.put(layer.isSelected());
    152149            remindUploadAddressHistory(uploadAddresses);
  • trunk/src/org/openstreetmap/josm/actions/SaveAction.java

    r8510 r12279  
    4747                    Main.parent,
    4848                    tr("Overwrite"),
    49                     new String[] {tr("Overwrite"), tr("Cancel")}
    50             );
    51             dialog.setButtonIcons(new String[] {"save_as", "cancel"});
    52             dialog.setContent(tr("File {0} exists. Overwrite?", f.getName()));
    53             dialog.showDialog();
    54             int ret = dialog.getValue();
    55             if (ret != 1) {
     49                    tr("Overwrite"), tr("Cancel"))
     50                .setButtonIcons("save_as", "cancel")
     51                .setContent(tr("File {0} exists. Overwrite?", f.getName()));
     52            if (dialog.showDialog().getValue() != 1) {
    5653                f = null;
    5754            }
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r10407 r12279  
    207207    public static boolean confirmOverwrite(File file) {
    208208        if (file == null || file.exists()) {
    209             ExtendedDialog dialog = new ExtendedDialog(
     209            return new ExtendedDialog(
    210210                    Main.parent,
    211211                    tr("Overwrite"),
    212                     new String[] {tr("Overwrite"), tr("Cancel")}
    213             );
    214             dialog.setContent(tr("File exists. Overwrite?"));
    215             dialog.setButtonIcons(new String[] {"save_as", "cancel"});
    216             dialog.showDialog();
    217             return dialog.getValue() == 1;
     212                    tr("Overwrite"), tr("Cancel"))
     213                .setContent(tr("File exists. Overwrite?"))
     214                .setButtonIcons("save_as", "cancel")
     215                .showDialog()
     216                .getValue() == 1;
    218217        }
    219218        return true;
  • trunk/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java

    r11889 r12279  
    5353        contentPanel.add(searchTermBox, gc);
    5454
    55         ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Search for notes"),
    56                 new String[] {tr("Search for notes"), tr("Cancel")});
    57         ed.setContent(contentPanel);
    58         ed.setButtonIcons(new String[] {"note_search", "cancel"});
    59         ed.showDialog();
    60         if (ed.getValue() != 1) {
     55        ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Search for notes"), tr("Search for notes"), tr("Cancel"))
     56            .setContent(contentPanel)
     57            .setButtonIcons("note_search", "cancel");
     58        if (ed.showDialog().getValue() != 1) {
    6159            return;
    6260        }
     
    6462        String searchTerm = Optional.ofNullable(searchTermBox.getText()).orElse("").trim();
    6563        if (searchTerm.isEmpty()) {
    66             Notification notification = new Notification(tr("You must enter a search term"));
    67             notification.setIcon(JOptionPane.WARNING_MESSAGE);
    68             notification.show();
     64            new Notification(tr("You must enter a search term"))
     65                .setIcon(JOptionPane.WARNING_MESSAGE)
     66                .show();
    6967            return;
    7068        }
  • trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java

    r11848 r12279  
    118118            fc = createAndOpenFileChooser(false, false, tr("Save session"), joz, JFileChooser.FILES_ONLY, "lastDirectory");
    119119        } else {
    120             fc = createAndOpenFileChooser(false, false, tr("Save session"), Arrays.asList(new FileFilter[]{jos, joz}), jos,
     120            fc = createAndOpenFileChooser(false, false, tr("Save session"), Arrays.asList(jos, joz), jos,
    121121                    JFileChooser.FILES_ONLY, "lastDirectory");
    122122        }
     
    188188         */
    189189        public SessionSaveAsDialog() {
    190             super(Main.parent, tr("Save Session"), new String[] {tr("Save As"), tr("Cancel")});
     190            super(Main.parent, tr("Save Session"), tr("Save As"), tr("Cancel"));
    191191            initialize();
    192             setButtonIcons(new String[] {"save_as", "cancel"});
     192            setButtonIcons("save_as", "cancel");
    193193            setDefaultButton(1);
    194194            setRememberWindowGeometry(getClass().getName() + ".geometry",
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r12217 r12279  
    291291        ExtendedDialog ed = new ExtendedDialog(Main.parent,
    292292                tr("Status Report"),
    293                 new String[] {tr("Copy to clipboard and close"), tr("Report bug"), tr("Close") });
    294         ed.setButtonIcons(new String[] {"copy", "bug", "cancel" });
     293                tr("Copy to clipboard and close"), tr("Report bug"), tr("Close"));
     294        ed.setButtonIcons("copy", "bug", "cancel");
    295295        ed.setContent(ta, false);
    296296        ed.setMinimumSize(new Dimension(380, 200));
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r12031 r12279  
    243243            configureList();
    244244
    245             setButtonIcons(new String[]{"ok", "cancel"});
     245            setButtonIcons("ok", "cancel");
    246246            final JPanel pane = new JPanel(new GridBagLayout());
    247247            pane.add(new JLabel(getTitle()), GBC.eol().fill(GBC.HORIZONTAL));
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r12031 r12279  
    206206
    207207        private PropertiesMembershipDialog(boolean preselectNew, boolean queryTags, boolean queryMemberships) {
    208             super(Main.parent, tr("Tags / Memberships"), new String[]{tr("Unglue"), tr("Cancel")});
    209             setButtonIcons(new String[]{"unglueways", "cancel"});
     208            super(Main.parent, tr("Tags / Memberships"), tr("Unglue"), tr("Cancel"));
     209            setButtonIcons("unglueways", "cancel");
    210210
    211211            final JPanel content = new JPanel(new GridBagLayout());
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r12065 r12279  
    869869            super(Main.parent,
    870870                    tr("Move elements"),
    871                     new String[]{tr("Move them"), tr("Undo move")});
    872             setButtonIcons(new String[]{"reorder", "cancel"});
     871                    tr("Move them"), tr("Undo move"));
     872            setButtonIcons("reorder", "cancel");
    873873            setCancelButton(2);
    874874        }
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r11986 r12279  
    340340                Main.parent,
    341341                initialValues instanceof Filter ? tr("Filter") : tr("Search"),
    342                         new String[] {
    343                     initialValues instanceof Filter ? tr("Submit filter") : tr("Start Search"),
    344                             tr("Cancel")}
     342                initialValues instanceof Filter ? tr("Submit filter") : tr("Start Search"),
     343                tr("Cancel")
    345344        ) {
    346345            @Override
     
    368367            }
    369368        };
    370         dialog.setButtonIcons(new String[] {"dialogs/search", "cancel"});
     369        dialog.setButtonIcons("dialogs/search", "cancel");
    371370        dialog.configureContextsensitiveHelp("/Action/Search", true /* show help button */);
    372371        dialog.setContent(p);
    373         dialog.showDialog();
    374         int result = dialog.getValue();
    375 
    376         if (result != 1) return null;
     372
     373        if (dialog.showDialog().getValue() != 1) return null;
    377374
    378375        // User pressed OK - let's perform the search
  • trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java

    r9543 r12279  
    8080                Main.parent,
    8181                tr("Cycling dependencies"),
    82                 new String[] {tr("OK")}
     82                tr("OK")
    8383        );
    8484        dialog.setContent(pnl, false /* don't embed in scroll pane */);
    85         dialog.setButtonIcons(new String[] {"ok"});
     85        dialog.setButtonIcons("ok");
    8686        dialog.setRememberWindowGeometry(
    8787                getClass().getName() + ".geometry",
  • trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java

    r12212 r12279  
    141141        ExtendedDialog ed = new ExtendedDialog(Main.parent,
    142142                tr("Suspicious data found. Upload anyway?"),
    143                 new String[] {tr("Continue upload"), tr("Cancel")});
    144         ed.setButtonIcons(new String[] {"ok.png", "cancel.png"});
    145         ed.setContent(p);
    146         ed.showDialog();
     143                tr("Continue upload"), tr("Cancel"))
     144            .setButtonIcons("ok", "cancel")
     145            .setContent(p);
    147146
    148         if (ed.getValue() != 1) {
     147        if (ed.showDialog().getValue() != 1) {
    149148            OsmValidator.initializeTests();
    150149            OsmValidator.initializeErrorLayer();
  • trunk/src/org/openstreetmap/josm/corrector/ReverseWayNoTagCorrector.java

    r11848 r12279  
    3636     * Tags that imply a semantic meaning from the way direction and cannot be changed.
    3737     */
    38     private static final TagCollection directionalTags = new TagCollection(Arrays.asList(new Tag[]{
     38    private static final TagCollection directionalTags = new TagCollection(Arrays.asList(
    3939            new Tag("natural", "coastline"),
    4040            new Tag("natural", "cliff"),
     
    4242            new Tag("barrier", "kerb"),
    4343            new Tag("barrier", "retaining_wall"),
    44             new Tag("man_made", "embankment"),
    45     }));
     44            new Tag("man_made", "embankment")
     45    ));
    4646
    4747    /**
  • trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java

    r10469 r12279  
    3030    private static final String ERROR_MESSAGE = "errorMessage";
    3131    // this contains all of the above
    32     private static final Set<String> RESERVED_KEYS = new HashSet<>(Arrays.asList(new String[]{
     32    private static final Set<String> RESERVED_KEYS = new HashSet<>(Arrays.asList(
    3333        NO_TILE_AT_ZOOM,
    3434        ETAG,
     
    3737        HTTP_RESPONSE_CODE,
    3838        ERROR_MESSAGE
    39     }));
    40 
     39    ));
    4140
    4241    /**
  • trunk/src/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelper.java

    r12232 r12279  
    177177            if (event == XMLStreamReader.START_ELEMENT && QN_OWS_CONSTRAINT.equals(reader.getName())
    178178             && "GetEncoding".equals(reader.getAttributeValue("", "name"))) {
    179                 moveReaderToTag(reader, new QName[]{
    180                         QN_OWS_ALLOWED_VALUES,
    181                         QN_OWS_VALUE
    182                 });
     179                moveReaderToTag(reader, QN_OWS_ALLOWED_VALUES, QN_OWS_VALUE);
    183180                return TransferMode.fromString(reader.getElementText());
    184181            }
  • trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java

    r12224 r12279  
    194194
    195195        SelectLayerDialog(Collection<Layer> layers) {
    196             super(Main.parent, tr("Select WMTS layer"), new String[]{tr("Add layers"), tr("Cancel")});
     196            super(Main.parent, tr("Select WMTS layer"), tr("Add layers"), tr("Cancel"));
    197197            this.layers = groupLayersByNameAndTileMatrixSet(layers);
    198198            //getLayersTable(layers, Main.getProjection())
     
    464464                    } else if (QN_STYLE.equals(reader.getName()) &&
    465465                            "true".equals(reader.getAttributeValue("", "isDefault"))) {
    466                         if (GetCapabilitiesParseHelper.moveReaderToTag(reader, new QName[] {GetCapabilitiesParseHelper.QN_OWS_IDENTIFIER})) {
     466                        if (GetCapabilitiesParseHelper.moveReaderToTag(reader, GetCapabilitiesParseHelper.QN_OWS_IDENTIFIER)) {
    467467                            layer.style = reader.getElementText();
    468468                            tagStack.push(reader.getName()); // keep tagStack in sync
     
    636636                    GetCapabilitiesParseHelper.QN_OWS_OPERATION.equals(reader.getName()) &&
    637637                    "GetTile".equals(reader.getAttributeValue("", "name")) &&
    638                     GetCapabilitiesParseHelper.moveReaderToTag(reader, new QName[] {
     638                    GetCapabilitiesParseHelper.moveReaderToTag(reader,
    639639                            GetCapabilitiesParseHelper.QN_OWS_DCP,
    640640                            GetCapabilitiesParseHelper.QN_OWS_HTTP,
    641                             GetCapabilitiesParseHelper.QN_OWS_GET,
    642                     })) {
     641                            GetCapabilitiesParseHelper.QN_OWS_GET
     642                    )) {
    643643                this.baseUrl = reader.getAttributeValue(GetCapabilitiesParseHelper.XLINK_NS_URL, "href");
    644644                this.transferMode = GetCapabilitiesParseHelper.getTransferMode(reader);
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java

    r12218 r12279  
    303303    public AbstractMapRenderer createActiveRenderer(Graphics2D g, NavigatableComponent viewport, boolean isInactiveMode) {
    304304        try {
    305             Constructor<?> c = activeRenderer.getConstructor(new Class<?>[]{Graphics2D.class, NavigatableComponent.class, boolean.class});
     305            Constructor<?> c = activeRenderer.getConstructor(Graphics2D.class, NavigatableComponent.class, boolean.class);
    306306            return AbstractMapRenderer.class.cast(c.newInstance(g, viewport, isInactiveMode));
    307307        } catch (InvocationTargetException e) {
  • trunk/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java

    r12013 r12279  
    5252        double y = dy + xyz[1]*(1+s) + xyz[0]*rz - xyz[2]*rx;
    5353        double z = dz + xyz[2]*(1+s) + xyz[1]*rx - xyz[0]*ry;
    54         return Ellipsoid.WGS84.cart2LatLon(new double[] {x, y, z});
     54        return Ellipsoid.WGS84.cart2LatLon(x, y, z);
    5555    }
    5656
     
    6161        double y = (1-s)*(-dy + xyz[1] + ((-dx+xyz[0])*(-rz) - (-dz+xyz[2])*(-rx)));
    6262        double z = (1-s)*(-dz + xyz[2] + ((-dy+xyz[1])*(-rx) - (-dx+xyz[0])*(-ry)));
    63         return this.ellps.cart2LatLon(new double[] {x, y, z});
     63        return this.ellps.cart2LatLon(x, y, z);
    6464    }
    6565}
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r12187 r12279  
    265265            // TODO directionKeys are no longer in OsmPrimitive (search pattern is used instead)
    266266            for (String a : Main.pref.getCollection(ValidatorPreference.PREFIX + ".knownkeys",
    267                     Arrays.asList(new String[]{"is_in", "int_ref", "fixme", "population"}))) {
     267                    Arrays.asList("is_in", "int_ref", "fixme", "population"))) {
    268268                additionalPresetsValueData.putVoid(a);
    269269            }
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r12273 r12279  
    545545                            Main.parent,
    546546                            tr("Unsaved osm data"),
    547                             new String[] {tr("Restore"), tr("Cancel"), tr("Discard")}
     547                            tr("Restore"), tr("Cancel"), tr("Discard")
    548548                            );
    549549                    dialog.setContent(
     
    551551                                    "JOSM found {0} unsaved osm data layers. ", unsavedLayerFiles.size(), unsavedLayerFiles.size()) +
    552552                                    tr("It looks like JOSM crashed last time. Would you like to restore the data?"));
    553                     dialog.setButtonIcons(new String[] {"ok", "cancel", "dialogs/delete"});
     553                    dialog.setButtonIcons("ok", "cancel", "dialogs/delete");
    554554                    int selection = dialog.showDialog().getValue();
    555555                    if (selection == 1) {
     
    567567                ExtendedDialog ed = new ExtendedDialog(
    568568                        Main.parent, title,
    569                         new String[]{tr("Change proxy settings"), tr("Cancel")});
    570                 ed.setButtonIcons(new String[]{"dialogs/settings", "cancel"}).setCancelButton(2);
     569                        tr("Change proxy settings"), tr("Cancel"));
     570                ed.setButtonIcons("dialogs/settings", "cancel").setCancelButton(2);
    571571                ed.setMinimumSize(new Dimension(460, 260));
    572572                ed.setIcon(JOptionPane.WARNING_MESSAGE);
  • trunk/src/org/openstreetmap/josm/gui/NoteInputDialog.java

    r9078 r12279  
    3232     */
    3333    public NoteInputDialog(Component parent, String title, String buttonText) {
    34         super(parent, title, new String[] {buttonText, tr("Cancel")});
     34        super(parent, title, buttonText, tr("Cancel"));
    3535    }
    3636
     
    5656        contentPanel.add(scrollPane);
    5757        setContent(contentPanel, false);
    58         setButtonIcons(new Icon[] {icon, ImageProvider.get("cancel.png")});
     58        setButtonIcons(icon, ImageProvider.get("cancel.png"));
    5959
    6060        showDialog();
     
    6767        return textArea.getText();
    6868    }
    69 
    7069}
  • trunk/src/org/openstreetmap/josm/gui/NoteSortDialog.java

    r11821 r12279  
    3333     */
    3434    public NoteSortDialog(Component parent, String title, String buttonText) {
    35         super(parent, title, new String[] {buttonText, tr("Cancel")});
     35        super(parent, title, buttonText, tr("Cancel"));
    3636    }
    3737
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java

    r11879 r12279  
    1717     * compare my version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with their version
    1818     */
    19     MY_WITH_THEIR(tr("My with Their"), new ListRole[] {MY_ENTRIES, THEIR_ENTRIES}),
     19    MY_WITH_THEIR(tr("My with Their"), MY_ENTRIES, THEIR_ENTRIES),
    2020
    2121    /**
    2222     * compare my version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with the merged version
    2323     */
    24     MY_WITH_MERGED(tr("My with Merged"), new ListRole[] {MY_ENTRIES, MERGED_ENTRIES}),
     24    MY_WITH_MERGED(tr("My with Merged"), MY_ENTRIES, MERGED_ENTRIES),
    2525
    2626    /**
    2727     * compare their version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with the merged veresion
    2828     */
    29     THEIR_WITH_MERGED(tr("Their with Merged"), new ListRole[] {THEIR_ENTRIES, MERGED_ENTRIES});
     29    THEIR_WITH_MERGED(tr("Their with Merged"), THEIR_ENTRIES, MERGED_ENTRIES);
    3030
    3131    /** the localized display name */
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveDataPaster.java

    r11746 r12279  
    136136    private static boolean confirmDeleteIncomplete() {
    137137        ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Delete incomplete members?"),
    138                 new String[] {tr("Paste without incomplete members"), tr("Cancel")});
    139         ed.setButtonIcons(new String[] {"dialogs/relation/deletemembers", "cancel"});
     138                tr("Paste without incomplete members"), tr("Cancel"));
     139        ed.setButtonIcons("dialogs/relation/deletemembers", "cancel");
    140140        ed.setContent(tr(
    141141                "The copied data contains incomplete objects.  " + "When pasting the incomplete objects are removed.  "
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r11747 r12279  
    211211        lstInActiveDataLayer.addMouseListener(popupMenuLauncher);
    212212
    213         createLayout(pnl, false, Arrays.asList(new SideButton[] {
     213        createLayout(pnl, false, Arrays.asList(
    214214            new SideButton(selectObjectsAction, false),
    215215            new SideButton(readChangesetAction, false),
     
    217217            new SideButton(showChangesetInfoAction, false),
    218218            new SideButton(new LaunchChangesetManagerAction(), false)
    219         }));
     219        ));
    220220    }
    221221
  • trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java

    r10788 r12279  
    127127        wireUpdateEnabledStateUpdater(redoAction, redoTree);
    128128
    129         scrollPane = (JScrollPane) createLayout(treesPanel, true, Arrays.asList(new SideButton[] {
     129        scrollPane = (JScrollPane) createLayout(treesPanel, true, Arrays.asList(
    130130            new SideButton(selectAction),
    131131            new SideButton(undoAction),
    132132            new SideButton(redoAction)
    133         }));
     133        ));
    134134
    135135        InputMapUtils.addEnterAction(undoTree, selectAndZoomAction);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r12178 r12279  
    135135        addListSelectionListener(actSelect);
    136136
    137         createLayout(lstConflicts, true, Arrays.asList(new SideButton[] {
    138             btnResolve, btnSelect
    139         }));
     137        createLayout(lstConflicts, true, Arrays.asList(btnResolve, btnSelect));
    140138
    141139        popupMenuHandler.addAction(Main.main.menu.autoScaleActions.get("conflict"));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java

    r12046 r12279  
    4545    public ConflictResolutionDialog(Component parent) {
    4646        // We define our own actions, but need to give a hint about number of buttons
    47         super(parent, tr("Resolve conflicts"), new String[] {null, null, null});
     47        super(parent, tr("Resolve conflicts"), null, null, null);
    4848        setDefaultButton(1);
    4949        setCancelButton(2);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r11993 r12279  
    239239        });
    240240
    241         createLayout(userTable, true, Arrays.asList(new SideButton[] {
     241        createLayout(userTable, true, Arrays.asList(
    242242                addButton, editButton, deleteButton, upButton, downButton
    243         }));
     243        ));
    244244    }
    245245
  • trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java

    r11452 r12279  
    6262     */
    6363    public InspectPrimitiveDialog(final Collection<OsmPrimitive> primitives, OsmDataLayer layer) {
    64         super(Main.parent, tr("Advanced object info"), new String[] {tr("Close")});
     64        super(Main.parent, tr("Advanced object info"), tr("Close"));
    6565        this.primitives = new ArrayList<>(primitives);
    6666        this.layer = layer;
     
    6868                WindowGeometry.centerInWindow(Main.parent, new Dimension(750, 550)));
    6969
    70         setButtonIcons(new String[]{"ok.png"});
     70        setButtonIcons("ok");
    7171        final JTabbedPane tabs = new JTabbedPane();
    7272
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java

    r11653 r12279  
    156156
    157157    public LatLonDialog(Component parent, String title, String help) {
    158         super(parent, title, new String[] {tr("Ok"), tr("Cancel")});
    159         setButtonIcons(new String[] {"ok", "cancel"});
     158        super(parent, title, tr("Ok"), tr("Cancel"));
     159        setButtonIcons("ok", "cancel");
    160160        configureContextsensitiveHelp(help, true);
    161161
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java

    r10793 r12279  
    5151                ExtendedDialog ed = new ExtendedDialog(
    5252                        Main.parent, tr("Information about layer"),
    53                         new String[] {tr("OK")});
    54                 ed.setButtonIcons(new String[] {"ok"});
     53                        tr("OK"));
     54                ed.setButtonIcons("ok");
    5555                ed.setIcon(JOptionPane.INFORMATION_MESSAGE);
    5656                ed.setContent((Component) object);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LogShowDialog.java

    r8510 r12279  
    3030     */
    3131    public LogShowDialog(String title, String msg, String log) {
    32         super(Main.parent, title, new String[] {tr("OK")});
    33         setButtonIcons(new String[] {"ok.png"});
     32        super(Main.parent, title, tr("OK"));
     33        setButtonIcons("ok");
    3434        setContent(build(msg, log));
    3535    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java

    r11881 r12279  
    535535                return;
    536536            final StyleSource s = model.getRow(sel);
    537             ExtendedDialog info = new ExtendedDialog(Main.parent, tr("Map Style info"), new String[] {tr("Close")});
     537            ExtendedDialog info = new ExtendedDialog(Main.parent, tr("Map Style info"), tr("Close"));
    538538            info.setPreferredSize(new Dimension(600, 400));
    539             info.setButtonIcons(new String[] {"ok.png"});
     539            info.setButtonIcons("ok");
    540540
    541541            final JTabbedPane tabs = new JTabbedPane();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java

    r11496 r12279  
    2727
    2828    private MenuItemSearchDialog(MainMenu menu) {
    29         super(Main.parent, tr("Search menu items"), new String[]{tr("Select"), tr("Cancel")});
     29        super(Main.parent, tr("Search menu items"), tr("Select"), tr("Cancel"));
    3030        this.selector = new Selector(menu);
    3131        this.selector.setDblClickListener(e -> buttonAction(0, null));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

    r11713 r12279  
    107107        pane.add(new JScrollPane(displayList), BorderLayout.CENTER);
    108108
    109         createLayout(pane, false, Arrays.asList(new SideButton[]{
     109        createLayout(pane, false, Arrays.asList(
    110110                new SideButton(downloadNotesInViewAction, false),
    111111                new SideButton(newAction, false),
     
    115115                new SideButton(sortAction, false),
    116116                new SideButton(openInBrowserAction, false),
    117                 new SideButton(uploadAction, false)}));
     117                new SideButton(uploadAction, false)));
    118118        updateButtonStates();
    119119    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r11610 r12279  
    163163        recentRelationsAction = new RecentRelationsAction(editButton);
    164164
    165         createLayout(pane, false, Arrays.asList(new SideButton[]{
     165        createLayout(pane, false, Arrays.asList(
    166166                new SideButton(newAction, false),
    167167                editButton,
     
    169169                new SideButton(deleteRelationsAction, false),
    170170                new SideButton(selectRelationAction, false)
    171         }));
     171        ));
    172172
    173173        InputMapUtils.unassignCtrlShiftUpDown(displaylist, JComponent.WHEN_FOCUSED);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r11680 r12279  
    132132        searchButton.createArrow(e -> SearchPopupMenu.launch(searchButton));
    133133
    134         createLayout(lstPrimitives, true, Arrays.asList(new SideButton[] {
     134        createLayout(lstPrimitives, true, Arrays.asList(
    135135            selectButton, searchButton, new SideButton(actShowHistory)
    136         }));
     136        ));
    137137    }
    138138
  • trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java

    r12101 r12279  
    9797        userTable.getSelectionModel().addListSelectionListener(showUserInfoAction);
    9898
    99         createLayout(userTable, true, Arrays.asList(new SideButton[] {
     99        createLayout(userTable, true, Arrays.asList(
    100100            new SideButton(selectionUsersPrimitivesAction),
    101101            new SideButton(showUserInfoAction)
    102         }));
     102        ));
    103103    }
    104104
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r11764 r12279  
    10141014            ExtendedDialog ed = new ExtendedDialog(Main.parent,
    10151015                    tr("Change relation"),
    1016                     new String[] {tr("Delete from relation"), tr("Cancel")});
    1017             ed.setButtonIcons(new String[] {"dialogs/delete", "cancel"});
     1016                    tr("Delete from relation"), tr("Cancel"));
     1017            ed.setButtonIcons("dialogs/delete", "cancel");
    10181018            ed.setContent(tr("Really delete selection from relation {0}?", cur.getDisplayName(DefaultNameFormatter.getInstance())));
    10191019            ed.toggleEnable(DELETE_FROM_RELATION_PREF);
    1020             ed.showDialog();
    1021 
    1022             if (ed.getValue() != 1)
     1020
     1021            if (ed.showDialog().getValue() != 1)
    10231022                return;
    10241023
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r11945 r12279  
    376376     */
    377377    private static boolean warnOverwriteKey(String action, String togglePref) {
    378         ExtendedDialog ed = new ExtendedDialog(
     378        return new ExtendedDialog(
    379379                Main.parent,
    380380                tr("Overwrite key"),
    381                 new String[]{tr("Replace"), tr("Cancel")});
    382         ed.setButtonIcons(new String[]{"purge", "cancel"});
    383         ed.setContent(action+'\n'+ tr("The new key is already used, overwrite values?"));
    384         ed.setCancelButton(2);
    385         ed.toggleEnable(togglePref);
    386         ed.showDialog();
    387 
    388         return ed.getValue() == 1;
     381                tr("Replace"), tr("Cancel"))
     382            .setButtonIcons("purge", "cancel")
     383            .setContent(action+'\n'+ tr("The new key is already used, overwrite values?"))
     384            .setCancelButton(2)
     385            .toggleEnable(togglePref)
     386            .showDialog().getValue() == 1;
    389387    }
    390388
     
    416414
    417415        protected EditTagDialog(String key, Map<String, Integer> map, final boolean initialFocusOnKey) {
    418             super(Main.parent, trn("Change value?", "Change values?", map.size()), new String[] {tr("OK"), tr("Cancel")});
    419             setButtonIcons(new String[] {"ok", "cancel"});
     416            super(Main.parent, trn("Change value?", "Change values?", map.size()), tr("OK"), tr("Cancel"));
     417            setButtonIcons("ok", "cancel");
    420418            setCancelButton(2);
    421419            configureContextsensitiveHelp("/Dialog/EditValue", true /* show help button */);
     
    679677
    680678        protected AddTagsDialog() {
    681             super(Main.parent, tr("Add value?"), new String[] {tr("OK"), tr("Cancel")});
    682             setButtonIcons(new String[] {"ok", "cancel"});
     679            super(Main.parent, tr("Add value?"), tr("OK"), tr("Cancel"));
     680            setButtonIcons("ok", "cancel");
    683681            setCancelButton(2);
    684682            configureContextsensitiveHelp("/Dialog/AddValue", true /* show help button */);
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java

    r10611 r12279  
    4040     */
    4141    public DownloadObjectDialog(Component parent) {
    42         super(parent, tr("Download object"), new String[]{tr("Download object"), tr("Cancel")});
     42        super(parent, tr("Download object"), tr("Download object"), tr("Cancel"));
    4343        init();
    44         setButtonIcons(new String[]{"download", "cancel"});
    45         setToolTipTexts(new String[]{
     44        setButtonIcons("download", "cancel");
     45        setToolTipTexts(
    4646                tr("Start downloading"),
    4747                tr("Close dialog and cancel downloading")
    48         });
     48        );
    4949        configureContextsensitiveHelp("/Action/DownloadObject", true /* show help button */);
    5050    }
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java

    r10621 r12279  
    218218                Main.parent,
    219219                title,
    220                 new String[] {tr("Ok")})
    221         .setButtonIcons(new String[] {"ok"})
     220                tr("Ok"))
     221        .setButtonIcons("ok")
    222222        .setIcon(msgType)
    223223        .setContent(p, false);
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r12170 r12279  
    429429            Tile clickedTile = clickedTileHolder.getTile();
    430430            if (clickedTile != null) {
    431                 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Tile Info"), new String[]{tr("OK")});
     431                ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Tile Info"), tr("OK"));
    432432                JPanel panel = new JPanel(new GridBagLayout());
    433433                Rectangle2D displaySize = coordinateConverter.getRectangleForTile(clickedTile);
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r12176 r12279  
    659659    @Override public Action[] getMenuEntries() {
    660660        List<Action> actions = new ArrayList<>();
    661         actions.addAll(Arrays.asList(new Action[]{
     661        actions.addAll(Arrays.asList(
    662662                LayerListDialog.getInstance().createActivateLayerAction(this),
    663663                LayerListDialog.getInstance().createShowHideLayerAction(),
     
    667667                LayerListDialog.getInstance().createDuplicateLayerAction(this),
    668668                new LayerSaveAction(this),
    669                 new LayerSaveAsAction(this),
    670         }));
     669                new LayerSaveAsAction(this)));
    671670        if (ExpertToggleAction.isExpert()) {
    672             actions.addAll(Arrays.asList(new Action[]{
     671            actions.addAll(Arrays.asList(
    673672                    new LayerGpxExportAction(this),
    674                     new ConvertToGpxLayerAction()}));
    675         }
    676         actions.addAll(Arrays.asList(new Action[]{
     673                    new ConvertToGpxLayerAction()));
     674        }
     675        actions.addAll(Arrays.asList(
    677676                SeparatorLayerAction.INSTANCE,
    678                 new RenameLayerAction(getAssociatedFile(), this)}));
     677                new RenameLayerAction(getAssociatedFile(), this)));
    679678        if (ExpertToggleAction.isExpert()) {
    680679            actions.add(new ToggleUploadDiscouragedLayerAction(this));
    681680        }
    682         actions.addAll(Arrays.asList(new Action[]{
     681        actions.addAll(Arrays.asList(
    683682                new ConsistencyTestAction(),
    684683                SeparatorLayerAction.INSTANCE,
    685                 new LayerListPopup.InfoAction(this)}));
     684                new LayerListPopup.InfoAction(this)));
    686685        return actions.toArray(new Action[actions.size()]);
    687686    }
     
    10541053                return 2;
    10551054            }
    1056             ExtendedDialog dialog = new ExtendedDialog(
     1055            return new ExtendedDialog(
    10571056                    Main.parent,
    10581057                    tr("Empty document"),
    1059                     new String[] {tr("Save anyway"), tr("Cancel")}
    1060             );
    1061             dialog.setContent(tr("The document contains no data."));
    1062             dialog.setButtonIcons(new String[] {"save", "cancel"});
    1063             return dialog.showDialog().getValue();
     1058                    tr("Save anyway"), tr("Cancel"))
     1059                .setContent(tr("The document contains no data."))
     1060                .setButtonIcons("save", "cancel")
     1061                .showDialog().getValue();
    10641062        })) {
    10651063            return false;
     
    10681066        ConflictCollection conflictsCol = getConflicts();
    10691067        return conflictsCol == null || conflictsCol.isEmpty() || 1 == GuiHelper.runInEDTAndWaitAndReturn(() -> {
    1070             ExtendedDialog dialog = new ExtendedDialog(
     1068            return new ExtendedDialog(
    10711069                    Main.parent,
    10721070                    /* I18N: Display title of the window showing conflicts */
    10731071                    tr("Conflicts"),
    1074                     new String[] {tr("Reject Conflicts and Save"), tr("Cancel")}
    1075             );
    1076             dialog.setContent(
    1077                     tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"));
    1078             dialog.setButtonIcons(new String[] {"save", "cancel"});
    1079             return dialog.showDialog().getValue();
     1072                    tr("Reject Conflicts and Save"), tr("Cancel"))
     1073                .setContent(
     1074                    tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"))
     1075                .setButtonIcons("save", "cancel")
     1076                .showDialog().getValue();
    10801077        });
    10811078    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r11914 r12279  
    142142                        Main.parent,
    143143                        tr("Correlate images with GPX track"),
    144                         new String[] {tr("OK"), tr("Try Again")}).
     144                        tr("OK"), tr("Try Again")).
    145145                        setContent(tr("No images could be matched!")).
    146                         setButtonIcons(new String[] {"ok", "dialogs/refresh"}).
     146                        setButtonIcons("ok", "dialogs/refresh").
    147147                        showDialog().getValue() == 2)
    148148                return AGAIN;
     
    732732            );
    733733            syncDialog.setContent(panelTf, false);
    734             syncDialog.setButtonIcons(new String[] {"ok", "cancel"});
     734            syncDialog.setButtonIcons("ok", "cancel");
    735735            syncDialog.setupDialog();
    736736            outerPanel.add(syncDialog.getContentPane(), BorderLayout.PAGE_START);
     
    955955            new ExtendedDialog(Main.parent,
    956956                    tr("Adjust timezone and offset"),
    957                     new String[] {tr("Close")}).
    958                     setContent(p).setButtonIcons(new String[] {"ok"}).showDialog();
     957                    tr("Close")).
     958                    setContent(p).setButtonIcons("ok").showDialog();
    959959        }
    960960    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r12131 r12279  
    719719                    Main.parent,
    720720                    tr("Delete image file from disk"),
    721                     new String[] {tr("Cancel"), tr("Delete")})
    722             .setButtonIcons(new String[] {"cancel", "dialogs/delete"})
     721                    tr("Cancel"), tr("Delete"))
     722            .setButtonIcons("cancel", "dialogs/delete")
    723723            .setContent(new JLabel(tr("<html><h3>Delete the file {0} from disk?<p>The image file will be permanently lost!</h3></html>",
    724724                    toDelete.getFile().getName()), ImageProvider.get("dialogs/geoimage/deletefromdisk"), SwingConstants.LEFT))
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java

    r12173 r12279  
    265265            // build dialog
    266266            ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Set track visibility for {0}", layer.getName()),
    267                     new String[]{tr("Show all"), tr("Show selected only"), tr("Cancel")});
    268             ed.setButtonIcons(new String[]{"eye", "dialogs/filter", "cancel"});
     267                    tr("Show all"), tr("Show selected only"), tr("Cancel"));
     268            ed.setButtonIcons("eye", "dialogs/filter", "cancel");
    269269            ed.setContent(msg, false);
    270270            ed.setDefaultButton(2);
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r11848 r12279  
    4444import javax.swing.DefaultListModel;
    4545import javax.swing.DefaultListSelectionModel;
    46 import javax.swing.Icon;
    4746import javax.swing.ImageIcon;
    4847import javax.swing.JButton;
     
    916915         */
    917916        public EditSourceEntryDialog(Component parent, String title, SourceEntry e) {
    918             super(parent, title, new String[] {tr("Ok"), tr("Cancel")});
     917            super(parent, title, tr("Ok"), tr("Cancel"));
    919918
    920919            JPanel p = new JPanel(new GridBagLayout());
     
    942941                p.add(cbActive, GBC.eol().insets(15, 0, 5, 0));
    943942            }
    944             setButtonIcons(new String[] {"ok", "cancel"});
     943            setButtonIcons("ok", "cancel");
    945944            setContent(p);
    946945
     
    11911190                }
    11921191                if (!messages.isEmpty()) {
    1193                     ExtendedDialog dlg = new ExtendedDialog(Main.parent, tr("Warning"), new String[] {tr("Cancel"), tr("Continue anyway")});
    1194                     dlg.setButtonIcons(new Icon[] {
     1192                    ExtendedDialog dlg = new ExtendedDialog(Main.parent, tr("Warning"), tr("Cancel"), tr("Continue anyway"));
     1193                    dlg.setButtonIcons(
    11951194                        ImageProvider.get("cancel"),
    11961195                        new ImageProvider("ok").setMaxSize(ImageSizes.LARGEICON).addOverlay(
    11971196                                new ImageOverlay(new ImageProvider("warning-small"), 0.5, 0.5, 1.0, 1.0)).get()
    1198                     });
    1199                     dlg.setToolTipTexts(new String[] {
     1197                    );
     1198                    dlg.setToolTipTexts(
    12001199                        tr("Cancel and return to the previous dialog"),
    1201                         tr("Ignore warning and install style anyway")});
     1200                        tr("Ignore warning and install style anyway"));
    12021201                    dlg.setContent("<html>" + tr("Some entries have unmet dependencies:") +
    12031202                            "<br>" + Utils.join("<br>", messages) + "</html>");
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractListEditor.java

    r9665 r12279  
    2929     */
    3030    public AbstractListEditor(Component parent, String title, PrefEntry entry) {
    31         super(parent, title, new String[] {tr("OK"), tr("Cancel")});
     31        super(parent, title, tr("OK"), tr("Cancel"));
    3232        this.entry = entry;
    33         setButtonIcons(new String[] {"ok.png", "cancel.png"});
     33        setButtonIcons("ok.png", "cancel.png");
    3434        setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(parent, new Dimension(500, 350)));
    3535    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java

    r10853 r12279  
    220220
    221221    private static boolean askAddSetting(JComponent gui, JPanel p) {
    222         return new ExtendedDialog(gui, tr("Add setting"), new String[] {tr("OK"), tr("Cancel")})
    223                 .setContent(p).setButtonIcons(new String[] {"ok.png", "cancel.png"}).showDialog().getValue() == 1;
     222        return new ExtendedDialog(gui, tr("Add setting"), tr("OK"), tr("Cancel"))
     223                .setContent(p).setButtonIcons("ok.png", "cancel.png").showDialog().getValue() == 1;
    224224    }
    225225
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java

    r9759 r12279  
    3030     */
    3131    public StringEditor(final JComponent gui, PrefEntry entry, StringSetting setting) {
    32         super(gui, tr("Change string setting"), new String[] {tr("OK"), tr("Cancel")});
     32        super(gui, tr("Change string setting"), tr("OK"), tr("Cancel"));
    3333        this.entry = entry;
    34         setButtonIcons(new String[] {"ok.png", "cancel.png"});
     34        setButtonIcons("ok", "cancel");
    3535        setContent(build(setting.getValue() == null ? "" : setting.getValue()));
    3636    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryDialog.java

    r9665 r12279  
    2222     */
    2323    public AddImageryDialog(Component parent, AddImageryPanel panel) {
    24         super(parent, tr("Add Imagery URL"), new String[] {tr("OK"), tr("Cancel")});
    25         setButtonIcons(new String[] {"ok", "cancel"});
     24        super(parent, tr("Add Imagery URL"), tr("OK"), tr("Cancel"));
     25        setButtonIcons("ok", "cancel");
    2626        setCancelButton(2);
    2727        configureContextsensitiveHelp("/Dialog/AddImagery", true /* show help button */);
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r11746 r12279  
    266266            defPL2.description = tr("the main Potlatch 2 style");
    267267
    268             return Arrays.asList(new ExtendedSourceEntry[] {defJosmMapcss, defPL2});
     268            return Arrays.asList(defJosmMapcss, defPL2);
    269269        }
    270270
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java

    r11848 r12279  
    6060                            Main.warn(e, tr("Could not read tagging preset source: {0}", source));
    6161                            ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Error"),
    62                                     new String[] {tr("Yes"), tr("No"), tr("Cancel")});
     62                                    tr("Yes"), tr("No"), tr("Cancel"));
    6363                            ed.setContent(tr("Could not read tagging preset source: {0}\nDo you want to keep it?", source));
    6464                            switch (ed.showDialog().getValue()) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r12142 r12279  
    435435            contentInsets = new Insets(10, 5, 0, 5);
    436436            if (showNewRelation) {
    437                 setButtonIcons(new String[] {"ok", "dialogs/addrelation", "cancel" });
     437                setButtonIcons("ok", "dialogs/addrelation", "cancel");
    438438            } else {
    439                 setButtonIcons(new String[] {"ok", "cancel" });
     439                setButtonIcons("ok", "cancel");
    440440            }
    441441            setContent(content);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchDialog.java

    r10590 r12279  
    3232
    3333    private TaggingPresetSearchDialog() {
    34         super(Main.parent, tr("Presets"), new String[] {tr("Select"), tr("Cancel")});
     34        super(Main.parent, tr("Presets"), tr("Select"), tr("Cancel"));
    3535        selector = new TaggingPresetSelector(true, true);
    3636        setContent(selector, false);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java

    r10590 r12279  
    6666
    6767    TaggingPresetSearchPrimitiveDialog() {
    68         super(Main.parent, tr("Presets"), new String[] {tr("Search"), tr("Cancel")});
     68        super(Main.parent, tr("Presets"), tr("Search"), tr("Cancel"));
    6969        selector = new TaggingPresetSelector(false, false);
    7070        setContent(selector, false);
     
    8686            TaggingPreset preset = selector.getSelectedPresetAndUpdateClassification();
    8787            if (preset != null) {
    88 
    8988                final Set<OsmPrimitive> matching = new HashSet<>(Main.getLayerManager().getEditDataSet().getPrimitives(preset));
    9089                Main.getLayerManager().getEditDataSet().setSelected(matching);
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r11746 r12279  
    3333
    3434import javax.swing.GrayFilter;
    35 import javax.swing.Icon;
    3635import javax.swing.ImageIcon;
    3736import javax.swing.JComponent;
     
    197196    public static boolean warnUser(String title, String content, ImageIcon baseActionIcon, String continueToolTip) {
    198197        ExtendedDialog dlg = new ExtendedDialog(Main.parent,
    199                 title, new String[] {tr("Cancel"), tr("Continue")});
     198                title, tr("Cancel"), tr("Continue"));
    200199        dlg.setContent(content);
    201         dlg.setButtonIcons(new Icon[] {
     200        dlg.setButtonIcons(
    202201                    new ImageProvider("cancel").setMaxSize(ImageSizes.LARGEICON).get(),
    203202                    new ImageProvider("upload").setMaxSize(ImageSizes.LARGEICON).addOverlay(
    204                             new ImageOverlay(new ImageProvider("warning-small"), 0.5, 0.5, 1.0, 1.0)).get()});
    205         dlg.setToolTipTexts(new String[] {
    206                 tr("Cancel"),
    207                 continueToolTip});
     203                            new ImageOverlay(new ImageProvider("warning-small"), 0.5, 0.5, 1.0, 1.0)).get());
     204        dlg.setToolTipTexts(tr("Cancel"), continueToolTip);
    208205        dlg.setIcon(JOptionPane.WARNING_MESSAGE);
    209206        dlg.setCancelButton(1);
     
    227224        p.add(sp, GBC.eol().fill(GBC.BOTH));
    228225
    229         ExtendedDialog ed = new ExtendedDialog(parent, title, new String[] {tr("OK")});
    230         ed.setButtonIcons(new String[] {"ok.png"});
     226        ExtendedDialog ed = new ExtendedDialog(parent, title, tr("OK"));
     227        ed.setButtonIcons("ok");
    231228        ed.setContent(p);
    232229        ed.showDialog();
  • trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java

    r11100 r12279  
    146146        proxyExceptions = new HashSet<>(
    147147            Main.pref.getCollection(ProxyPreferencesPanel.PROXY_EXCEPTIONS,
    148                     Arrays.asList(new String[]{"localhost", IPV4_LOOPBACK, IPV6_LOOPBACK}))
     148                    Arrays.asList("localhost", IPV4_LOOPBACK, IPV6_LOOPBACK))
    149149        );
    150150    }
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r11620 r12279  
    148148        ExtendedDialog ed = new ExtendedDialog(Main.parent,
    149149                tr("Export options"),
    150                 new String[] {tr("Export and Save"), tr("Cancel")});
    151         ed.setButtonIcons(new String[] {"exportgpx", "cancel"});
    152         ed.setContent(p);
    153         ed.showDialog();
    154 
    155         if (ed.getValue() != 1) {
     150                tr("Export and Save"), tr("Cancel"))
     151            .setButtonIcons("exportgpx", "cancel")
     152            .setContent(p);
     153
     154        if (ed.showDialog().getValue() != 1) {
    156155            setCanceled(true);
    157156            return;
  • trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java

    r12259 r12279  
    171171                break;
    172172            case MIRROR:
    173                 if (Arrays.asList(new String[] {
     173                if (Arrays.asList(
    174174                        "type",
    175175                        "url",
    176176                        MIN_ZOOM,
    177177                        MAX_ZOOM,
    178                         TILE_SIZE,
    179                 }).contains(qName)) {
     178                        TILE_SIZE
     179                ).contains(qName)) {
    180180                    newState = State.MIRROR_ATTRIBUTE;
    181181                    lang = atts.getValue("lang");
     
    186186                break;
    187187            case ENTRY:
    188                 if (Arrays.asList(new String[] {
     188                if (Arrays.asList(
    189189                        "name",
    190190                        "id",
     
    207207                        "date",
    208208                        TILE_SIZE,
    209                         "valid-georeference",
    210                 }).contains(qName)) {
     209                        "valid-georeference"
     210                ).contains(qName)) {
    211211                    newState = State.ENTRY_ATTRIBUTE;
    212212                    lang = atts.getValue("lang");
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r11452 r12279  
    140140                false,
    141141                true);
    142         setToolTipTexts(new String[]{tr("Add checked tags to selected objects"), tr("Shift+Enter: Add all tags to selected objects"), ""});
     142        setToolTipTexts(tr("Add checked tags to selected objects"), tr("Shift+Enter: Add all tags to selected objects"), "");
    143143
    144144        this.sender = senderName;
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r11848 r12279  
    567567                            Main.parent,
    568568                            title,
    569                             new String[] {tr("Cancel"), tr("Skip layer and continue")}
    570                             );
    571                     dlg.setButtonIcons(new String[] {"cancel", "dialogs/next"});
    572                     dlg.setIcon(icon);
    573                     dlg.setContent(message);
    574                     dlg.showDialog();
    575                     cancel = dlg.getValue() != 2;
     569                            tr("Cancel"), tr("Skip layer and continue"))
     570                        .setButtonIcons("cancel", "dialogs/next")
     571                        .setIcon(icon)
     572                        .setContent(message);
     573                    cancel = dlg.showDialog().getValue() != 2;
    576574                });
    577575            } catch (InvocationTargetException | InterruptedException ex) {
  • trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java

    r9621 r12279  
    107107                    progressMonitor.getWindowParent(),
    108108                    tr("Skip download"),
    109                     new String[] {
    110                         tr("Download Plugin"),
    111                         tr("Skip Download") }
     109                    tr("Download Plugin"), tr("Skip Download")
    112110            );
    113111            dialog.setContent(tr("JOSM version {0} required for plugin {1}.", pi.mainversion, pi.name));
    114             dialog.setButtonIcons(new String[] {"download", "cancel"});
    115             dialog.showDialog();
    116             int answer = dialog.getValue();
    117             if (answer != 1)
     112            dialog.setButtonIcons("download", "cancel");
     113            if (dialog.showDialog().getValue() != 1)
    118114                throw new PluginDownloadException(tr("Download skipped"));
    119115        }
     
    126122            URL url = new URL(pi.downloadlink);
    127123            synchronized (this) {
    128                 downloadConnection = HttpClient.create(url)
    129                         .setAccept(PLUGIN_MIME_TYPES);
     124                downloadConnection = HttpClient.create(url).setAccept(PLUGIN_MIME_TYPES);
    130125                downloadConnection.connect();
    131126            }
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r12273 r12279  
    8686        String inCore = tr("integrated into main program");
    8787
    88         DEPRECATED_PLUGINS = Arrays.asList(new DeprecatedPlugin[] {
     88        DEPRECATED_PLUGINS = Arrays.asList(
    8989            new DeprecatedPlugin("mappaint", inCore),
    9090            new DeprecatedPlugin("unglueplugin", inCore),
     
    136136            new DeprecatedPlugin("proj4j", inCore),
    137137            new DeprecatedPlugin("OpenStreetView", tr("replaced by new {0} plugin", "OpenStreetCam")),
    138             new DeprecatedPlugin("imageryadjust", inCore),
    139         });
     138            new DeprecatedPlugin("imageryadjust", inCore)
     139        );
    140140    }
    141141
  • trunk/src/org/openstreetmap/josm/tools/PlatformHook.java

    r12223 r12279  
    257257                Main.parent,
    258258                tr("Outdated Java version"),
    259                 new String[]{tr("OK"), tr("Update Java"), tr("Cancel")});
     259                tr("OK"), tr("Update Java"), tr("Cancel"));
    260260        // Check if the dialog has not already been permanently hidden by user
    261261        if (!ed.toggleEnable("askUpdateJava"+updVersion).toggleCheckState()) {
    262             ed.setButtonIcons(new String[]{"ok", "java", "cancel"}).setCancelButton(3);
     262            ed.setButtonIcons("ok", "java", "cancel").setCancelButton(3);
    263263            ed.setMinimumSize(new Dimension(480, 300));
    264264            ed.setIcon(JOptionPane.WARNING_MESSAGE);
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r12268 r12279  
    130130            Class<?> eawtFullScreenUtilities = Class.forName("com.apple.eawt.FullScreenUtilities");
    131131            eawtFullScreenUtilities.getDeclaredMethod("setWindowCanFullScreen",
    132                     new Class[]{Window.class, boolean.class}).invoke(eawtFullScreenUtilities, window, Boolean.TRUE);
     132                    Window.class, boolean.class).invoke(eawtFullScreenUtilities, window, Boolean.TRUE);
    133133        } catch (ReflectiveOperationException | SecurityException | IllegalArgumentException e) {
    134134            Main.warn("Failed to register with OSX: " + e);
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r11553 r12279  
    183183
    184184    private void saveDefault() {
    185         Main.pref.getCollection("shortcut.entry."+shortText, Arrays.asList(new String[]{longText,
    186         String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(requestedKey),
    187         String.valueOf(getGroupModifier(requestedGroup)), String.valueOf(true), String.valueOf(false)}));
     185        Main.pref.getCollection("shortcut.entry."+shortText, Arrays.asList(longText,
     186            String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(requestedKey),
     187            String.valueOf(getGroupModifier(requestedGroup)), String.valueOf(true), String.valueOf(false)));
    188188    }
    189189
     
    193193            return Main.pref.putCollection("shortcut.entry."+shortText, null);
    194194        } else {
    195             return Main.pref.putCollection("shortcut.entry."+shortText, Arrays.asList(new String[]{longText,
    196             String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(assignedKey),
    197             String.valueOf(assignedModifier), String.valueOf(assignedDefault), String.valueOf(assignedUser)}));
     195            return Main.pref.putCollection("shortcut.entry."+shortText, Arrays.asList(longText,
     196                String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(assignedKey),
     197                String.valueOf(assignedModifier), String.valueOf(assignedDefault), String.valueOf(assignedUser)));
    198198        }
    199199    }
  • trunk/src/org/openstreetmap/josm/tools/TextTagParser.java

    r10763 r12279  
    281281                    Main.parent,
    282282                    tr("Do you want to paste these tags?"),
    283                     new String[]{tr("Ok"), tr("Cancel"), tr("Clear buffer"), tr("Ignore warnings")});
    284         ed.setButtonIcons(new String[]{"ok", "cancel", "dialogs/delete", "pastetags"});
     283                    tr("Ok"), tr("Cancel"), tr("Clear buffer"), tr("Ignore warnings"));
     284        ed.setButtonIcons("ok", "cancel", "dialogs/delete", "pastetags");
    285285        ed.setContent("<html><b>"+text + "</b><br/><br/><div width=\"300px\">"+XmlWriter.encode(data, true)+"</html>");
    286286        ed.setDefaultButton(2);
     
    314314                    Main.parent,
    315315                    tr("Warning"),
    316                     new String[]{tr("Ok"), tr("Clear buffer")});
    317 
    318         ed.setButtonIcons(new String[]{"ok", "dialogs/delete"});
    319 
    320         ed.setContent(p);
    321         ed.setDefaultButton(1);
    322         ed.setCancelButton(1);
    323         ed.setIcon(JOptionPane.WARNING_MESSAGE);
    324         ed.toggleEnable("tags.paste.cleanbadbuffer");
     316                    tr("Ok"), tr("Clear buffer"))
     317            .setButtonIcons("ok", "dialogs/delete")
     318            .setContent(p)
     319            .setDefaultButton(1)
     320            .setCancelButton(1)
     321            .setIcon(JOptionPane.WARNING_MESSAGE)
     322            .toggleEnable("tags.paste.cleanbadbuffer");
     323
    325324        ed.showDialog();
    326325
    327         int r = ed.getValue();
    328326        // clean clipboard if user asked
    329         if (r == 2) ClipboardUtils.copyString("");
     327        if (ed.getValue() == 2) ClipboardUtils.copyString("");
    330328    }
    331329}
  • trunk/src/org/openstreetmap/josm/tools/WinRegistry.java

    r12225 r12279  
    137137    private static String readString(Preferences root, int hkey, String key, String value)
    138138            throws IllegalAccessException, InvocationTargetException {
    139         int[] handles = (int[]) regOpenKey.invoke(root,
    140                 new Object[] { Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ) });
     139        int[] handles = (int[]) regOpenKey.invoke(root, Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ));
    141140        if (handles[1] != REG_SUCCESS) {
    142141            return null;
    143142        }
    144         byte[] valb = (byte[]) regQueryValueEx.invoke(root, new Object[] { Integer.valueOf(handles[0]), toCstr(value) });
    145         regCloseKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
     143        byte[] valb = (byte[]) regQueryValueEx.invoke(root, Integer.valueOf(handles[0]), toCstr(value));
     144        regCloseKey.invoke(root, Integer.valueOf(handles[0]));
    146145        return (valb != null ? new String(valb, StandardCharsets.UTF_8).trim() : null);
    147146    }
     
    150149            throws IllegalAccessException, InvocationTargetException {
    151150        HashMap<String, String> results = new HashMap<>();
    152         int[] handles = (int[]) regOpenKey.invoke(root,
    153                 new Object[] { Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ) });
     151        int[] handles = (int[]) regOpenKey.invoke(root, Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ));
    154152        if (handles[1] != REG_SUCCESS) {
    155153            return null;
    156154        }
    157         int[] info = (int[]) regQueryInfoKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
     155        int[] info = (int[]) regQueryInfoKey.invoke(root, Integer.valueOf(handles[0]));
    158156
    159157        int count = info[0]; // count
    160158        int maxlen = info[3]; // value length max
    161159        for (int index = 0; index < count; index++) {
    162             byte[] name = (byte[]) regEnumValue.invoke(root,
    163                     new Object[] { Integer.valueOf(handles[0]), Integer.valueOf(index), Integer.valueOf(maxlen + 1) });
     160            byte[] name = (byte[]) regEnumValue.invoke(root, Integer.valueOf(handles[0]), Integer.valueOf(index), Integer.valueOf(maxlen + 1));
    164161            String value = readString(hkey, key, new String(name, StandardCharsets.UTF_8));
    165162            results.put(new String(name, StandardCharsets.UTF_8).trim(), value);
    166163        }
    167         regCloseKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
     164        regCloseKey.invoke(root, Integer.valueOf(handles[0]));
    168165        return results;
    169166    }
     
    172169            throws IllegalAccessException, InvocationTargetException {
    173170        List<String> results = new ArrayList<>();
    174         int[] handles = (int[]) regOpenKey.invoke(root,
    175                 new Object[] { Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ) });
     171        int[] handles = (int[]) regOpenKey.invoke(root, Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ));
    176172        if (handles[1] != REG_SUCCESS) {
    177173            return Collections.emptyList();
    178174        }
    179         int[] info = (int[]) regQueryInfoKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
     175        int[] info = (int[]) regQueryInfoKey.invoke(root, Integer.valueOf(handles[0]));
    180176
    181177        int count = info[0]; // Fix: info[2] was being used here with wrong results. Suggested by davenpcj, confirmed by Petrucio
    182178        int maxlen = info[3]; // value length max
    183179        for (int index = 0; index < count; index++) {
    184             byte[] name = (byte[]) regEnumKeyEx.invoke(root,
    185                     new Object[] { Integer.valueOf(handles[0]), Integer.valueOf(index), Integer.valueOf(maxlen + 1) });
     180            byte[] name = (byte[]) regEnumKeyEx.invoke(root, Integer.valueOf(handles[0]), Integer.valueOf(index), Integer.valueOf(maxlen + 1));
    186181            results.add(new String(name, StandardCharsets.UTF_8).trim());
    187182        }
    188         regCloseKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
     183        regCloseKey.invoke(root, Integer.valueOf(handles[0]));
    189184        return results;
    190185    }
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r12218 r12279  
    153153                    Method m = entry.getMethod(fieldName);
    154154                    if (m != null) {
    155                         m.invoke(c, new Object[]{getValueForClass(m.getParameterTypes()[0], value)});
     155                        m.invoke(c, getValueForClass(m.getParameterTypes()[0], value));
    156156                    }
    157157                }
  • trunk/src/org/openstreetmap/josm/tools/template_engine/Tokenizer.java

    r9078 r12279  
    4343    public enum TokenType { CONDITION_START, VARIABLE_START, CONTEXT_SWITCH_START, END, PIPE, APOSTROPHE, TEXT, EOF }
    4444
    45     private final Set<Character> specialCharaters = new HashSet<>(Arrays.asList(new Character[] {'$', '?', '{', '}', '|', '\'', '!'}));
     45    private final Set<Character> specialCharaters = new HashSet<>(Arrays.asList('$', '?', '{', '}', '|', '\'', '!'));
    4646
    4747    private final String template;
Note: See TracChangeset for help on using the changeset viewer.