Changeset 33921 in osm for applications/editors/josm/plugins
- Timestamp:
- 2017-11-26T15:59:06+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/sumoconvert
- Files:
-
- 3 added
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/sumoconvert/.classpath
r29831 r33921 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="src" path="test/src"/> 5 <!-- <classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/> 6 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 7 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> 8 <classpathentry kind="lib" path="/JOSM/dist/josm-custom.jar" sourcepath="/JOSM/src"/> 9 <classpathentry kind="lib" path="/JOSM/test/build" sourcepath="/JOSM/test/functional"/> 10 <classpathentry kind="lib" path="test/config"/> 11 <classpathentry kind="output" path="build"/> --> 4 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> 6 <classpathentry kind="output" path="bin"/> 12 7 </classpath> -
applications/editors/josm/plugins/sumoconvert/build.xml
r32680 r33921 5 5 <property name="commit.message" value="Commit message"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 0580"/>7 <property name="plugin.main.version" value="12643"/> 8 8 9 9 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/sumoconvert/src/org/openstreetmap/josm/plugins/sumoconvert/ExportTask.java
r29838 r33921 4 4 package org.openstreetmap.josm.plugins.sumoconvert; 5 5 6 import java.io.File;7 6 import java.io.IOException; 8 7 import java.util.Properties; … … 16 15 * 17 16 */ 18 19 17 public class ExportTask extends PleaseWaitRunnable { 20 18 … … 30 28 } 31 29 32 /* (non-Javadoc)33 * @see org.openstreetmap.josm.gui.PleaseWaitRunnable#cancel()34 */35 30 @Override 36 31 protected void cancel() { 37 32 // TODO Auto-generated method stub 38 39 33 } 40 34 41 /* (non-Javadoc)42 * @see org.openstreetmap.josm.gui.PleaseWaitRunnable#finish()43 */44 35 @Override 45 36 protected void finish() { 46 37 // TODO Auto-generated method stub 47 48 38 } 49 39 50 /* (non-Javadoc)51 * @see org.openstreetmap.josm.gui.PleaseWaitRunnable#realRun()52 */53 40 @Override 54 protected void realRun() throws SAXException, IOException, 55 OsmTransferException { 56 41 protected void realRun() throws SAXException, IOException, OsmTransferException { 57 42 try { 58 43 Runtime.getRuntime().exec(sumoConvertProperties.getProperty("resources") + … … 61 46 sumoConvertProperties.getProperty("netconvert.plainoutput"), 62 47 null, 63 null //new File("C:\\Users\\ignacio_palermo\\AppData\\Roaming\\JOSM\\plugins\\sumoconvert")//resources48 null 64 49 ); 65 50 } catch (IOException e) { 66 67 51 e.printStackTrace(); 52 } 68 53 } 69 70 54 } -
applications/editors/josm/plugins/sumoconvert/src/org/openstreetmap/josm/plugins/sumoconvert/SumoConvertPlugin.java
r29838 r33921 1 1 package org.openstreetmap.josm.plugins.sumoconvert; 2 2 3 import java.util.ArrayList; 4 5 import org.openstreetmap.josm.Main; 6 import org.openstreetmap.josm.data.osm.Relation; 7 import org.openstreetmap.josm.gui.MapFrame; 8 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 3 import org.openstreetmap.josm.gui.MainApplication; 9 4 import org.openstreetmap.josm.plugins.Plugin; 10 5 import org.openstreetmap.josm.plugins.PluginInformation; 11 import org.openstreetmap.josm.plugins.turnrestrictions.list.TurnRestrictionsListDialog;12 import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceEditor;13 import org.openstreetmap.josm.plugins.turnrestrictions.*;14 6 15 7 /** … … 19 11 public class SumoConvertPlugin extends Plugin{ 20 12 21 private final ArrayList<Relation> turnrestrictions = new ArrayList<Relation>();22 13 private SumoExportAction exportAction; 23 14 … … 25 16 super(info); 26 17 exportAction = new SumoExportAction(); 27 Main.main.menu.toolsMenu.add(exportAction); 28 System.out.println(getPluginDir()); 29 } 30 31 /** 32 * Called when the JOSM map frame is created or destroyed. 33 */ 34 @Override 35 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 36 if (oldFrame == null && newFrame != null) { // map frame added 37 38 //TurnRestrictionsListDialog dialog = new TurnRestrictionsListDialog(); 39 //add the dialog 40 //newFrame.addToggleDialog(dialog); 41 //CreateOrEditTurnRestrictionAction.getInstance(); 42 } 43 } 44 45 @Override 46 public PreferenceSetting getPreferenceSetting() { 47 return new PreferenceEditor(); 18 MainApplication.getMenu().toolsMenu.add(exportAction); 48 19 } 49 20 } -
applications/editors/josm/plugins/sumoconvert/src/org/openstreetmap/josm/plugins/sumoconvert/SumoExportAction.java
r29831 r33921 9 9 import java.awt.event.KeyEvent; 10 10 11 import javax.swing.JDialog;12 import javax.swing.JOptionPane;13 14 import org.openstreetmap.josm.Main;15 11 import org.openstreetmap.josm.actions.JosmAction; 12 import org.openstreetmap.josm.gui.MainApplication; 16 13 import org.openstreetmap.josm.tools.Shortcut; 17 18 14 19 15 /** … … 30 26 } 31 27 32 /* (non-Javadoc)33 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)34 */35 28 @Override 36 public void actionPerformed(ActionEvent arg0) { 37 SumoExportDialog dialog = new SumoExportDialog(); 38 JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); 39 JDialog dlg = pane.createDialog(Main.parent, tr("Export")); 40 dialog.setOptionPane(pane); 41 dlg.setVisible(true); 42 if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){ 43 ExportTask task = new ExportTask(); 44 Main.worker.execute(task); 45 } 46 dlg.dispose(); 29 public void actionPerformed(ActionEvent e) { 30 MainApplication.worker.execute(new ExportTask()); 47 31 } 48 49 32 }
Note:
See TracChangeset
for help on using the changeset viewer.