- Timestamp:
- 2017-05-30T15:12:36+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 80 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AboutAction.java
r10713 r12279 110 110 111 111 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") 114 114 .setContent(panel, false) 115 115 .showDialog().getValue(); -
trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java
r11885 r12279 114 114 return targetLayers[0]; 115 115 } 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"); 118 118 ed.setContent(pnl); 119 119 ed.showDialog(); -
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r11657 r12279 49 49 static class SelectWmsLayersDialog extends ExtendedDialog { 50 50 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")); 52 52 final JScrollPane scrollPane = new JScrollPane(tree.getLayerTree()); 53 53 scrollPane.setPreferredSize(new Dimension(400, 400)); -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r11553 r12279 61 61 62 62 protected static boolean confirmChangeDirectionOfWays() { 63 ExtendedDialog ed =new ExtendedDialog(Main.parent,63 return new ExtendedDialog(Main.parent, 64 64 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; 72 72 } 73 73 -
trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java
r10383 r12279 58 58 */ 59 59 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"); 62 62 init(); 63 63 } -
trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
r12093 r12279 217 217 new String[] {tr("OK"), tr("Cancel")}, 218 218 false); 219 setButtonIcons( new String[] {"ok", "cancel"});219 setButtonIcons("ok", "cancel"); 220 220 contentInsets = new Insets(10, 15, 5, 15); 221 221 JPanel pnl = new JPanel(new GridBagLayout()); … … 294 294 Main.parent, 295 295 tr("Overwrite"), 296 new String[] {tr("Overwrite"), tr("Cancel")}296 tr("Overwrite"), tr("Cancel") 297 297 ) { { 298 298 contentInsets = new Insets(10, 15, 10, 15); 299 299 } }; 300 300 dialog.setContent(tr("Offset bookmark already exists. Overwrite?")); 301 dialog.setButtonIcons( new String[] {"ok.png", "cancel.png"});301 dialog.setButtonIcons("ok", "cancel"); 302 302 dialog.setupDialog(); 303 303 dialog.setVisible(true); -
trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java
r10604 r12279 162 162 ExtendedDialog diag = new ExtendedDialog(Main.parent, 163 163 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"); 168 167 169 168 // This repeatedly shows the dialog in case there has been an error. -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r11986 r12279 65 65 WhichTasksToPerformDialog(JList<DownloadTask> list) { 66 66 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"); 68 68 final JPanel pane = new JPanel(new GridLayout(2, 1)); 69 69 pane.add(new JLabel(tr("Which tasks to perform?"))); … … 138 138 ExtendedDialog dialog = new ExtendedDialog(Main.parent, 139 139 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( 145 144 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) { 151 148 USE_NEW_LAYER.put(layer.isSelected()); 152 149 remindUploadAddressHistory(uploadAddresses); -
trunk/src/org/openstreetmap/josm/actions/SaveAction.java
r8510 r12279 47 47 Main.parent, 48 48 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) { 56 53 f = null; 57 54 } -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r10407 r12279 207 207 public static boolean confirmOverwrite(File file) { 208 208 if (file == null || file.exists()) { 209 ExtendedDialog dialog =new ExtendedDialog(209 return new ExtendedDialog( 210 210 Main.parent, 211 211 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; 218 217 } 219 218 return true; -
trunk/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java
r11889 r12279 53 53 contentPanel.add(searchTermBox, gc); 54 54 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) { 61 59 return; 62 60 } … … 64 62 String searchTerm = Optional.ofNullable(searchTermBox.getText()).orElse("").trim(); 65 63 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(); 69 67 return; 70 68 } -
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r11848 r12279 118 118 fc = createAndOpenFileChooser(false, false, tr("Save session"), joz, JFileChooser.FILES_ONLY, "lastDirectory"); 119 119 } 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, 121 121 JFileChooser.FILES_ONLY, "lastDirectory"); 122 122 } … … 188 188 */ 189 189 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")); 191 191 initialize(); 192 setButtonIcons( new String[] {"save_as", "cancel"});192 setButtonIcons("save_as", "cancel"); 193 193 setDefaultButton(1); 194 194 setRememberWindowGeometry(getClass().getName() + ".geometry", -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r12217 r12279 291 291 ExtendedDialog ed = new ExtendedDialog(Main.parent, 292 292 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"); 295 295 ed.setContent(ta, false); 296 296 ed.setMinimumSize(new Dimension(380, 200)); -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r12031 r12279 243 243 configureList(); 244 244 245 setButtonIcons( new String[]{"ok", "cancel"});245 setButtonIcons("ok", "cancel"); 246 246 final JPanel pane = new JPanel(new GridBagLayout()); 247 247 pane.add(new JLabel(getTitle()), GBC.eol().fill(GBC.HORIZONTAL)); -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r12031 r12279 206 206 207 207 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"); 210 210 211 211 final JPanel content = new JPanel(new GridBagLayout()); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r12065 r12279 869 869 super(Main.parent, 870 870 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"); 873 873 setCancelButton(2); 874 874 } -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r11986 r12279 340 340 Main.parent, 341 341 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") 345 344 ) { 346 345 @Override … … 368 367 } 369 368 }; 370 dialog.setButtonIcons( new String[] {"dialogs/search", "cancel"});369 dialog.setButtonIcons("dialogs/search", "cancel"); 371 370 dialog.configureContextsensitiveHelp("/Action/Search", true /* show help button */); 372 371 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; 377 374 378 375 // User pressed OK - let's perform the search -
trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java
r9543 r12279 80 80 Main.parent, 81 81 tr("Cycling dependencies"), 82 new String[] {tr("OK")}82 tr("OK") 83 83 ); 84 84 dialog.setContent(pnl, false /* don't embed in scroll pane */); 85 dialog.setButtonIcons( new String[] {"ok"});85 dialog.setButtonIcons("ok"); 86 86 dialog.setRememberWindowGeometry( 87 87 getClass().getName() + ".geometry", -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r12212 r12279 141 141 ExtendedDialog ed = new ExtendedDialog(Main.parent, 142 142 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); 147 146 148 if (ed. getValue() != 1) {147 if (ed.showDialog().getValue() != 1) { 149 148 OsmValidator.initializeTests(); 150 149 OsmValidator.initializeErrorLayer(); -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayNoTagCorrector.java
r11848 r12279 36 36 * Tags that imply a semantic meaning from the way direction and cannot be changed. 37 37 */ 38 private static final TagCollection directionalTags = new TagCollection(Arrays.asList( new Tag[]{38 private static final TagCollection directionalTags = new TagCollection(Arrays.asList( 39 39 new Tag("natural", "coastline"), 40 40 new Tag("natural", "cliff"), … … 42 42 new Tag("barrier", "kerb"), 43 43 new Tag("barrier", "retaining_wall"), 44 new Tag("man_made", "embankment") ,45 }));44 new Tag("man_made", "embankment") 45 )); 46 46 47 47 /** -
trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java
r10469 r12279 30 30 private static final String ERROR_MESSAGE = "errorMessage"; 31 31 // 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( 33 33 NO_TILE_AT_ZOOM, 34 34 ETAG, … … 37 37 HTTP_RESPONSE_CODE, 38 38 ERROR_MESSAGE 39 })); 40 39 )); 41 40 42 41 /** -
trunk/src/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelper.java
r12232 r12279 177 177 if (event == XMLStreamReader.START_ELEMENT && QN_OWS_CONSTRAINT.equals(reader.getName()) 178 178 && "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); 183 180 return TransferMode.fromString(reader.getElementText()); 184 181 } -
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r12224 r12279 194 194 195 195 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")); 197 197 this.layers = groupLayersByNameAndTileMatrixSet(layers); 198 198 //getLayersTable(layers, Main.getProjection()) … … 464 464 } else if (QN_STYLE.equals(reader.getName()) && 465 465 "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)) { 467 467 layer.style = reader.getElementText(); 468 468 tagStack.push(reader.getName()); // keep tagStack in sync … … 636 636 GetCapabilitiesParseHelper.QN_OWS_OPERATION.equals(reader.getName()) && 637 637 "GetTile".equals(reader.getAttributeValue("", "name")) && 638 GetCapabilitiesParseHelper.moveReaderToTag(reader, new QName[] {638 GetCapabilitiesParseHelper.moveReaderToTag(reader, 639 639 GetCapabilitiesParseHelper.QN_OWS_DCP, 640 640 GetCapabilitiesParseHelper.QN_OWS_HTTP, 641 GetCapabilitiesParseHelper.QN_OWS_GET ,642 })) {641 GetCapabilitiesParseHelper.QN_OWS_GET 642 )) { 643 643 this.baseUrl = reader.getAttributeValue(GetCapabilitiesParseHelper.XLINK_NS_URL, "href"); 644 644 this.transferMode = GetCapabilitiesParseHelper.getTransferMode(reader); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
r12218 r12279 303 303 public AbstractMapRenderer createActiveRenderer(Graphics2D g, NavigatableComponent viewport, boolean isInactiveMode) { 304 304 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); 306 306 return AbstractMapRenderer.class.cast(c.newInstance(g, viewport, isInactiveMode)); 307 307 } catch (InvocationTargetException e) { -
trunk/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java
r12013 r12279 52 52 double y = dy + xyz[1]*(1+s) + xyz[0]*rz - xyz[2]*rx; 53 53 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); 55 55 } 56 56 … … 61 61 double y = (1-s)*(-dy + xyz[1] + ((-dx+xyz[0])*(-rz) - (-dz+xyz[2])*(-rx))); 62 62 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); 64 64 } 65 65 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r12187 r12279 265 265 // TODO directionKeys are no longer in OsmPrimitive (search pattern is used instead) 266 266 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"))) { 268 268 additionalPresetsValueData.putVoid(a); 269 269 } -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12273 r12279 545 545 Main.parent, 546 546 tr("Unsaved osm data"), 547 new String[] {tr("Restore"), tr("Cancel"), tr("Discard")}547 tr("Restore"), tr("Cancel"), tr("Discard") 548 548 ); 549 549 dialog.setContent( … … 551 551 "JOSM found {0} unsaved osm data layers. ", unsavedLayerFiles.size(), unsavedLayerFiles.size()) + 552 552 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"); 554 554 int selection = dialog.showDialog().getValue(); 555 555 if (selection == 1) { … … 567 567 ExtendedDialog ed = new ExtendedDialog( 568 568 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); 571 571 ed.setMinimumSize(new Dimension(460, 260)); 572 572 ed.setIcon(JOptionPane.WARNING_MESSAGE); -
trunk/src/org/openstreetmap/josm/gui/NoteInputDialog.java
r9078 r12279 32 32 */ 33 33 public NoteInputDialog(Component parent, String title, String buttonText) { 34 super(parent, title, new String[] {buttonText, tr("Cancel")});34 super(parent, title, buttonText, tr("Cancel")); 35 35 } 36 36 … … 56 56 contentPanel.add(scrollPane); 57 57 setContent(contentPanel, false); 58 setButtonIcons( new Icon[] {icon, ImageProvider.get("cancel.png")});58 setButtonIcons(icon, ImageProvider.get("cancel.png")); 59 59 60 60 showDialog(); … … 67 67 return textArea.getText(); 68 68 } 69 70 69 } -
trunk/src/org/openstreetmap/josm/gui/NoteSortDialog.java
r11821 r12279 33 33 */ 34 34 public NoteSortDialog(Component parent, String title, String buttonText) { 35 super(parent, title, new String[] {buttonText, tr("Cancel")});35 super(parent, title, buttonText, tr("Cancel")); 36 36 } 37 37 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java
r11879 r12279 17 17 * compare my version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with their version 18 18 */ 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), 20 20 21 21 /** 22 22 * compare my version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with the merged version 23 23 */ 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), 25 25 26 26 /** 27 27 * compare their version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with the merged veresion 28 28 */ 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); 30 30 31 31 /** the localized display name */ -
trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveDataPaster.java
r11746 r12279 136 136 private static boolean confirmDeleteIncomplete() { 137 137 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"); 140 140 ed.setContent(tr( 141 141 "The copied data contains incomplete objects. " + "When pasting the incomplete objects are removed. " -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r11747 r12279 211 211 lstInActiveDataLayer.addMouseListener(popupMenuLauncher); 212 212 213 createLayout(pnl, false, Arrays.asList( new SideButton[] {213 createLayout(pnl, false, Arrays.asList( 214 214 new SideButton(selectObjectsAction, false), 215 215 new SideButton(readChangesetAction, false), … … 217 217 new SideButton(showChangesetInfoAction, false), 218 218 new SideButton(new LaunchChangesetManagerAction(), false) 219 }));219 )); 220 220 } 221 221 -
trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
r10788 r12279 127 127 wireUpdateEnabledStateUpdater(redoAction, redoTree); 128 128 129 scrollPane = (JScrollPane) createLayout(treesPanel, true, Arrays.asList( new SideButton[] {129 scrollPane = (JScrollPane) createLayout(treesPanel, true, Arrays.asList( 130 130 new SideButton(selectAction), 131 131 new SideButton(undoAction), 132 132 new SideButton(redoAction) 133 }));133 )); 134 134 135 135 InputMapUtils.addEnterAction(undoTree, selectAndZoomAction); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r12178 r12279 135 135 addListSelectionListener(actSelect); 136 136 137 createLayout(lstConflicts, true, Arrays.asList(new SideButton[] { 138 btnResolve, btnSelect 139 })); 137 createLayout(lstConflicts, true, Arrays.asList(btnResolve, btnSelect)); 140 138 141 139 popupMenuHandler.addAction(Main.main.menu.autoScaleActions.get("conflict")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
r12046 r12279 45 45 public ConflictResolutionDialog(Component parent) { 46 46 // We define our own actions, but need to give a hint about number of buttons 47 super(parent, tr("Resolve conflicts"), n ew String[] {null, null, null});47 super(parent, tr("Resolve conflicts"), null, null, null); 48 48 setDefaultButton(1); 49 49 setCancelButton(2); -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
r11993 r12279 239 239 }); 240 240 241 createLayout(userTable, true, Arrays.asList( new SideButton[] {241 createLayout(userTable, true, Arrays.asList( 242 242 addButton, editButton, deleteButton, upButton, downButton 243 }));243 )); 244 244 } 245 245 -
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
r11452 r12279 62 62 */ 63 63 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")); 65 65 this.primitives = new ArrayList<>(primitives); 66 66 this.layer = layer; … … 68 68 WindowGeometry.centerInWindow(Main.parent, new Dimension(750, 550))); 69 69 70 setButtonIcons( new String[]{"ok.png"});70 setButtonIcons("ok"); 71 71 final JTabbedPane tabs = new JTabbedPane(); 72 72 -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r11653 r12279 156 156 157 157 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"); 160 160 configureContextsensitiveHelp(help, true); 161 161 -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java
r10793 r12279 51 51 ExtendedDialog ed = new ExtendedDialog( 52 52 Main.parent, tr("Information about layer"), 53 new String[] {tr("OK")});54 ed.setButtonIcons( new String[] {"ok"});53 tr("OK")); 54 ed.setButtonIcons("ok"); 55 55 ed.setIcon(JOptionPane.INFORMATION_MESSAGE); 56 56 ed.setContent((Component) object); -
trunk/src/org/openstreetmap/josm/gui/dialogs/LogShowDialog.java
r8510 r12279 30 30 */ 31 31 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"); 34 34 setContent(build(msg, log)); 35 35 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r11881 r12279 535 535 return; 536 536 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")); 538 538 info.setPreferredSize(new Dimension(600, 400)); 539 info.setButtonIcons( new String[] {"ok.png"});539 info.setButtonIcons("ok"); 540 540 541 541 final JTabbedPane tabs = new JTabbedPane(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java
r11496 r12279 27 27 28 28 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")); 30 30 this.selector = new Selector(menu); 31 31 this.selector.setDblClickListener(e -> buttonAction(0, null)); -
trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
r11713 r12279 107 107 pane.add(new JScrollPane(displayList), BorderLayout.CENTER); 108 108 109 createLayout(pane, false, Arrays.asList( new SideButton[]{109 createLayout(pane, false, Arrays.asList( 110 110 new SideButton(downloadNotesInViewAction, false), 111 111 new SideButton(newAction, false), … … 115 115 new SideButton(sortAction, false), 116 116 new SideButton(openInBrowserAction, false), 117 new SideButton(uploadAction, false) }));117 new SideButton(uploadAction, false))); 118 118 updateButtonStates(); 119 119 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r11610 r12279 163 163 recentRelationsAction = new RecentRelationsAction(editButton); 164 164 165 createLayout(pane, false, Arrays.asList( new SideButton[]{165 createLayout(pane, false, Arrays.asList( 166 166 new SideButton(newAction, false), 167 167 editButton, … … 169 169 new SideButton(deleteRelationsAction, false), 170 170 new SideButton(selectRelationAction, false) 171 }));171 )); 172 172 173 173 InputMapUtils.unassignCtrlShiftUpDown(displaylist, JComponent.WHEN_FOCUSED); -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r11680 r12279 132 132 searchButton.createArrow(e -> SearchPopupMenu.launch(searchButton)); 133 133 134 createLayout(lstPrimitives, true, Arrays.asList( new SideButton[] {134 createLayout(lstPrimitives, true, Arrays.asList( 135 135 selectButton, searchButton, new SideButton(actShowHistory) 136 }));136 )); 137 137 } 138 138 -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r12101 r12279 97 97 userTable.getSelectionModel().addListSelectionListener(showUserInfoAction); 98 98 99 createLayout(userTable, true, Arrays.asList( new SideButton[] {99 createLayout(userTable, true, Arrays.asList( 100 100 new SideButton(selectionUsersPrimitivesAction), 101 101 new SideButton(showUserInfoAction) 102 }));102 )); 103 103 } 104 104 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r11764 r12279 1014 1014 ExtendedDialog ed = new ExtendedDialog(Main.parent, 1015 1015 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"); 1018 1018 ed.setContent(tr("Really delete selection from relation {0}?", cur.getDisplayName(DefaultNameFormatter.getInstance()))); 1019 1019 ed.toggleEnable(DELETE_FROM_RELATION_PREF); 1020 ed.showDialog(); 1021 1022 if (ed.getValue() != 1) 1020 1021 if (ed.showDialog().getValue() != 1) 1023 1022 return; 1024 1023 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r11945 r12279 376 376 */ 377 377 private static boolean warnOverwriteKey(String action, String togglePref) { 378 ExtendedDialog ed =new ExtendedDialog(378 return new ExtendedDialog( 379 379 Main.parent, 380 380 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; 389 387 } 390 388 … … 416 414 417 415 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"); 420 418 setCancelButton(2); 421 419 configureContextsensitiveHelp("/Dialog/EditValue", true /* show help button */); … … 679 677 680 678 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"); 683 681 setCancelButton(2); 684 682 configureContextsensitiveHelp("/Dialog/AddValue", true /* show help button */); -
trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java
r10611 r12279 40 40 */ 41 41 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")); 43 43 init(); 44 setButtonIcons( new String[]{"download", "cancel"});45 setToolTipTexts( new String[]{44 setButtonIcons("download", "cancel"); 45 setToolTipTexts( 46 46 tr("Start downloading"), 47 47 tr("Close dialog and cancel downloading") 48 });48 ); 49 49 configureContextsensitiveHelp("/Action/DownloadObject", true /* show help button */); 50 50 } -
trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java
r10621 r12279 218 218 Main.parent, 219 219 title, 220 new String[] {tr("Ok")})221 .setButtonIcons( new String[] {"ok"})220 tr("Ok")) 221 .setButtonIcons("ok") 222 222 .setIcon(msgType) 223 223 .setContent(p, false); -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r12170 r12279 429 429 Tile clickedTile = clickedTileHolder.getTile(); 430 430 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")); 432 432 JPanel panel = new JPanel(new GridBagLayout()); 433 433 Rectangle2D displaySize = coordinateConverter.getRectangleForTile(clickedTile); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r12176 r12279 659 659 @Override public Action[] getMenuEntries() { 660 660 List<Action> actions = new ArrayList<>(); 661 actions.addAll(Arrays.asList( new Action[]{661 actions.addAll(Arrays.asList( 662 662 LayerListDialog.getInstance().createActivateLayerAction(this), 663 663 LayerListDialog.getInstance().createShowHideLayerAction(), … … 667 667 LayerListDialog.getInstance().createDuplicateLayerAction(this), 668 668 new LayerSaveAction(this), 669 new LayerSaveAsAction(this), 670 })); 669 new LayerSaveAsAction(this))); 671 670 if (ExpertToggleAction.isExpert()) { 672 actions.addAll(Arrays.asList( new Action[]{671 actions.addAll(Arrays.asList( 673 672 new LayerGpxExportAction(this), 674 new ConvertToGpxLayerAction() }));675 } 676 actions.addAll(Arrays.asList( new Action[]{673 new ConvertToGpxLayerAction())); 674 } 675 actions.addAll(Arrays.asList( 677 676 SeparatorLayerAction.INSTANCE, 678 new RenameLayerAction(getAssociatedFile(), this) }));677 new RenameLayerAction(getAssociatedFile(), this))); 679 678 if (ExpertToggleAction.isExpert()) { 680 679 actions.add(new ToggleUploadDiscouragedLayerAction(this)); 681 680 } 682 actions.addAll(Arrays.asList( new Action[]{681 actions.addAll(Arrays.asList( 683 682 new ConsistencyTestAction(), 684 683 SeparatorLayerAction.INSTANCE, 685 new LayerListPopup.InfoAction(this) }));684 new LayerListPopup.InfoAction(this))); 686 685 return actions.toArray(new Action[actions.size()]); 687 686 } … … 1054 1053 return 2; 1055 1054 } 1056 ExtendedDialog dialog =new ExtendedDialog(1055 return new ExtendedDialog( 1057 1056 Main.parent, 1058 1057 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(); 1064 1062 })) { 1065 1063 return false; … … 1068 1066 ConflictCollection conflictsCol = getConflicts(); 1069 1067 return conflictsCol == null || conflictsCol.isEmpty() || 1 == GuiHelper.runInEDTAndWaitAndReturn(() -> { 1070 ExtendedDialog dialog =new ExtendedDialog(1068 return new ExtendedDialog( 1071 1069 Main.parent, 1072 1070 /* I18N: Display title of the window showing conflicts */ 1073 1071 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(); 1080 1077 }); 1081 1078 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r11914 r12279 142 142 Main.parent, 143 143 tr("Correlate images with GPX track"), 144 new String[] {tr("OK"), tr("Try Again")}).144 tr("OK"), tr("Try Again")). 145 145 setContent(tr("No images could be matched!")). 146 setButtonIcons( new String[] {"ok", "dialogs/refresh"}).146 setButtonIcons("ok", "dialogs/refresh"). 147 147 showDialog().getValue() == 2) 148 148 return AGAIN; … … 732 732 ); 733 733 syncDialog.setContent(panelTf, false); 734 syncDialog.setButtonIcons( new String[] {"ok", "cancel"});734 syncDialog.setButtonIcons("ok", "cancel"); 735 735 syncDialog.setupDialog(); 736 736 outerPanel.add(syncDialog.getContentPane(), BorderLayout.PAGE_START); … … 955 955 new ExtendedDialog(Main.parent, 956 956 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(); 959 959 } 960 960 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r12131 r12279 719 719 Main.parent, 720 720 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") 723 723 .setContent(new JLabel(tr("<html><h3>Delete the file {0} from disk?<p>The image file will be permanently lost!</h3></html>", 724 724 toDelete.getFile().getName()), ImageProvider.get("dialogs/geoimage/deletefromdisk"), SwingConstants.LEFT)) -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java
r12173 r12279 265 265 // build dialog 266 266 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"); 269 269 ed.setContent(msg, false); 270 270 ed.setDefaultButton(2); -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r11848 r12279 44 44 import javax.swing.DefaultListModel; 45 45 import javax.swing.DefaultListSelectionModel; 46 import javax.swing.Icon;47 46 import javax.swing.ImageIcon; 48 47 import javax.swing.JButton; … … 916 915 */ 917 916 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")); 919 918 920 919 JPanel p = new JPanel(new GridBagLayout()); … … 942 941 p.add(cbActive, GBC.eol().insets(15, 0, 5, 0)); 943 942 } 944 setButtonIcons( new String[] {"ok", "cancel"});943 setButtonIcons("ok", "cancel"); 945 944 setContent(p); 946 945 … … 1191 1190 } 1192 1191 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( 1195 1194 ImageProvider.get("cancel"), 1196 1195 new ImageProvider("ok").setMaxSize(ImageSizes.LARGEICON).addOverlay( 1197 1196 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( 1200 1199 tr("Cancel and return to the previous dialog"), 1201 tr("Ignore warning and install style anyway") });1200 tr("Ignore warning and install style anyway")); 1202 1201 dlg.setContent("<html>" + tr("Some entries have unmet dependencies:") + 1203 1202 "<br>" + Utils.join("<br>", messages) + "</html>"); -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractListEditor.java
r9665 r12279 29 29 */ 30 30 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")); 32 32 this.entry = entry; 33 setButtonIcons( new String[] {"ok.png", "cancel.png"});33 setButtonIcons("ok.png", "cancel.png"); 34 34 setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(parent, new Dimension(500, 350))); 35 35 } -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java
r10853 r12279 220 220 221 221 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; 224 224 } 225 225 -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java
r9759 r12279 30 30 */ 31 31 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")); 33 33 this.entry = entry; 34 setButtonIcons( new String[] {"ok.png", "cancel.png"});34 setButtonIcons("ok", "cancel"); 35 35 setContent(build(setting.getValue() == null ? "" : setting.getValue())); 36 36 } -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryDialog.java
r9665 r12279 22 22 */ 23 23 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"); 26 26 setCancelButton(2); 27 27 configureContextsensitiveHelp("/Dialog/AddImagery", true /* show help button */); -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r11746 r12279 266 266 defPL2.description = tr("the main Potlatch 2 style"); 267 267 268 return Arrays.asList( new ExtendedSourceEntry[] {defJosmMapcss, defPL2});268 return Arrays.asList(defJosmMapcss, defPL2); 269 269 } 270 270 -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r11848 r12279 60 60 Main.warn(e, tr("Could not read tagging preset source: {0}", source)); 61 61 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Error"), 62 new String[] {tr("Yes"), tr("No"), tr("Cancel")});62 tr("Yes"), tr("No"), tr("Cancel")); 63 63 ed.setContent(tr("Could not read tagging preset source: {0}\nDo you want to keep it?", source)); 64 64 switch (ed.showDialog().getValue()) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r12142 r12279 435 435 contentInsets = new Insets(10, 5, 0, 5); 436 436 if (showNewRelation) { 437 setButtonIcons( new String[] {"ok", "dialogs/addrelation", "cancel" });437 setButtonIcons("ok", "dialogs/addrelation", "cancel"); 438 438 } else { 439 setButtonIcons( new String[] {"ok", "cancel" });439 setButtonIcons("ok", "cancel"); 440 440 } 441 441 setContent(content); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchDialog.java
r10590 r12279 32 32 33 33 private TaggingPresetSearchDialog() { 34 super(Main.parent, tr("Presets"), new String[] {tr("Select"), tr("Cancel")});34 super(Main.parent, tr("Presets"), tr("Select"), tr("Cancel")); 35 35 selector = new TaggingPresetSelector(true, true); 36 36 setContent(selector, false); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java
r10590 r12279 66 66 67 67 TaggingPresetSearchPrimitiveDialog() { 68 super(Main.parent, tr("Presets"), new String[] {tr("Search"), tr("Cancel")});68 super(Main.parent, tr("Presets"), tr("Search"), tr("Cancel")); 69 69 selector = new TaggingPresetSelector(false, false); 70 70 setContent(selector, false); … … 86 86 TaggingPreset preset = selector.getSelectedPresetAndUpdateClassification(); 87 87 if (preset != null) { 88 89 88 final Set<OsmPrimitive> matching = new HashSet<>(Main.getLayerManager().getEditDataSet().getPrimitives(preset)); 90 89 Main.getLayerManager().getEditDataSet().setSelected(matching); -
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r11746 r12279 33 33 34 34 import javax.swing.GrayFilter; 35 import javax.swing.Icon;36 35 import javax.swing.ImageIcon; 37 36 import javax.swing.JComponent; … … 197 196 public static boolean warnUser(String title, String content, ImageIcon baseActionIcon, String continueToolTip) { 198 197 ExtendedDialog dlg = new ExtendedDialog(Main.parent, 199 title, new String[] {tr("Cancel"), tr("Continue")});198 title, tr("Cancel"), tr("Continue")); 200 199 dlg.setContent(content); 201 dlg.setButtonIcons( new Icon[] {200 dlg.setButtonIcons( 202 201 new ImageProvider("cancel").setMaxSize(ImageSizes.LARGEICON).get(), 203 202 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); 208 205 dlg.setIcon(JOptionPane.WARNING_MESSAGE); 209 206 dlg.setCancelButton(1); … … 227 224 p.add(sp, GBC.eol().fill(GBC.BOTH)); 228 225 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"); 231 228 ed.setContent(p); 232 229 ed.showDialog(); -
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r11100 r12279 146 146 proxyExceptions = new HashSet<>( 147 147 Main.pref.getCollection(ProxyPreferencesPanel.PROXY_EXCEPTIONS, 148 Arrays.asList( new String[]{"localhost", IPV4_LOOPBACK, IPV6_LOOPBACK}))148 Arrays.asList("localhost", IPV4_LOOPBACK, IPV6_LOOPBACK)) 149 149 ); 150 150 } -
trunk/src/org/openstreetmap/josm/io/GpxExporter.java
r11620 r12279 148 148 ExtendedDialog ed = new ExtendedDialog(Main.parent, 149 149 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) { 156 155 setCanceled(true); 157 156 return; -
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r12259 r12279 171 171 break; 172 172 case MIRROR: 173 if (Arrays.asList( new String[] {173 if (Arrays.asList( 174 174 "type", 175 175 "url", 176 176 MIN_ZOOM, 177 177 MAX_ZOOM, 178 TILE_SIZE ,179 }).contains(qName)) {178 TILE_SIZE 179 ).contains(qName)) { 180 180 newState = State.MIRROR_ATTRIBUTE; 181 181 lang = atts.getValue("lang"); … … 186 186 break; 187 187 case ENTRY: 188 if (Arrays.asList( new String[] {188 if (Arrays.asList( 189 189 "name", 190 190 "id", … … 207 207 "date", 208 208 TILE_SIZE, 209 "valid-georeference" ,210 }).contains(qName)) {209 "valid-georeference" 210 ).contains(qName)) { 211 211 newState = State.ENTRY_ATTRIBUTE; 212 212 lang = atts.getValue("lang"); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
r11452 r12279 140 140 false, 141 141 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"), ""); 143 143 144 144 this.sender = senderName; -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r11848 r12279 567 567 Main.parent, 568 568 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; 576 574 }); 577 575 } catch (InvocationTargetException | InterruptedException ex) { -
trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
r9621 r12279 107 107 progressMonitor.getWindowParent(), 108 108 tr("Skip download"), 109 new String[] { 110 tr("Download Plugin"), 111 tr("Skip Download") } 109 tr("Download Plugin"), tr("Skip Download") 112 110 ); 113 111 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) 118 114 throw new PluginDownloadException(tr("Download skipped")); 119 115 } … … 126 122 URL url = new URL(pi.downloadlink); 127 123 synchronized (this) { 128 downloadConnection = HttpClient.create(url) 129 .setAccept(PLUGIN_MIME_TYPES); 124 downloadConnection = HttpClient.create(url).setAccept(PLUGIN_MIME_TYPES); 130 125 downloadConnection.connect(); 131 126 } -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r12273 r12279 86 86 String inCore = tr("integrated into main program"); 87 87 88 DEPRECATED_PLUGINS = Arrays.asList( new DeprecatedPlugin[] {88 DEPRECATED_PLUGINS = Arrays.asList( 89 89 new DeprecatedPlugin("mappaint", inCore), 90 90 new DeprecatedPlugin("unglueplugin", inCore), … … 136 136 new DeprecatedPlugin("proj4j", inCore), 137 137 new DeprecatedPlugin("OpenStreetView", tr("replaced by new {0} plugin", "OpenStreetCam")), 138 new DeprecatedPlugin("imageryadjust", inCore) ,139 });138 new DeprecatedPlugin("imageryadjust", inCore) 139 ); 140 140 } 141 141 -
trunk/src/org/openstreetmap/josm/tools/PlatformHook.java
r12223 r12279 257 257 Main.parent, 258 258 tr("Outdated Java version"), 259 new String[]{tr("OK"), tr("Update Java"), tr("Cancel")});259 tr("OK"), tr("Update Java"), tr("Cancel")); 260 260 // Check if the dialog has not already been permanently hidden by user 261 261 if (!ed.toggleEnable("askUpdateJava"+updVersion).toggleCheckState()) { 262 ed.setButtonIcons( new String[]{"ok", "java", "cancel"}).setCancelButton(3);262 ed.setButtonIcons("ok", "java", "cancel").setCancelButton(3); 263 263 ed.setMinimumSize(new Dimension(480, 300)); 264 264 ed.setIcon(JOptionPane.WARNING_MESSAGE); -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r12268 r12279 130 130 Class<?> eawtFullScreenUtilities = Class.forName("com.apple.eawt.FullScreenUtilities"); 131 131 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); 133 133 } catch (ReflectiveOperationException | SecurityException | IllegalArgumentException e) { 134 134 Main.warn("Failed to register with OSX: " + e); -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r11553 r12279 183 183 184 184 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))); 188 188 } 189 189 … … 193 193 return Main.pref.putCollection("shortcut.entry."+shortText, null); 194 194 } 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))); 198 198 } 199 199 } -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r10763 r12279 281 281 Main.parent, 282 282 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"); 285 285 ed.setContent("<html><b>"+text + "</b><br/><br/><div width=\"300px\">"+XmlWriter.encode(data, true)+"</html>"); 286 286 ed.setDefaultButton(2); … … 314 314 Main.parent, 315 315 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 325 324 ed.showDialog(); 326 325 327 int r = ed.getValue();328 326 // clean clipboard if user asked 329 if ( r== 2) ClipboardUtils.copyString("");327 if (ed.getValue() == 2) ClipboardUtils.copyString(""); 330 328 } 331 329 } -
trunk/src/org/openstreetmap/josm/tools/WinRegistry.java
r12225 r12279 137 137 private static String readString(Preferences root, int hkey, String key, String value) 138 138 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)); 141 140 if (handles[1] != REG_SUCCESS) { 142 141 return null; 143 142 } 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])); 146 145 return (valb != null ? new String(valb, StandardCharsets.UTF_8).trim() : null); 147 146 } … … 150 149 throws IllegalAccessException, InvocationTargetException { 151 150 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)); 154 152 if (handles[1] != REG_SUCCESS) { 155 153 return null; 156 154 } 157 int[] info = (int[]) regQueryInfoKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });155 int[] info = (int[]) regQueryInfoKey.invoke(root, Integer.valueOf(handles[0])); 158 156 159 157 int count = info[0]; // count 160 158 int maxlen = info[3]; // value length max 161 159 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)); 164 161 String value = readString(hkey, key, new String(name, StandardCharsets.UTF_8)); 165 162 results.put(new String(name, StandardCharsets.UTF_8).trim(), value); 166 163 } 167 regCloseKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });164 regCloseKey.invoke(root, Integer.valueOf(handles[0])); 168 165 return results; 169 166 } … … 172 169 throws IllegalAccessException, InvocationTargetException { 173 170 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)); 176 172 if (handles[1] != REG_SUCCESS) { 177 173 return Collections.emptyList(); 178 174 } 179 int[] info = (int[]) regQueryInfoKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });175 int[] info = (int[]) regQueryInfoKey.invoke(root, Integer.valueOf(handles[0])); 180 176 181 177 int count = info[0]; // Fix: info[2] was being used here with wrong results. Suggested by davenpcj, confirmed by Petrucio 182 178 int maxlen = info[3]; // value length max 183 179 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)); 186 181 results.add(new String(name, StandardCharsets.UTF_8).trim()); 187 182 } 188 regCloseKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });183 regCloseKey.invoke(root, Integer.valueOf(handles[0])); 189 184 return results; 190 185 } -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r12218 r12279 153 153 Method m = entry.getMethod(fieldName); 154 154 if (m != null) { 155 m.invoke(c, new Object[]{getValueForClass(m.getParameterTypes()[0], value)});155 m.invoke(c, getValueForClass(m.getParameterTypes()[0], value)); 156 156 } 157 157 } -
trunk/src/org/openstreetmap/josm/tools/template_engine/Tokenizer.java
r9078 r12279 43 43 public enum TokenType { CONDITION_START, VARIABLE_START, CONTEXT_SWITCH_START, END, PIPE, APOSTROPHE, TEXT, EOF } 44 44 45 private final Set<Character> specialCharaters = new HashSet<>(Arrays.asList( new Character[] {'$', '?', '{', '}', '|', '\'', '!'}));45 private final Set<Character> specialCharaters = new HashSet<>(Arrays.asList('$', '?', '{', '}', '|', '\'', '!')); 46 46 47 47 private final String template;
Note:
See TracChangeset
for help on using the changeset viewer.