- Timestamp:
- 2012-02-13T07:57:34+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r4917 r4924 3 3 4 4 import javax.swing.JCheckBoxMenuItem; 5 import javax.swing.JMenuItem; 5 6 import static org.openstreetmap.josm.tools.I18n.tr; 6 7 import static org.openstreetmap.josm.tools.I18n.trn; … … 13 14 import java.awt.Cursor; 14 15 import java.awt.Graphics2D; 16 import java.awt.MenuItem; 15 17 import java.awt.Point; 16 18 import java.awt.Stroke; … … 115 117 snappingKeyCode = Shortcut.registerShortcut("mapmode:drawanglesnapping", tr("Mode: Draw Angle snapping"), KeyEvent.VK_TAB, Shortcut.GROUP_EDIT) 116 118 .getKeyStroke().getKeyCode(); 117 snapCheckboxMenuItem = MainMenu.addWithCheckbox(Main.main.menu.editMenu, new SnapChangeAction(), MainMenu.WINDOW_MENU_GROUP.VOLATILE);119 addMenuItem(); 118 120 snapHelper.setMenuCheckBox(snapCheckboxMenuItem); 119 121 cursorJoinNode = ImageProvider.getCursor("crosshair", "joinnode"); 120 122 cursorJoinWay = ImageProvider.getCursor("crosshair", "joinway"); 123 } 124 125 private void addMenuItem() { 126 int n=Main.main.menu.editMenu.getItemCount(); 127 for (int i=n-1;i>0;i--) { 128 JMenuItem item = Main.main.menu.editMenu.getItem(i); 129 if (item!=null && item.getAction() !=null && item.getAction() instanceof SnapChangeAction) { 130 Main.main.menu.editMenu.remove(i); 131 } 132 } 133 snapCheckboxMenuItem = MainMenu.addWithCheckbox(Main.main.menu.editMenu, new SnapChangeAction(), MainMenu.WINDOW_MENU_GROUP.VOLATILE); 121 134 } 122 135
Note:
See TracChangeset
for help on using the changeset viewer.