- Timestamp:
- 2024-06-19T00:35:04+02:00 (8 months ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r19106 r19115 548 548 enum Direction { 549 549 RIGHT, UP, LEFT, DOWN; 550 /** 551 * Change a direction by the specified number of 90 degree increments counter-clockwise 552 * @param directionChange The number of increments to rotate counter-clockwise 553 * @return The new direction 554 */ 555 @SuppressWarnings("EnumOrdinal") // Yes, this is very dependent on order 550 556 public Direction changeBy(int directionChange) { 551 557 int tmp = (this.ordinal() + directionChange) % 4; -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r19085 r19115 2 2 package org.openstreetmap.josm.gui.dialogs.properties; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import static org.openstreetmap.josm.tools.I18n.trn; … … 124 125 (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getValue(), o2.getValue()); 125 126 127 private static final String CANCEL_TR = marktr("Cancel"); 128 private static final String CANCEL = "cancel"; 129 private static final String HTML = "<html>"; 130 private static final String DUMMY = "dummy"; 126 131 /** Default number of recent tags */ 127 132 public static final int DEFAULT_LRU_TAGS_NUMBER = 5; … … 362 367 private Collection<OsmPrimitive> updateSelection() { 363 368 final DataSet activeDataSet = OsmDataManager.getInstance().getActiveDataSet(); 369 activeDataSet.getReadLock().lock(); 364 370 try { 365 activeDataSet.getReadLock().lock();366 371 Collection<OsmPrimitive> selection = new ArrayList<>(OsmDataManager.getInstance().getInProgressSelection()); 367 372 this.sel = selection; … … 490 495 MainApplication.getMainFrame(), 491 496 tr("Overwrite tag"), 492 tr("Overwrite"), tr( "Cancel"))493 .setButtonIcons("ok", "cancel")497 tr("Overwrite"), tr(CANCEL_TR)) 498 .setButtonIcons("ok", CANCEL) 494 499 .setContent(action) 495 500 .setCancelButton(2) … … 505 510 506 511 protected EditTagDialog(String key, Map<String, Integer> map, boolean initialFocusOnKey) { 507 super(MainApplication.getMainFrame(), trn("Change value?", "Change values?", map.size()), tr("OK"), tr( "Cancel"));508 setButtonIcons("ok", "cancel");512 super(MainApplication.getMainFrame(), trn("Change value?", "Change values?", map.size()), tr("OK"), tr(CANCEL_TR)); 513 setButtonIcons("ok", CANCEL); 509 514 setCancelButton(2); 510 515 configureContextsensitiveHelp("/Dialog/EditValue", true /* show help button */); … … 526 531 JPanel mainPanel = new JPanel(new BorderLayout()); 527 532 528 String msg = "<html>"+trn("This will change {0} object.",533 String msg = HTML+trn("This will change {0} object.", 529 534 "This will change up to {0} objects.", sel.size(), sel.size()) 530 535 +"<br><br>("+tr("An empty value deletes the tag.", key)+")</html>"; … … 557 562 keys.getModel().setComparator(Comparator.naturalOrder()); // according to Comparable 558 563 keys.setEditable(true); 559 keys.setPrototypeDisplayValue(new AutoCompletionItem( "dummy"));564 keys.setPrototypeDisplayValue(new AutoCompletionItem(DUMMY)); 560 565 keys.getModel().addAllElements(keyList); 561 566 keys.setSelectedItemText(key); … … 574 579 values.setRenderer(new TEHListCellRenderer(values, values.getRenderer(), valueCount.get(key))); 575 580 values.setEditable(true); 576 values.setPrototypeDisplayValue(new AutoCompletionItem( "dummy"));581 values.setPrototypeDisplayValue(new AutoCompletionItem(DUMMY)); 577 582 values.getModel().addAllElements(valueList); 578 583 values.setSelectedItemText(selection); … … 817 822 818 823 protected AddTagsDialog() { 819 super(MainApplication.getMainFrame(), tr("Add tag"), tr("OK"), tr( "Cancel"));820 setButtonIcons("ok", "cancel");824 super(MainApplication.getMainFrame(), tr("Add tag"), tr("OK"), tr(CANCEL_TR)); 825 setButtonIcons("ok", CANCEL); 821 826 setCancelButton(2); 822 827 configureContextsensitiveHelp("/Dialog/AddValue", true /* show help button */); … … 839 844 } 840 845 }; 841 mainPanel.add(new JLabel( "<html>"+trn("This will change up to {0} object.",846 mainPanel.add(new JLabel(HTML+trn("This will change up to {0} object.", 842 847 "This will change up to {0} objects.", sel.size(), sel.size()) 843 848 +"<br><br>"+tr("Please select a key")), GBC.eol().fill(GridBagConstraints.HORIZONTAL)); 844 849 845 850 keys = new AutoCompComboBox<>(); 846 keys.setPrototypeDisplayValue(new AutoCompletionItem( "dummy"));851 keys.setPrototypeDisplayValue(new AutoCompletionItem(DUMMY)); 847 852 keys.setEditable(true); 848 853 keys.getModel().setComparator(Comparator.naturalOrder()); // according to Comparable … … 853 858 854 859 values = new AutoCompComboBox<>(); 855 values.setPrototypeDisplayValue(new AutoCompletionItem( "dummy"));860 values.setPrototypeDisplayValue(new AutoCompletionItem(DUMMY)); 856 861 values.setEditable(true); 857 862 values.getModel().setComparator(Comparator.naturalOrder()); … … 995 1000 lines.add(sc.getKeyText() + ' ' + tr("to add first suggestion without closing the dialog")) 996 1001 ); 997 final JLabel helpLabel = new JLabel( "<html>"+ String.join("<br>", lines) + "</html>");1002 final JLabel helpLabel = new JLabel(HTML + String.join("<br>", lines) + "</html>"); 998 1003 helpLabel.setFont(helpLabel.getFont().deriveFont(Font.PLAIN)); 999 1004 contentPane.add(helpLabel, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(5, 5, 5, 5)); … … 1097 1102 // Create tag label 1098 1103 final String color = action.isEnabled() ? "" : "; color:gray"; 1099 final JLabel tagLabel = new JLabel( "<html>"1104 final JLabel tagLabel = new JLabel(HTML 1100 1105 + "<style>td{" + color + "}</style>" 1101 1106 + "<table><tr>" … … 1238 1243 if (val != null && !val.equals(value)) { 1239 1244 String valueHtmlString = Utils.joinAsHtmlUnorderedList(Arrays.asList("<strike>" + val + "</strike>", value)); 1240 if (!warnOverwriteKey( "<html>"1245 if (!warnOverwriteKey(HTML 1241 1246 + tr("You changed the value of ''{0}'': {1}", key, valueHtmlString) 1242 1247 + tr("Overwrite?"), "overwriteAddKey"))
Note:
See TracChangeset
for help on using the changeset viewer.