Changeset 14304 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-10-07T18:57:14+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r13925 r14304 260 260 } 261 261 262 /** 263 * Move up selected rows, if possible. 264 * @param selectedRows rows to move up 265 * @see #canMoveUp 266 */ 262 267 public void moveUp(int... selectedRows) { 263 268 if (!canMoveUp(selectedRows)) … … 283 288 } 284 289 290 /** 291 * Move down selected rows, if possible. 292 * @param selectedRows rows to move down 293 * @see #canMoveDown 294 */ 285 295 public void moveDown(int... selectedRows) { 286 296 if (!canMoveDown(selectedRows)) … … 308 318 } 309 319 320 /** 321 * Remove selected rows, if possible. 322 * @param selectedRows rows to remove 323 * @see #canRemove 324 */ 310 325 public void remove(int... selectedRows) { 311 326 if (!canRemove(selectedRows)) … … 322 337 } 323 338 339 /** 340 * Checks that a range of rows can be moved up. 341 * @param rows indexes of rows to move up 342 * @return {@code true} if rows can be moved up 343 */ 324 344 public boolean canMoveUp(int... rows) { 325 345 if (rows == null || rows.length == 0) 326 346 return false; 327 347 Arrays.sort(rows); 328 return rows[0] > 0 && !members.isEmpty(); 329 } 330 348 return rows[0] > 0 && rows[rows.length - 1] < members.size(); 349 } 350 351 /** 352 * Checks that a range of rows can be moved down. 353 * @param rows indexes of rows to move down 354 * @return {@code true} if rows can be moved down 355 */ 331 356 public boolean canMoveDown(int... rows) { 332 357 if (rows == null || rows.length == 0) 333 358 return false; 334 359 Arrays.sort(rows); 335 return !members.isEmpty() && rows[rows.length - 1] < members.size() - 1; 336 } 337 360 return rows[0] >= 0 && rows[rows.length - 1] < members.size() - 1; 361 } 362 363 /** 364 * Checks that a range of rows can be removed. 365 * @param rows indexes of rows to remove 366 * @return {@code true} if rows can be removed 367 */ 338 368 public boolean canRemove(int... rows) { 339 369 return rows != null && rows.length != 0; 340 370 } 341 371 372 /** 373 * Returns the selection model. 374 * @return the selection model (never null) 375 */ 342 376 public DefaultListSelectionModel getSelectionModel() { 343 377 if (listSelectionModel == null) {
Note:
See TracChangeset
for help on using the changeset viewer.