Changeset 28624 in osm for applications/editors/josm/plugins/alignways/src
- Timestamp:
- 2012-08-24T13:41:33+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysAction.java
r27852 r28624 58 58 59 59 AlignWaysCmdKeepLength cmdAW; 60 if (AlignWaysPlugin. awDialog.getAwOpt() == AligningModeOption.ALGN_OPT_KEEP_ANGLE) {60 if (AlignWaysPlugin.getAwDialog().getAwOpt() == AligningModeOption.ALGN_OPT_KEEP_ANGLE) { 61 61 cmdAW = new AlignWaysCmdKeepAngles(); 62 62 } else { -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysDialog.java
r27466 r28624 163 163 164 164 } 165 166 public JCheckBoxMenuItem getWindowMenuItem() {167 return windowMenuItem;168 }169 170 171 165 } -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysPlugin.java
r27508 r28624 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 5 import javax.swing.JMenuItem;6 4 7 5 import org.openstreetmap.josm.Main; … … 20 18 public class AlignWaysPlugin extends Plugin { 21 19 22 static AlignWaysMode awMode; 23 private final IconToggleButton btn; 24 static JMenuItem alignWaysMenuItem; 25 static JosmAction awAction; 26 static AlignWaysDialog awDialog; 27 static IconToggleButton optBtn; 20 private static AlignWaysMode awMode; 21 private static IconToggleButton btn; 22 private static JosmAction awAction; 23 private static AlignWaysDialog awDialog; 24 private static IconToggleButton optBtn; 28 25 29 26 // The major version is e.g. used to decide when to trigger What's New windows … … 33 30 super(info); 34 31 35 // Construct the AlignWays mode toggle button36 awMode = new AlignWaysMode(Main.map, "alignways", tr("Align Ways mode"));37 btn = new IconToggleButton(awMode);38 btn.setVisible(true);39 40 32 // Add the action entries to the Tools Menu 41 33 Main.main.menu.toolsMenu.addSeparator(); 42 34 awAction = new AlignWaysAction(); 43 alignWaysMenuItem = MainMenu.add(Main.main.menu.toolsMenu, awAction); 44 45 awDialog = new AlignWaysDialog(awMode); 46 // Prevent user clicking on the Windows menu entry while panel is meaningless 47 awDialog.getWindowMenuItem().setEnabled(false); 35 MainMenu.add(Main.main.menu.toolsMenu, awAction); 48 36 } 49 37 50 38 @Override 51 39 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 52 if(newFrame != null) { 53 optBtn = newFrame.addToggleDialog(AlignWaysPlugin.getAwDialog()); 40 if (newFrame != null) { 41 // Construct the AlignWays mode toggle button 42 awMode = new AlignWaysMode(Main.map, "alignways", tr("Align Ways mode")); 43 btn = new IconToggleButton(awMode); 44 btn.setVisible(true); 45 newFrame.addMapMode(btn); 46 optBtn = newFrame.addToggleDialog(awDialog = new AlignWaysDialog(awMode)); 54 47 } else { 55 // Disable menu item in Windows menu 56 awDialog.getWindowMenuItem().setEnabled(false); 57 } 58 59 if (Main.map != null) { 60 Main.map.addMapMode(btn); 61 // Re-enable menu item in Windows menu 62 awDialog.getWindowMenuItem().setEnabled(true); 48 awDialog = null; 49 optBtn = null; 50 btn = null; 51 awMode = null; 63 52 } 64 53 } … … 91 80 return optBtn; 92 81 } 93 94 82 } -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysTipsPanel.java
r27348 r28624 101 101 step04.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<ul>\n <li><b>Align the segments.</b> Press <b><i><span style=\"color:green\">{0}" 102 102 + "</span></i></b>. Alternatively you''ll find the command in the <b>Tools</b>\n menu or may want to place the action on the <b>toolbar</b>.\n </li>\n</ul>\n</div>\n</html>\n\n", 103 AlignWaysPlugin. awAction.getShortcut().getKeyText()));103 AlignWaysPlugin.getAwAction().getShortcut().getKeyText())); 104 104 step04.setVerticalAlignment(SwingConstants.TOP); 105 105
Note:
See TracChangeset
for help on using the changeset viewer.