Changeset 4139 in josm
- Timestamp:
- 2011-06-18T15:26:52+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java
r4045 r4139 37 37 tr("Toggle fullscreen view"), 38 38 Shortcut.registerShortcut("menu:view:fullscreen", tr("Toggle fullscreen view"),KeyEvent.VK_F11, Shortcut.GROUP_DIRECT), 39 true /* register shortcut*/39 false /* register */ 40 40 ); 41 41 putValue("help", ht("/Action/FullscreenView")); 42 putValue("toolbar", "fullscreen"); 43 Main.toolbar.register(this); 42 44 gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); 43 45 selected = Main.pref.getBoolean("draw.fullscreen", false); … … 77 79 Main.pref.put("draw.fullscreen", selected); 78 80 notifySelectedState(); 81 setMode(); 82 } 79 83 84 public void initial() { 85 if(selected) 86 setMode(); 87 } 88 89 protected void setMode() { 80 90 Frame frame = (Frame) Main.parent; 81 91 -
trunk/src/org/openstreetmap/josm/actions/HelpAction.java
r2990 r4139 24 24 public HelpAction() { 25 25 super(tr("Help"), ImageProvider.get("help")); 26 putValue("toolbar", "help"); 26 27 } 27 28 -
trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java
r3759 r4139 6 6 import java.awt.event.KeyEvent; 7 7 8 import org.openstreetmap.josm.Main; 8 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; 9 10 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 17 18 tr("Display history information about OSM ways, nodes, or relations."), 18 19 Shortcut.registerShortcut("core:history", 19 tr("Object history"), KeyEvent.VK_H, Shortcut.GROUP_HOTKEY), true);20 tr("Object history"), KeyEvent.VK_H, Shortcut.GROUP_HOTKEY), false); 20 21 putValue("help", ht("/Action/ObjectHistory")); 22 putValue("toolbar", "action/historyinfo"); 23 Main.toolbar.register(this); 21 24 } 22 25 -
trunk/src/org/openstreetmap/josm/actions/InfoAction.java
r3761 r4139 7 7 import java.awt.event.KeyEvent; 8 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 11 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 17 18 tr("Display object information about OSM nodes, ways, or relations."), 18 19 Shortcut.registerShortcut("core:information", 19 tr("Info about Element"), KeyEvent.VK_I, Shortcut.GROUP_HOTKEY), true);20 tr("Info about Element"), KeyEvent.VK_I, Shortcut.GROUP_HOTKEY), false); 20 21 putValue("help", ht("/Action/InfoAboutElements")); 22 putValue("toolbar", "action/info"); 23 Main.toolbar.register(this); 21 24 } 22 25 -
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r3835 r4139 86 86 } 87 87 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc)); 88 putValue("toolbar", iconName); 88 if (getValue("toolbar") == null) { 89 putValue("toolbar", iconName); 90 } 89 91 if (register) { 90 92 Main.toolbar.register(this); -
trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
r3083 r4139 30 30 public JumpToAction() { 31 31 super(tr("Jump To Position"), null, tr("Opens a dialog that allows to jump to a specific location"), Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump To Position")), 32 KeyEvent.VK_G, Shortcut.GROUP_HOTKEY), true); 32 KeyEvent.VK_G, Shortcut.GROUP_HOTKEY), false); 33 putValue("toolbar", "action/jumpto"); 34 Main.toolbar.register(this); 33 35 } 34 36 -
trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java
r3083 r4139 19 19 super(tr("Merge layer"), "dialogs/mergedown", tr("Merge the current layer into another layer"), Shortcut 20 20 .registerShortcut("system:merge", tr("Edit: {0}", tr("Merge")), KeyEvent.VK_M, Shortcut.GROUP_MENU), 21 true /* register */21 false /* register */ 22 22 ); 23 23 putValue("help", ht("/Action/MergeLayer")); 24 putValue("toolbar", "action/mergelayer"); 25 Main.toolbar.register(this); 24 26 } 25 27 -
trunk/src/org/openstreetmap/josm/actions/MoveAction.java
r3327 r4139 32 32 33 33 // any better idea? 34 private static Object calltosupermustbefirststatementinconstructor(Direction dir, boolean text) { 35 Shortcut sc; 34 private static String calltosupermustbefirststatementinconstructor_text(Direction dir) { 36 35 String directiontext; 37 36 if (dir == Direction.UP) { 38 37 directiontext = tr("up"); 39 sc = Shortcut.registerShortcut("core:moveup", tr("Move objects {0}", directiontext), KeyEvent.VK_UP, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT);40 38 } else if (dir == Direction.DOWN) { 41 39 directiontext = tr("down"); 42 sc = Shortcut.registerShortcut("core:movedown", tr("Move objects {0}", directiontext), KeyEvent.VK_DOWN, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT);43 40 } else if (dir == Direction.LEFT) { 44 41 directiontext = tr("left"); 45 sc = Shortcut.registerShortcut("core:moveleft", tr("Move objects {0}", directiontext), KeyEvent.VK_LEFT, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT);46 42 } else { //dir == Direction.RIGHT) { 47 43 directiontext = tr("right"); 48 sc = Shortcut.registerShortcut("core:moveright", tr("Move objects {0}", directiontext), KeyEvent.VK_RIGHT, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT);49 44 } 50 if (text) 51 return directiontext; 52 else 53 return sc; 45 return directiontext; 46 } 47 48 // any better idea? 49 private static Shortcut calltosupermustbefirststatementinconstructor(Direction dir) { 50 Shortcut sc; 51 if (dir == Direction.UP) { 52 sc = Shortcut.registerShortcut("core:moveup", tr("Move objects {0}", tr("up")), KeyEvent.VK_UP, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 53 } else if (dir == Direction.DOWN) { 54 sc = Shortcut.registerShortcut("core:movedown", tr("Move objects {0}", tr("down")), KeyEvent.VK_DOWN, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 55 } else if (dir == Direction.LEFT) { 56 sc = Shortcut.registerShortcut("core:moveleft", tr("Move objects {0}", tr("left")), KeyEvent.VK_LEFT, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 57 } else { //dir == Direction.RIGHT) { 58 sc = Shortcut.registerShortcut("core:moveright", tr("Move objects {0}", tr("right")), KeyEvent.VK_RIGHT, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 59 } 60 return sc; 54 61 } 55 62 56 63 public MoveAction(Direction dir) { 57 super(tr("Move {0}", calltosupermustbefirststatementinconstructor (dir, true)), null,58 tr("Moves Objects {0}", calltosupermustbefirststatementinconstructor (dir, true)),59 (Shortcut)calltosupermustbefirststatementinconstructor(dir, false), true);64 super(tr("Move {0}", calltosupermustbefirststatementinconstructor_text(dir)), null, 65 tr("Moves Objects {0}", calltosupermustbefirststatementinconstructor_text(dir)), 66 calltosupermustbefirststatementinconstructor(dir), false); 60 67 myDirection = dir; 61 68 putValue("help", ht("/Action/Move")); 69 if (dir == Direction.UP) { 70 putValue("toolbar", "action/move/up"); 71 } else if (dir == Direction.DOWN) { 72 putValue("toolbar", "action/move/down"); 73 } else if (dir == Direction.LEFT) { 74 putValue("toolbar", "action/move/left"); 75 } else { //dir == Direction.RIGHT) { 76 putValue("toolbar", "action/move/right"); 77 } 78 Main.toolbar.register(this); 62 79 } 63 80 -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r4126 r4139 81 81 Shortcut.registerShortcut("tools:orthogonalizeUndo", tr("Tool: {0}", tr("Orthogonalize Shape / Undo")), 82 82 KeyEvent.VK_Q, 83 Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true); 83 Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), false); 84 putValue("toolbar", "action/orthogonalize/undo"); 85 Main.toolbar.register(this); 84 86 } 85 87 public void actionPerformed(ActionEvent e) { -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r3299 r4139 44 44 45 45 putValue("help", ht("/Action/ShowStatusReport")); 46 putValue("toolbar", "help/showstatusreport"); 46 47 } 47 48 -
trunk/src/org/openstreetmap/josm/actions/WireframeToggleAction.java
r4087 r4139 20 20 tr("Enable/disable rendering the map as wireframe only"), 21 21 Shortcut.registerShortcut("menu:view:wireframe", tr("Toggle Wireframe view"),KeyEvent.VK_W, Shortcut.GROUP_MENU), 22 true /* register shortcut*/22 false /* register toolbar */ 23 23 ); 24 putValue("toolbar", "wireframe"); 25 Main.toolbar.register(this); 24 26 putValue(SELECTED_KEY, MapRendererFactory.getInstance().isWireframeMapRendererActive()); 25 27 } -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r4083 r4139 252 252 // Main.debug("Main window not maximized"); 253 253 } 254 if(main.menu.fullscreenToggleAction != null) 255 main.menu.fullscreenToggleAction.initial(); 254 256 255 257 SwingUtilities.invokeLater(new Runnable() { -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r4087 r4139 196 196 197 197 public final TaggingPresetSearchAction presetSearchAction = new TaggingPresetSearchAction(); 198 198 public FullscreenToggleAction fullscreenToggleAction = null; 199 199 /** 200 200 * Add a JosmAction to a menu. … … 304 304 if(!Main.applet) { 305 305 // -- fullscreen toggle action 306 FullscreenToggleActionfullscreenToggleAction = new FullscreenToggleAction();306 fullscreenToggleAction = new FullscreenToggleAction(); 307 307 if (fullscreenToggleAction.canFullscreen()) { 308 308 final JCheckBoxMenuItem fullscreen = new JCheckBoxMenuItem(fullscreenToggleAction); -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r4033 r4139 243 243 result.setLength(0); 244 244 245 escape((String) action.getAction().getValue("toolbar")); 245 String val = (String) action.getAction().getValue("toolbar"); 246 if(val == null) 247 return null; 248 escape(val); 246 249 if (action.getAction() instanceof ParameterizedAction) { 247 250 result.append('('); … … 753 756 t.add("|"); 754 757 } else { 755 t.add(parser.saveAction(action)); 758 String res = parser.saveAction(action); 759 if(res != null) 760 t.add(res); 756 761 } 757 762 } … … 783 788 Action action = menuItem.getAction(); 784 789 userObject = action; 785 actions.put((String) action.getValue("toolbar"), action); 790 String toolbar = (String) action.getValue("toolbar"); 791 if(toolbar == null) { 792 System.out.println(tr("Toolbar action without name: {0}", 793 action.getClass().getName())); 794 } else { 795 Action r = actions.get(toolbar); 796 if(r != null && r != action) { 797 System.out.println(tr("Toolbar action {0} overwritten: {1} gets {2}", 798 toolbar, r.getClass().getName(), action.getClass().getName())); 799 } 800 } 801 actions.put(toolbar, action); 786 802 } else { 787 803 userObject = menuItem.getText(); … … 862 878 */ 863 879 public Action register(Action action) { 864 regactions.put((String) action.getValue("toolbar"), action); 880 String toolbar = (String) action.getValue("toolbar"); 881 if(toolbar == null) { 882 System.out.println(tr("Registered toolbar action without name: {0}", 883 action.getClass().getName())); 884 } else { 885 Action r = regactions.get(toolbar); 886 if(r != null) { 887 System.out.println(tr("Registered toolbar action {0} overwritten: {1} gets {2}", 888 toolbar, r.getClass().getName(), action.getClass().getName())); 889 } 890 } 891 regactions.put(toolbar, action); 865 892 return action; 866 893 }
Note:
See TracChangeset
for help on using the changeset viewer.