Changeset 1467 in osm
- Timestamp:
- 2006-10-13T21:50:23+02:00 (18 years ago)
- Location:
- utils/josm/plugins
- Files:
-
- 78 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
utils/josm/plugins/osmarender/build.xml
r1438 r1467 1 1 <project name="osmarender" default="build" basedir="."> 2 2 3 <property name="josm" location="../../../../editors/josm/dist/josm-custom.jar" /> 3 <!--property name="josm" location="../../../../editors/josm/dist/josm-custom.jar" /--> 4 <property name="josm" location="../../../../../josm/bin" /> 5 4 6 <property name="osmarender" location="../../../osmarender" /> 5 7 <property name="target" location="dist/osmarender.jar" /> -
utils/josm/plugins/osmarender/src/OsmarenderPlugin.java
r1438 r1467 64 64 } 65 65 66 try { 67 // store the stuff in data.osm 68 OsmWriter.output(new FileOutputStream(getPluginDir()+"data.osm"), new OsmWriter.All(fromDataSet, true)); 66 String firefox = Main.pref.get("osmarender.firefox", "firefox"); 67 boolean retry = false; 68 do { 69 try { 70 retry = false; 69 71 70 // launch up the viewer 71 String firefox = Main.pref.get("osmarender.firefox", "firefox"); 72 Runtime.getRuntime().exec(firefox+" "+getPluginDir()+"osm-map-features.xml"); 73 } catch (IOException e1) { 74 JOptionPane.showMessageDialog(Main.parent, "Could not launch Osmarender."); 75 } 72 // write to plugin dir 73 OsmWriter.output(new FileOutputStream(getPluginDir()+"data.osm"), new OsmWriter.All(fromDataSet, true)); 74 75 // get the exec line 76 String exec = firefox; 77 if (System.getProperty("os.name").startsWith("Windows")) 78 exec += " file:///"+getPluginDir().replace('\\','/').replace(" ","%20")+"osm-map-features.xml\""; 79 else 80 exec += " "+getPluginDir()+"osm-map-features.xml"; 81 82 // launch up the viewer 83 Runtime.getRuntime().exec(exec); 84 } catch (IOException e1) { 85 firefox = JOptionPane.showInputDialog(Main.parent, "FireFox not found. Please enter location of firefox executable"); 86 if (firefox != null) { 87 Main.pref.put("osmarender.firefox", firefox); 88 retry = true; 89 } 90 } 91 } while (retry); 76 92 } 77 93 } … … 81 97 82 98 public OsmarenderPlugin() throws IOException { 83 JMenuBar menu = Main.main.m ainMenu;99 JMenuBar menu = Main.main.menu; 84 100 view = null; 85 101 for (int i = 0; i < menu.getMenuCount(); ++i) { … … 91 107 if (view == null) { 92 108 view = new JMenu(tr("View")); 93 Main.main.mainMenu.add(view, 1);109 menu.add(view, 2); 94 110 view.setVisible(false); 95 111 } -
utils/josm/plugins/plastic_laf/.classpath
r1439 r1467 3 3 <classpathentry kind="src" path="src"/> 4 4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 5 <classpathentry combineaccessrules="false" kind="src" path="/josm"/>6 5 <classpathentry kind="lib" path="lib/looks-2.0.4.jar"/> 7 6 <classpathentry kind="output" path="bin"/> -
utils/josm/plugins/plastic_laf/build.xml
r1439 r1467 1 <project name="plastic_laf" default=" build" basedir=".">1 <project name="plastic_laf" default="install" basedir="."> 2 2 3 <path id="classpath"> 4 <fileset file="../../../../editors/josm/dist/josm-custom.jar" /> 5 <fileset dir="lib" /> 6 </path> 7 8 9 <target name="compile"> 10 <mkdir dir="build"></mkdir> 11 <mkdir dir="dist"></mkdir> 12 <javac srcdir="src" classpathref="classpath" debug="true" destdir="build"> 13 <include name="**/*.java" /> 14 </javac> 15 </target> 16 17 <target name="build" depends="compile"> 18 <unjar dest="build" src="lib/looks-2.0.4.jar" /> 19 <jar destfile="dist/plastic_laf.jar" basedir="build"> 3 <target name="install"> 4 <unjar dest="bin" src="lib/looks-2.0.4.jar" /> 5 <jar destfile="${user.home}/.josm/plugins/plastic_laf.jar" basedir="bin"> 20 6 <manifest> 21 7 <attribute name="Plugin-Class" value="plastic_laf.Plugin" /> 22 8 <attribute name="Plugin-Description" value="The great JGoodies Plastic Look and Feel" /> 9 <attribute name="Plugin-Early" value="true" /> 23 10 </manifest> 24 11 </jar> 25 12 </target> 26 13 27 <target name="clean">28 <delete dir="build" />29 <delete dir="dist" />30 </target>31 32 <target name="install" depends="build">33 <copy file="dist/plastic_laf.jar" todir="${user.home}/.josm/plugins"/>34 </target>35 36 14 </project> -
utils/josm/plugins/plastic_laf/src/plastic_laf/Plugin.java
r1439 r1467 1 1 package plastic_laf; 2 2 3 import javax.swing.SwingUtilities;4 3 import javax.swing.UIManager; 5 6 import org.openstreetmap.josm.Main; 7 import org.openstreetmap.josm.actions.DownloadAction.DownloadTask; 4 import javax.swing.UnsupportedLookAndFeelException; 8 5 9 6 import com.jgoodies.looks.plastic.PlasticLookAndFeel; 10 7 11 8 public class Plugin { 12 13 public Plugin() { 14 try { 15 UIManager.getDefaults().put("ClassLoader", getClass().getClassLoader()); 16 UIManager.setLookAndFeel(new PlasticLookAndFeel()); 17 18 SwingUtilities.updateComponentTreeUI(Main.parent); 19 SwingUtilities.updateComponentTreeUI(Main.pleaseWaitDlg); 20 for (DownloadTask task : Main.main.downloadAction.downloadTasks) 21 SwingUtilities.updateComponentTreeUI(task.getCheckBox()); 22 } catch (Exception e) { 23 if (e instanceof RuntimeException) 24 throw (RuntimeException)e; 25 throw new RuntimeException(e); 26 } 9 public Plugin() throws UnsupportedLookAndFeelException { 10 UIManager.getDefaults().put("ClassLoader", getClass().getClassLoader()); 11 UIManager.setLookAndFeel(new PlasticLookAndFeel()); 27 12 } 28 13 }
Note:
See TracChangeset
for help on using the changeset viewer.