Changeset 2700 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-12-29T07:53:23+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/relation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r2665 r2700 456 456 memberTableModel.addTableModelListener(sortAction); 457 457 tb.add(sortAction); 458 459 // -- reverse action 460 ReverseAction reverseAction = new ReverseAction(); 461 memberTableModel.addTableModelListener(reverseAction); 462 tb.add(reverseAction); 458 463 459 464 tb.addSeparator(); … … 895 900 } 896 901 902 class ReverseAction extends AbstractAction implements TableModelListener { 903 public ReverseAction() { 904 putValue(SHORT_DESCRIPTION, tr("Reverse the order of the relation members")); 905 putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "reverse")); 906 putValue(NAME, tr("Reverse")); 907 Shortcut.registerShortcut("relationeditor:reverse", tr("Relation Editor: Reverse"), KeyEvent.VK_R, 908 Shortcut.GROUP_MNEMONIC); 909 updateEnabledState(); 910 } 911 912 public void actionPerformed(ActionEvent e) { 913 memberTableModel.reverse(); 914 } 915 916 protected void updateEnabledState() { 917 setEnabled(memberTableModel.getRowCount() > 0); 918 } 919 920 public void tableChanged(TableModelEvent e) { 921 updateEnabledState(); 922 } 923 } 924 897 925 class MoveUpAction extends AbstractAction implements ListSelectionListener { 898 926 public MoveUpAction() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r2655 r2700 744 744 745 745 /** 746 * Reverse the relation members. 747 */ 748 void reverse() { 749 Collections.reverse(members); 750 fireTableDataChanged(); 751 } 752 753 /** 746 754 * Determines the direction of way k with respect to the way ref_i. 747 755 * The way ref_i is assumed to have the direction ref_direction and
Note:
See TracChangeset
for help on using the changeset viewer.