Changeset 34488 in osm for applications/editors/josm/plugins/alignways/src/com
- Timestamp:
- 2018-08-18T02:26:59+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysAction.java
r33784 r34488 10 10 import java.util.Collection; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.actions.JosmAction; 14 13 import org.openstreetmap.josm.command.Command; 14 import org.openstreetmap.josm.data.UndoRedoHandler; 15 15 import org.openstreetmap.josm.data.osm.DataSet; 16 16 import org.openstreetmap.josm.data.osm.Node; … … 52 52 53 53 // c is the last command launched, if any 54 Command c = ! Main.main.undoRedo.commands.isEmpty() ? Main.main.undoRedo.commands54 Command c = !UndoRedoHandler.getInstance().commands.isEmpty() ? UndoRedoHandler.getInstance().commands 55 55 .getLast() : null; 56 56 … … 69 69 if (cmdAW.executable()) { 70 70 // This will also trigger AlignWaysCmdKeepLength.executeCommand() 71 Main.main.undoRedo.add(cmdAW);71 UndoRedoHandler.getInstance().add(cmdAW); 72 72 } 73 73 } -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysCmdKeepAngles.java
r33784 r34488 11 11 import javax.swing.JOptionPane; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.data.coor.EastNorth; 15 14 import org.openstreetmap.josm.data.osm.DataSet; 16 15 import org.openstreetmap.josm.data.osm.Node; 17 16 import org.openstreetmap.josm.data.osm.WaySegment; 17 import org.openstreetmap.josm.gui.MainApplication; 18 18 19 19 import com.tilusnet.josm.plugins.alignways.geometry.AlignWaysGeomLine; … … 211 211 212 212 JOptionPane.showMessageDialog( 213 Main .parent,213 MainApplication.getMainFrame(), 214 214 tr(statMsg), 215 215 tr("AlignWayS: Alignment not possible"), -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysCmdKeepLength.java
r33784 r34488 15 15 import javax.swing.JOptionPane; 16 16 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.command.Command; 19 18 import org.openstreetmap.josm.data.coor.EastNorth; … … 22 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 22 import org.openstreetmap.josm.data.osm.WaySegment; 23 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 24 24 import org.openstreetmap.josm.gui.MainApplication; 25 25 import org.openstreetmap.josm.gui.MapView; … … 253 253 // Deny action if the nodes would end up outside world 254 254 for (EastNorth en : calculatedNodes.values()) { 255 if ( Main.getProjection().eastNorth2latlon(en).isOutSideWorld())255 if (ProjectionRegistry.getProjection().eastNorth2latlon(en).isOutSideWorld()) 256 256 return AlignableStatus.ALGN_INV_OUTSIDE_WORLD; 257 257 } … … 300 300 301 301 JOptionPane.showMessageDialog( 302 Main .parent,302 MainApplication.getMainFrame(), 303 303 tr(statMsg), 304 304 tr("AlignWayS: Alignment not possible"), -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysMode.java
r33784 r34488 18 18 import javax.swing.JOptionPane; 19 19 20 import org.openstreetmap.josm.Main;21 20 import org.openstreetmap.josm.actions.mapmode.MapMode; 22 21 import org.openstreetmap.josm.data.osm.DataSet; … … 34 33 import org.openstreetmap.josm.gui.layer.Layer; 35 34 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 35 import org.openstreetmap.josm.spi.preferences.Config; 36 36 import org.openstreetmap.josm.tools.Shortcut; 37 37 … … 76 76 } 77 77 78 boolean showTips = Boolean.parseBoolean( Main.pref.get("alignways.showtips", "true"));78 boolean showTips = Boolean.parseBoolean(Config.getPref().get("alignways.showtips", "true")); 79 79 if ((showTips) && (!tipShown)) { 80 80 showTips(); 81 81 } 82 int majorVer = Integer.parseInt( Main.pref.get("alignways.majorver", "-1"));82 int majorVer = Integer.parseInt(Config.getPref().get("alignways.majorver", "-1")); 83 83 if (majorVer != AlignWaysPlugin.AlignWaysMajorVersion) { 84 84 showWhatsNew(); … … 224 224 null, okButton, okButton[0]); 225 225 tipPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 30, 10)); 226 JDialog tipDialog = tipPane.createDialog(Main .parent, tr("AlignWays Tips"));226 JDialog tipDialog = tipPane.createDialog(MainApplication.getMainFrame(), tr("AlignWays Tips")); 227 227 tipDialog.setIconImage(new ImageIcon(getClass().getResource("/images/alignways.png")).getImage()); 228 228 … … 233 233 tipDialog.dispose(); 234 234 235 Main.pref.putBoolean("alignways.showtips", !atp.isChkBoxSelected());235 Config.getPref().putBoolean("alignways.showtips", !atp.isChkBoxSelected()); 236 236 } 237 237 … … 241 241 JOptionPane wnPane = new JOptionPane(awnp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null); 242 242 wnPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); 243 JDialog wnDialog = wnPane.createDialog(Main .parent, tr("AlignWays: What''s New..."));243 JDialog wnDialog = wnPane.createDialog(MainApplication.getMainFrame(), tr("AlignWays: What''s New...")); 244 244 wnDialog.setIconImage(new ImageIcon(getClass().getResource("/images/alignways.png")).getImage()); 245 245 … … 249 249 wnDialog.dispose(); 250 250 251 Main.pref.put("alignways.majorver", Integer.toString(AlignWaysPlugin.AlignWaysMajorVersion));251 Config.getPref().put("alignways.majorver", Integer.toString(AlignWaysPlugin.AlignWaysMajorVersion)); 252 252 } 253 253 -
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegmentMgr.java
r33136 r34488 9 9 import javax.swing.JOptionPane; 10 10 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.data.osm.Node; 13 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 import org.openstreetmap.josm.gui.MainApplication; 14 14 import org.openstreetmap.josm.gui.MapView; 15 15 … … 76 76 } 77 77 else if (refSeg != null && tmpAlgnSeg.equals(refSeg)) { 78 JOptionPane.showMessageDialog(Main .parent,78 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 79 79 tr("Segment to be aligned cannot be the same with the reference segment.\n" + 80 80 "Please choose a different segment to be aligned."), … … 110 110 } 111 111 else if (algnSeg != null && tmpRefSeg.equals(algnSeg)) { 112 JOptionPane.showMessageDialog(Main .parent,112 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 113 113 tr("Reference segment cannot be the same with the segment to be aligned.\n" + 114 114 "Please choose a different reference segment."),
Note:
See TracChangeset
for help on using the changeset viewer.