Changeset 11747 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2017-03-19T15:55:27+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r11105 r11747 131 131 * @param buttonTexts String Array of the text that will appear on the buttons. The first button is the default one. 132 132 */ 133 public ExtendedDialog(Component parent, String title, String 133 public ExtendedDialog(Component parent, String title, String... buttonTexts) { 134 134 this(parent, title, buttonTexts, true, true); 135 135 } … … 178 178 * @return {@code this} 179 179 */ 180 public ExtendedDialog setButtonIcons(Icon 180 public ExtendedDialog setButtonIcons(Icon... buttonIcons) { 181 181 this.bIcons = Utils.copyArray(buttonIcons); 182 182 return this; … … 188 188 * @return {@code this} 189 189 */ 190 public ExtendedDialog setButtonIcons(String 190 public ExtendedDialog setButtonIcons(String... buttonIcons) { 191 191 bIcons = new Icon[buttonIcons.length]; 192 192 for (int i = 0; i < buttonIcons.length; ++i) { … … 203 203 * @return {@code this} 204 204 */ 205 public ExtendedDialog setToolTipTexts(String 205 public ExtendedDialog setToolTipTexts(String... toolTipTexts) { 206 206 this.bToolTipTexts = Utils.copyArray(toolTipTexts); 207 207 return this; -
trunk/src/org/openstreetmap/josm/gui/ProgramArguments.java
r10936 r11747 103 103 * @since 10936 104 104 */ 105 public ProgramArguments(String 105 public ProgramArguments(String... args) { 106 106 Stream.of(Option.values()).forEach(o -> argMap.put(o, new ArrayList<>())); 107 107 buildCommandLineArgumentMap(args); … … 112 112 * @param args command-line arguments array 113 113 */ 114 private void buildCommandLineArgumentMap(String 114 private void buildCommandLineArgumentMap(String... args) { 115 115 LongOpt[] los = Stream.of(Option.values()).map(Option::toLongOpt).toArray(i -> new LongOpt[i]); 116 116 … … 215 215 } 216 216 217 private static String getValue(String 217 private static String getValue(String... kv) { 218 218 if (kv.length < 2) { 219 219 return ""; -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMergeModel.java
r11365 r11747 274 274 } 275 275 276 protected void copyToTop(ListRole role, int 276 protected void copyToTop(ListRole role, int... rows) { 277 277 copy(role, rows, 0); 278 278 mergedEntriesSelectionModel.setSelectionInterval(0, rows.length -1); … … 286 286 * @param rows the indices 287 287 */ 288 public void copyMyToTop(int 288 public void copyMyToTop(int... rows) { 289 289 copyToTop(MY_ENTRIES, rows); 290 290 } … … 297 297 * @param rows the indices 298 298 */ 299 public void copyTheirToTop(int 299 public void copyTheirToTop(int... rows) { 300 300 copyToTop(THEIR_ENTRIES, rows); 301 301 } … … 310 310 */ 311 311 312 public void copyToEnd(ListRole source, int 312 public void copyToEnd(ListRole source, int... rows) { 313 313 copy(source, rows, getMergedEntriesSize()); 314 314 mergedEntriesSelectionModel.setSelectionInterval(getMergedEntriesSize()-rows.length, getMergedEntriesSize() -1); … … 323 323 * @param rows the indices 324 324 */ 325 public void copyMyToEnd(int 325 public void copyMyToEnd(int... rows) { 326 326 copyToEnd(MY_ENTRIES, rows); 327 327 } … … 334 334 * @param rows the indices 335 335 */ 336 public void copyTheirToEnd(int 336 public void copyTheirToEnd(int... rows) { 337 337 copyToEnd(THEIR_ENTRIES, rows); 338 338 } … … 492 492 * 493 493 */ 494 public void moveUpMerged(int 494 public void moveUpMerged(int... rows) { 495 495 if (rows == null || rows.length == 0) 496 496 return; … … 519 519 * @param rows the indices 520 520 */ 521 public void moveDownMerged(int 521 public void moveDownMerged(int... rows) { 522 522 if (rows == null || rows.length == 0) 523 523 return; … … 547 547 * @param rows the indices 548 548 */ 549 public void removeMerged(int 549 public void removeMerged(int... rows) { 550 550 if (rows == null || rows.length == 0) 551 551 return; -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java
r11489 r11747 33 33 private final ListRole[] participatingRoles; 34 34 35 ComparePairType(String displayName, ListRole 35 ComparePairType(String displayName, ListRole... participatingRoles) { 36 36 this.displayName = displayName; 37 37 this.participatingRoles = Utils.copyArray(participatingRoles); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java
r11381 r11747 238 238 } 239 239 240 private void selectNextConflict(int 240 private void selectNextConflict(int... rows) { 241 241 int max = rows[0]; 242 242 for (int row: rows) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r11535 r11747 548 548 549 549 class ChangesetDialogPopup extends ListPopupMenu { 550 ChangesetDialogPopup(JList<?> 550 ChangesetDialogPopup(JList<?>... lists) { 551 551 super(lists); 552 552 add(selectObjectsAction); -
trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java
r11105 r11747 52 52 protected final transient GroupLayout layout = new GroupLayout(panel); 53 53 54 public OsmIdSelectionDialog(Component parent, String title, String 54 public OsmIdSelectionDialog(Component parent, String title, String... buttonTexts) { 55 55 super(parent, title, buttonTexts); 56 56 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r11381 r11747 342 342 } 343 343 344 public void selectPrimitivesOwnedBy(int 344 public void selectPrimitivesOwnedBy(int... rows) { 345 345 Set<User> users = new HashSet<>(); 346 346 for (int index: rows) { … … 357 357 } 358 358 359 public List<User> getSelectedUsers(int 359 public List<User> getSelectedUsers(int... rows) { 360 360 List<User> ret = new LinkedList<>(); 361 361 if (rows == null || rows.length == 0) -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r11553 r11747 967 967 } 968 968 969 protected void deleteTags(int 969 protected void deleteTags(int... rows) { 970 970 // convert list of rows to HashMap (and find gap for nextKey) 971 971 Map<String, String> tags = new HashMap<>(rows.length); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r11675 r11747 545 545 protected AutoCompletingComboBox values; 546 546 547 AbstractTagsDialog(Component parent, String title, String 547 AbstractTagsDialog(Component parent, String title, String... buttonTexts) { 548 548 super(parent, title, buttonTexts); 549 549 addMouseListener(new PopupMenuLauncher(popupMenu)); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r11746 r11747 257 257 } 258 258 259 public void moveUp(int 259 public void moveUp(int... selectedRows) { 260 260 if (!canMoveUp(selectedRows)) 261 261 return; … … 280 280 } 281 281 282 public void moveDown(int 282 public void moveDown(int... selectedRows) { 283 283 if (!canMoveDown(selectedRows)) 284 284 return; … … 305 305 } 306 306 307 public void remove(int 307 public void remove(int... selectedRows) { 308 308 if (!canRemove(selectedRows)) 309 309 return; … … 319 319 } 320 320 321 public boolean canMoveUp(int 321 public boolean canMoveUp(int... rows) { 322 322 if (rows == null || rows.length == 0) 323 323 return false; … … 326 326 } 327 327 328 public boolean canMoveDown(int 328 public boolean canMoveDown(int... rows) { 329 329 if (rows == null || rows.length == 0) 330 330 return false; … … 333 333 } 334 334 335 public boolean canRemove(int 335 public boolean canRemove(int... rows) { 336 336 if (rows == null || rows.length == 0) 337 337 return false; -
trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java
r10748 r11747 64 64 boolean referenceReversed; 65 65 66 TwoColumnDiff(Object[] reference, Object 66 TwoColumnDiff(Object[] reference, Object... current) { 67 67 this.reference = Utils.copyArray(reference); 68 68 this.current = Utils.copyArray(current); -
trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
r11377 r11747 239 239 } 240 240 241 public List<OsmPrimitive> getPrimitives(int 241 public List<OsmPrimitive> getPrimitives(int... indices) { 242 242 if (indices == null || indices.length == 0) 243 243 return Collections.emptyList(); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r11710 r11747 756 756 } 757 757 758 private static void addIntegerIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String 758 private static void addIntegerIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String... osmKeys) { 759 759 List<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys)); 760 760 possibleKeys.add(0, gpxKey); … … 777 777 } 778 778 779 private static void addDoubleIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String 779 private static void addDoubleIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String... osmKeys) { 780 780 List<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys)); 781 781 possibleKeys.add(0, gpxKey); … … 797 797 } 798 798 799 private static void addStringIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String 799 private static void addStringIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String... osmKeys) { 800 800 List<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys)); 801 801 possibleKeys.add(0, gpxKey); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportImagesAction.java
r10680 r11747 41 41 } 42 42 43 private static void addRecursiveFiles(List<File> files, File 43 private static void addRecursiveFiles(List<File> files, File... sel) { 44 44 if (sel == null) { // listFiles might return null 45 45 return; -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r11726 r11747 143 143 * @return The icon or <code>null</code> if no icon is defined 144 144 */ 145 public static MapImage createIcon(final Environment env, final String 145 public static MapImage createIcon(final Environment env, final String... keys) { 146 146 CheckParameterUtil.ensureParameterNotNull(env, "env"); 147 147 CheckParameterUtil.ensureParameterNotNull(keys, "keys"); -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r10680 r11747 272 272 * @param tagIndices a list of tag indices 273 273 */ 274 public void deleteTagNames(int 274 public void deleteTagNames(int... tagIndices) { 275 275 if (tags == null) 276 276 return; … … 291 291 * @param tagIndices the lit of tag indices 292 292 */ 293 public void deleteTagValues(int 293 public void deleteTagValues(int... tagIndices) { 294 294 if (tags == null) 295 295 return; … … 334 334 * @param tagIndices the list of tag indices 335 335 */ 336 public void deleteTags(int 336 public void deleteTags(int... tagIndices) { 337 337 if (tags == null) 338 338 return; -
trunk/src/org/openstreetmap/josm/gui/tagging/TagTableColumnModelBuilder.java
r9847 r11747 26 26 * @see TableColumn#setCellRenderer 27 27 */ 28 public TagTableColumnModelBuilder(TableCellRenderer renderer, String 28 public TagTableColumnModelBuilder(TableCellRenderer renderer, String... headerValues) { 29 29 CheckParameterUtil.ensureParameterNotNull(headerValues, "headerValues"); 30 30 for (int i = 0; i < headerValues.length; i++) { … … 44 44 * @see TableColumn#setWidth 45 45 */ 46 public TagTableColumnModelBuilder setWidth(int width, int 46 public TagTableColumnModelBuilder setWidth(int width, int... indexes) { 47 47 for (int i : indexes) { 48 48 model.getColumn(i).setWidth(width); … … 58 58 * @see TableColumn#setPreferredWidth 59 59 */ 60 public TagTableColumnModelBuilder setPreferredWidth(int width, int 60 public TagTableColumnModelBuilder setPreferredWidth(int width, int... indexes) { 61 61 for (int i : indexes) { 62 62 model.getColumn(i).setPreferredWidth(width); … … 72 72 * @see TableColumn#setMaxWidth 73 73 */ 74 public TagTableColumnModelBuilder setMaxWidth(int width, int 74 public TagTableColumnModelBuilder setMaxWidth(int width, int... indexes) { 75 75 for (int i : indexes) { 76 76 model.getColumn(i).setMaxWidth(width); … … 86 86 * @see TableColumn#setCellEditor 87 87 */ 88 public TagTableColumnModelBuilder setCellEditor(TableCellEditor editor, int 88 public TagTableColumnModelBuilder setCellEditor(TableCellEditor editor, int... indexes) { 89 89 for (int i : indexes) { 90 90 model.getColumn(i).setCellEditor(editor); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java
r11417 r11747 125 125 } 126 126 127 private static int isMatching(Collection<String> values, String 127 private static int isMatching(Collection<String> values, String... searchString) { 128 128 int sum = 0; 129 129 for (String word: searchString) { … … 149 149 } 150 150 151 int isMatchingGroup(String 151 int isMatchingGroup(String... words) { 152 152 return isMatching(groups, words); 153 153 } 154 154 155 int isMatchingName(String 155 int isMatchingName(String... words) { 156 156 return isMatching(names, words); 157 157 } 158 158 159 int isMatchingTags(String 159 int isMatchingTags(String... words) { 160 160 return isMatching(tags, words); 161 161 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r11553 r11747 158 158 private final String delimiter; 159 159 160 protected ConcatenatingJList(String del, PresetListEntry 160 protected ConcatenatingJList(String del, PresetListEntry... o) { 161 161 super(o); 162 162 delimiter = del; -
trunk/src/org/openstreetmap/josm/gui/widgets/ListPopupMenu.java
r9078 r11747 16 16 private final JList<?>[] lists; 17 17 18 public ListPopupMenu(JList<?> 18 public ListPopupMenu(JList<?>... lists) { 19 19 this.lists = lists; 20 20 } -
trunk/src/org/openstreetmap/josm/gui/widgets/QuadStateCheckBox.java
r10763 r11747 53 53 * @param allowed The allowed states 54 54 */ 55 public QuadStateCheckBox(String text, Icon icon, State initial, State 55 public QuadStateCheckBox(String text, Icon icon, State initial, State... allowed) { 56 56 super(text, icon); 57 57 this.allowed = Utils.copyArray(allowed); … … 86 86 * @param allowed The allowed states 87 87 */ 88 public QuadStateCheckBox(String text, State initial, State 88 public QuadStateCheckBox(String text, State initial, State... allowed) { 89 89 this(text, null, initial, allowed); 90 90 }
Note:
See TracChangeset
for help on using the changeset viewer.