Changeset 6180 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2013-08-23T03:11:41+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r6130 r6180 124 124 125 125 /* File menu */ 126 /** File -> New Layer **/ 126 127 public final NewAction newAction = new NewAction(); 128 /** File -> Open... **/ 127 129 public final OpenFileAction openFile = new OpenFileAction(); 130 /** File -> Open Recent > **/ 128 131 public final RecentlyOpenedFilesMenu recentlyOpened = new RecentlyOpenedFilesMenu(); 132 /** File -> Open Location... **/ 129 133 public final OpenLocationAction openLocation = new OpenLocationAction(); 130 public final JosmAction save = SaveAction.getInstance(); 131 public final JosmAction saveAs = SaveAsAction.getInstance(); 132 public JosmAction sessionLoad; 133 public JosmAction sessionSaveAs; 134 public final JosmAction gpxExport = new GpxExportAction(); 134 /** File -> Save **/ 135 public final SaveAction save = SaveAction.getInstance(); 136 /** File -> Save As... **/ 137 public final SaveAsAction saveAs = SaveAsAction.getInstance(); 138 /** File -> Session > Load Session **/ 139 public SessionLoadAction sessionLoad; 140 /** File -> Session > Save Session As... **/ 141 public SessionSaveAsAction sessionSaveAs; 142 /** File -> Export to GPX... **/ 143 public final GpxExportAction gpxExport = new GpxExportAction(); 144 /** File -> Download from OSM... **/ 135 145 public final DownloadAction download = new DownloadAction(); 146 /** File -> Download object... **/ 136 147 public final DownloadPrimitiveAction downloadPrimitive = new DownloadPrimitiveAction(); 148 /** File -> Download parent ways/relations... **/ 137 149 public final DownloadReferrersAction downloadReferrers = new DownloadReferrersAction(); 150 /** File -> Close open changesets... **/ 138 151 public final CloseChangesetAction closeChangesetAction = new CloseChangesetAction(); 152 /** File -> Update data **/ 139 153 public final JosmAction update = new UpdateDataAction(); 154 /** File -> Update selection **/ 140 155 public final JosmAction updateSelection = new UpdateSelectionAction(); 156 /** File -> Update modified **/ 141 157 public final JosmAction updateModified = new UpdateModifiedAction(); 158 /** File -> Upload data **/ 142 159 public final JosmAction upload = new UploadAction(); 160 /** File -> Upload selection **/ 143 161 public final JosmAction uploadSelection = new UploadSelectionAction(); 144 public final JosmAction restart = new RestartAction(); 145 public final JosmAction exit = new ExitAction(); 162 /** File -> Restart **/ 163 public final RestartAction restart = new RestartAction(); 164 /** File -> Exit **/ 165 public final ExitAction exit = new ExitAction(); 146 166 147 167 /* Edit menu */ 168 /** Edit -> Undo... */ 148 169 public final UndoAction undo = new UndoAction(); 170 /** Edit -> Redo */ 149 171 public final RedoAction redo = new RedoAction(); 150 public final JosmAction copy = new CopyAction(); 172 /** Edit -> Copy */ 173 public final CopyAction copy = new CopyAction(); 174 /** Edit -> Copy Coordinates */ 151 175 public final JosmAction copyCoordinates = new CopyCoordinatesAction(); 176 /** Edit -> Paste */ 152 177 public final PasteAction paste = new PasteAction(); 153 public final JosmAction pasteTags = new PasteTagsAction(); 154 public final JosmAction duplicate = new DuplicateAction(); 155 public final JosmAction delete = new DeleteAction(); 178 /** Edit -> Paste Tags */ 179 public final PasteTagsAction pasteTags = new PasteTagsAction(); 180 /** Edit -> Duplicate */ 181 public final DuplicateAction duplicate = new DuplicateAction(); 182 /** Edit -> Delete */ 183 public final DeleteAction delete = new DeleteAction(); 184 /** Edit -> Purge... */ 156 185 public final JosmAction purge = new PurgeAction(); 157 public final JosmAction merge = new MergeLayerAction(); 158 public final JosmAction mergeSelected = new MergeSelectionAction(); 159 public final JosmAction selectAll = new SelectAllAction(); 160 public final JosmAction unselectAll = new UnselectAllAction(); 161 public final JosmAction search = new SearchAction(); 162 public final JosmAction preferences = new PreferencesAction(); 186 /** Edit -> Merge layer */ 187 public final MergeLayerAction merge = new MergeLayerAction(); 188 /** Edit -> Merge selection */ 189 public final MergeSelectionAction mergeSelected = new MergeSelectionAction(); 190 /** Edit -> Search... */ 191 public final SearchAction search = new SearchAction(); 192 /** Edit -> Preferences */ 193 public final PreferencesAction preferences = new PreferencesAction(); 163 194 164 195 /* View menu */ 196 /** View -> Wireframe View */ 165 197 public final WireframeToggleAction wireFrameToggleAction = new WireframeToggleAction(); 166 198 public final JosmAction toggleGPXLines = new ToggleGPXLinesAction(); 199 /** View -> Advanced info */ 167 200 public final InfoAction info = new InfoAction(); 201 /** View -> Advanced info (web) */ 168 202 public final InfoWebAction infoweb = new InfoWebAction(); 203 /** View -> History */ 169 204 public final HistoryInfoAction historyinfo = new HistoryInfoAction(); 205 /** View -> History (web) */ 170 206 public final HistoryInfoWebAction historyinfoweb = new HistoryInfoWebAction(); 207 /** View -> "Zoom to"... actions */ 171 208 public final Map<String, AutoScaleAction> autoScaleActions = new HashMap<String, AutoScaleAction>(); 172 209 … … 192 229 public final JosmAction createMultipolygon = new CreateMultipolygonAction(); 193 230 231 /* Selection menu */ 232 /** Selection -> Select All */ 233 public final SelectAllAction selectAll = new SelectAllAction(); 234 /** Selection -> Unselect All */ 235 public final UnselectAllAction unselectAll = new UnselectAllAction(); 236 194 237 /* Audio menu */ 195 238 public final JosmAction audioPlayPause = new AudioPlayPauseAction(); … … 201 244 public final JosmAction audioSlower = new AudioSlowerAction(); 202 245 246 /* Windows Menu */ 247 /** Windows -> Changeset Manager */ 248 public final ChangesetManagerToggleAction changesetManager = new ChangesetManagerToggleAction(); 249 203 250 /* Help menu */ 251 /** Help -> Help */ 204 252 public final HelpAction help = new HelpAction(); 205 public final JosmAction about = new AboutAction(); 206 public final JosmAction statusreport = new ShowStatusReportAction(); 207 253 /** Help -> About */ 254 public final AboutAction about = new AboutAction(); 255 /** Help -> Show Status Report */ 256 public final ShowStatusReportAction statusreport = new ShowStatusReportAction(); 257 258 /** 259 * fileMenu contains I/O actions 260 */ 208 261 public final JMenu fileMenu = addMenu(marktr("File"), KeyEvent.VK_F, 0, ht("/Menu/File")); 209 public final JMenu sessionMenu = new JMenu(tr("Session")); // submenu of the file menu 262 /** 263 * sessionMenu is a submenu of File menu containing all session actions 264 */ 265 public final JMenu sessionMenu = new JMenu(tr("Session")); 266 /** 267 * editMenu contains editing actions 268 */ 210 269 public final JMenu editMenu = addMenu(marktr("Edit"), KeyEvent.VK_E, 1, ht("/Menu/Edit")); 270 /** 271 * viewMenu contains display actions (zoom, map styles, etc.) 272 */ 211 273 public final JMenu viewMenu = addMenu(marktr("View"), KeyEvent.VK_V, 2, ht("/Menu/View")); 212 274 /** … … 226 288 */ 227 289 public final JMenu dataMenu = addMenu(marktr("Data"), KeyEvent.VK_D, 5, ht("/Menu/Data")); 228 290 /** 229 291 * selectionMenu contains all actions related to selecting different objects 230 292 * @since 6082 (moved from Utilsplugin2) 231 293 */ 232 294 public final JMenu selectionMenu = addMenu(marktr("Selection"), KeyEvent.VK_N, 6, ht("/Menu/Selection")); 295 /** 296 * presetsMenu contains presets actions (search, presets tree) 297 */ 233 298 public final JMenu presetsMenu = addMenu(marktr("Presets"), KeyEvent.VK_P, 7, ht("/Menu/Presets")); 234 299 /** … … 237 302 */ 238 303 public final JMenu imagerySubMenu = new JMenu(tr("More...")); 239 public final ImageryMenu imageryMenu = 240 (ImageryMenu)addMenu(new ImageryMenu(imagerySubMenu), marktr("Imagery"), KeyEvent.VK_I, 8, ht("/Menu/Imagery")); 241 /** 304 /** 305 * imageryMenu contains all imagery-related actions 306 */ 307 public final ImageryMenu imageryMenu = addMenu(new ImageryMenu(imagerySubMenu), marktr("Imagery"), KeyEvent.VK_I, 8, ht("/Menu/Imagery")); 308 /** 242 309 * gpsMenu contains all plugin actions that are related 243 310 * to using GPS data, including opening, uploading and real-time tracking … … 253 320 public static enum WINDOW_MENU_GROUP { ALWAYS, TOGGLE_DIALOG, VOLATILE } 254 321 322 /** 323 * audioMenu contains all audio-related actions. Be careful, this menu is not guaranteed to be displayed at all 324 */ 255 325 public JMenu audioMenu = null; 326 /** 327 * helpMenu contains JOSM general actions (Help, About, etc.) 328 */ 256 329 public final JMenu helpMenu = addMenu(marktr("Help"), KeyEvent.VK_H, 11, ht("/Menu/Help")); 257 330 … … 395 468 * @param group the item should be added to. Groups are split by a separator. 396 469 * 0 is the first group, -1 will add the item to the end. 470 * @return The created menu item 397 471 */ 398 472 public static <E extends Enum<E>> JMenuItem add(JMenu menu, JosmAction action, Enum<E> group) { … … 416 490 * one of the enums that are defined for some of the menus to tell in which 417 491 * group the item should go. 492 * @return The created menu item 418 493 */ 419 494 public static <E extends Enum<E>> JCheckBoxMenuItem addWithCheckbox(JMenu menu, JosmAction action, Enum<E> group) { … … 459 534 } 460 535 461 public JMenu addMenu(JMenumenu, String name, int mnemonicKey, int position, String relativeHelpTopic) {536 public <T extends JMenu> T addMenu(T menu, String name, int mnemonicKey, int position, String relativeHelpTopic) { 462 537 Shortcut.registerShortcut("menu:" + name, tr("Menu: {0}", tr(name)), mnemonicKey, 463 538 Shortcut.MNEMONIC).setMnemonic(menu); … … 467 542 } 468 543 544 /** 545 * Constructs a new {@code MainMenu}. 546 */ 469 547 public MainMenu() { 470 548 JMenuItem current; … … 614 692 615 693 // -- changeset manager toggle action 616 ChangesetManagerToggleAction changesetManagerToggleAction = new ChangesetManagerToggleAction(); 617 final JCheckBoxMenuItem mi = MainMenu.addWithCheckbox(windowMenu, changesetManagerToggleAction, 694 final JCheckBoxMenuItem mi = MainMenu.addWithCheckbox(windowMenu, changesetManager, 618 695 MainMenu.WINDOW_MENU_GROUP.ALWAYS); 619 changesetManager ToggleAction.addButtonModel(mi.getModel());696 changesetManager.addButtonModel(mi.getModel()); 620 697 621 698 if (!Main.pref.getBoolean("audio.menuinvisible", false)) {
Note:
See TracChangeset
for help on using the changeset viewer.