Changeset 23244 in osm for applications/editors/josm
- Timestamp:
- 2010-09-17T23:14:51+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 1 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/build.xml
r23236 r23244 41 41 --> 42 42 <property name="josm" location="../../core/dist/josm-custom.jar"/> 43 <property name="plugin.build.dir" value="build"/> 43 <property name="smed_ex" value="../dist/"/> 44 <property name="plugin.build.dir" value="build/"/> 44 45 <property name="plugin.src.dir" value="src"/> 45 46 <!-- this is the directory where the plugin jar is copied to --> 46 47 <property name="plugin.dist.dir" value="../../dist"/> 47 48 <property name="ant.build.javac.target" value="1.5"/> 48 <property name="plugin.dist.dir" value="../../dist"/>49 49 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 50 50 … … 91 91 </copy> 92 92 93 <delete> 94 <fileset dir="${plugin.build.dir}"> 95 <include name="*smed_ex.jar"/> 96 <include name="*smed_about.jar"/> 97 </fileset> 98 </delete> 99 100 93 101 <copy todir="${plugin.build.dir}"> 94 <fileset dir="plugins"/> 102 <fileset dir="../smed_about/smed_dist"/> 103 </copy> 104 105 <copy todir="${plugin.build.dir}"> 106 <fileset dir="../smed_ex/smed_dist"/> 95 107 </copy> 96 108 97 109 <copy todir="${plugin.build.dir}"> 98 110 <fileset dir="."> 99 <include name="copyright.txt" /> 100 <include name="LICENSE.txt" /> 111 <include name="*.txt" /> 101 112 </fileset> 102 113 </copy> -
applications/editors/josm/plugins/smed/src/smed/Smed.java
r23236 r23244 8 8 import java.net.URL; 9 9 import java.net.URLClassLoader; 10 import java.util.Arrays; 10 11 import java.util.Enumeration; 11 12 import java.util.List; … … 23 24 import smed.plug.SmedPluginApp; 24 25 import smed.plug.ifc.SmedPluggable; 26 import smed.plug.util.JARFileFilter; 25 27 import smed.plug.util.SmedPluginLoader; 26 28 import smed.tabs.SmedTabAction; … … 39 41 File pluginDir = Main.pref.getPluginsDirectory(); 40 42 String pluginDirName = pluginDir.getAbsolutePath(); 41 File splug = new File(pluginDirName + "/splug"); 42 if(!splug.exists()) splug.mkdir(); 43 SmedFile splugDir = new SmedFile(pluginDirName + "/splug"); 44 45 if(!splugDir.exists()) splugDir.mkdir(); 43 46 47 File[] jars = splugDir.listFiles(new JARFileFilter()); 48 44 49 // build smed_ifc.jar from smed.jar 45 50 JarEntry e = null; … … 49 54 int len; 50 55 51 System.out.println(new java.util.Date());52 53 56 try { 54 57 JarFile file = new JarFile(pluginDirName + "/smed.jar"); … … 57 60 BufferedOutputStream oos = new BufferedOutputStream( jos); 58 61 59 /* nicht ohne Versionierung freigeben60 62 // extract *.jar to splug 61 63 Enumeration<JarEntry> ent = file.entries(); … … 64 66 eName = e.getName(); 65 67 if(eName.endsWith(".jar")) { 66 FileOutputStream pfos = new FileOutputStream(pluginDirName + "/splug/" + eName); 67 BufferedOutputStream pos = new BufferedOutputStream(pfos); 68 inp = new BufferedInputStream(file.getInputStream( e )); 68 if(splugDir.needUpdate(jars,eName)) { 69 FileOutputStream pfos = new FileOutputStream(pluginDirName + "/splug/" + eName); 70 BufferedOutputStream pos = new BufferedOutputStream(pfos); 71 inp = new BufferedInputStream(file.getInputStream( e )); 69 72 70 71 72 73 while ((len = inp.read(buffer)) > 0) { 74 pos.write(buffer, 0, len); 75 } 73 76 74 pos.flush(); 75 pos.close(); 76 inp.close(); 77 pfos.close(); 77 pos.flush(); 78 pos.close(); 79 inp.close(); 80 pfos.close(); 81 } 78 82 } 79 83 } 80 */ 84 85 81 86 82 87 // write smed_ifc.jar to splug -
applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluggable.java
r23236 r23244 6 6 public interface SmedPluggable { 7 7 8 9 10 11 12 13 14 8 boolean start(); 9 boolean stop(); 10 String getName(); 11 String getInfo(); 12 JComponent getComponent(); 13 14 void setPluginManager(SmedPluginManager manager); 15 15 16 16 } -
applications/editors/josm/plugins/smed_about/build.xml
r23230 r23244 28 28 ** 29 29 --> 30 <project name=" 02_smed_about" basedir=".">30 <project name="smed_about" basedir="."> 31 31 32 32 <!-- enter the SVN commit message --> … … 35 35 <property name="plugin.main.version" value="3329" /> 36 36 37 <!-- Declaring time-stamps--> 38 <tstamp/> 37 39 38 40 <!-- … … 48 50 <property name="smed.plugins" value="../smed/plugins"/> 49 51 <!-- this is the directory where the plugin jar is copied to --> 50 <property name="plugin.dist.dir" value="../../dist"/>51 52 <property name="ant.build.javac.target" value="1.5"/> 52 <property name="plugin.dist.dir" value="../../dist"/> 53 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 54 <property name="smed.jar" value="${plugin.dist.dir}/smed.jar"/> 53 <property name="plugin.dist.dir" value="smed_dist"/> 54 <property name="plugin.jar" value="${plugin.dist.dir}/02_${DSTAMP}_${TSTAMP}_${ant.project.name}.jar"/> 55 55 56 56 <!-- … … 61 61 <target name="init"> 62 62 <mkdir dir="${plugin.build.dir}"/> 63 <mkdir dir="${plugin.dist.dir}"/> 63 64 </target> 64 65 <!-- … … 77 78 --> 78 79 <target name="compile_smed" depends="init_smed"> 79 <echo message="compiling sources for ${smed.jar}... "/>80 <echo message="compiling sources for smed.jar ... "/> 80 81 <javac srcdir="${smed.src.dir}" classpath="${josm}" debug="true" destdir="${smed.build.dir}"> 81 82 <compilerarg value="-Xlint:deprecation"/> … … 119 120 <copy todir="${smed.build.dir}"> 120 121 <fileset dir="../smed"> 121 <include name="copyright.txt" /> 122 <include name="LICENSE.txt" /> 123 </fileset> 124 </copy> 125 126 <jar destfile="${smed.jar}" basedir="${smed.build.dir}"> 122 <include name="*.txt" /> 123 </fileset> 124 </copy> 125 126 <jar destfile="${smed}" basedir="${smed.build.dir}"> 127 127 <!-- 128 128 ************************************************ … … 170 170 </fileset> 171 171 </copy> 172 173 <delete> 174 <fileset dir="${plugin.dist.dir}"> 175 <include name="*smed_about.jar"/> 176 </fileset> 177 </delete> 178 179 172 180 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 173 181 <!-- … … 192 200 </jar> 193 201 194 <copy file="${plugin.jar}" todir="${smed.plugins}"/>195 196 202 </target> 197 203 … … 202 208 --> 203 209 <target name="clean"> 204 <delete dir="${plugin.build.dir}"/>205 <delete file="${plugin.jar}"/>206 210 <delete dir="${smed.build.dir}"/> 207 <delete file="${smed.jar}"/> 211 <delete file="${smed}"/> 212 <delete> 213 <fileset dir="${plugin.dist.dir}"> 214 <include name="*smed_about.jar"/> 215 </fileset> 216 </delete> 217 208 218 </target> 209 219 … … 215 225 <target name="install" depends="dist"> 216 226 <property environment="env"/> 217 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins/splug " else="${user.home}/.josm/plugins/splug">227 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins/splug/" else="${user.home}/.josm/plugins/splug/"> 218 228 <and> 219 229 <os family="windows"/> 220 230 </and> 221 231 </condition> 232 233 <delete> 234 <fileset dir="${josm.plugins.dir}"> 235 <include name="*smed_about.jar"/> 236 </fileset> 237 </delete> 222 238 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 223 239 </target> -
applications/editors/josm/plugins/smed_about/src/smed_about/SmedAbout.java
r23209 r23244 12 12 public class SmedAbout implements SmedPluggable{ 13 13 14 15 16 17 18 19 20 21 22 14 private JPanel jPanel = null; // @jve:decl-index=0:visual-constraint="43,24" 15 private JLabel jLabel = null; 16 private JLabel jLabel1 = null; 17 private JLabel jLabel2 = null; 18 @Override 19 public boolean start() { 20 // TODO Auto-generated method stub 21 return false; 22 } 23 23 24 25 26 27 28 24 @Override 25 public boolean stop() { 26 // TODO Auto-generated method stub 27 return false; 28 } 29 29 30 31 32 33 30 @Override 31 public String getName() { 32 return "About"; 33 } 34 34 35 @Override 36 public void setPluginManager(SmedPluginManager manager) { 37 // TODO Auto-generated method stub 35 @Override 36 public void setPluginManager(SmedPluginManager manager) { 37 // TODO Auto-generated method stub 38 39 } 38 40 39 } 41 @Override 42 public String getInfo() { 40 43 41 @Override 42 public String getInfo() { 44 return "something about the programm"; 45 } 43 46 44 return "something about the programm"; 45 } 47 @Override 48 public JComponent getComponent() { 46 49 47 @Override 48 public JComponent getComponent() { 50 return getJPanel(); 51 } 49 52 50 return getJPanel(); 51 } 52 53 54 /** 55 * This method initializes jPanel 56 * 57 * @return javax.swing.JPanel 58 */ 59 private JPanel getJPanel() { 60 if (jPanel == null) { 61 jLabel2 = new JLabel(); 62 jLabel2.setBounds(new Rectangle(30, 90, 340, 30)); 63 jLabel2.setText("Description:"); 64 jLabel1 = new JLabel(); 65 jLabel1.setBounds(new Rectangle(30, 55, 340, 30)); 66 jLabel1.setText("Version: Date:"); 67 jLabel = new JLabel(); 68 jLabel.setBounds(new Rectangle(30, 20, 340, 30)); 69 jLabel.setText("Authors: Werner König and Malclom Herring"); 70 jPanel = new JPanel(); 71 jPanel.setLayout(null); 72 jPanel.setSize(new Dimension(400, 300)); 73 jPanel.add(jLabel, null); 74 jPanel.add(jLabel1, null); 75 jPanel.add(jLabel2, null); 76 } 77 return jPanel; 78 } 53 54 /** 55 * This method initializes jPanel 56 * 57 * @return javax.swing.JPanel 58 */ 59 private JPanel getJPanel() { 60 if (jPanel == null) { 61 jLabel2 = new JLabel(); 62 jLabel2.setBounds(new Rectangle(30, 90, 340, 30)); 63 jLabel2.setText("Description:"); 64 jLabel1 = new JLabel(); 65 jLabel1.setBounds(new Rectangle(30, 55, 340, 30)); 66 jLabel1.setText("Version: Date:"); 67 jLabel = new JLabel(); 68 jLabel.setBounds(new Rectangle(30, 20, 340, 30)); 69 jLabel.setText("Authors: Werner König and Malclom Herring"); 70 jPanel = new JPanel(); 71 jPanel.setLayout(null); 72 jPanel.setSize(new Dimension(400, 300)); 73 jPanel.add(jLabel, null); 74 jPanel.add(jLabel1, null); 75 jPanel.add(jLabel2, null); 76 } 77 return jPanel; 78 } 79 79 80 80 } -
applications/editors/josm/plugins/smed_ex/build.xml
r23231 r23244 28 28 ** 29 29 --> 30 <project name=" 01_smed_ex" basedir=".">30 <project name="smed_ex" basedir="."> 31 31 32 32 <!-- enter the SVN commit message --> … … 35 35 <property name="plugin.main.version" value="3329" /> 36 36 37 <!-- Declaring time-stamps--> 38 <tstamp/> 37 39 38 40 <!-- … … 41 43 --> 42 44 <property name="josm" location="../../core/dist/josm-custom.jar"/> 43 <property name="smed" location="../../dist/smed.jar /"/>45 <property name="smed" location="../../dist/smed.jar"/> 44 46 <property name="plugin.build.dir" value="build"/> 47 <property name="plugin.src.dir" value="src"/> 45 48 <property name="smed.build.dir" value="../smed/build"/> 46 49 <property name="smed.src.dir" value="../smed/src"/> 47 50 <property name="smed.plugins" value="../smed/plugins"/> 48 <property name="plugin.src.dir" value="src"/>49 51 <!-- this is the directory where the plugin jar is copied to --> 50 <property name="plugin.dist.dir" value="../../dist"/>51 52 <property name="ant.build.javac.target" value="1.5"/> 52 <property name="plugin.dist.dir" value="../../dist"/> 53 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 54 <property name="smed.jar" value="${plugin.dist.dir}/smed.jar"/> 55 53 <property name="plugin.dist.dir" value="smed_dist"/> 54 <property name="plugin.jar" value="${plugin.dist.dir}/01_${DSTAMP}_${TSTAMP}_${ant.project.name}.jar"/> 56 55 57 56 <!-- … … 62 61 <target name="init"> 63 62 <mkdir dir="${plugin.build.dir}"/> 64 </target>65 63 <mkdir dir="${plugin.dist.dir}"/> 64 </target> 66 65 <!-- 67 66 ********************************************************** … … 79 78 --> 80 79 <target name="compile_smed" depends="init_smed"> 81 <echo message="compiling sources for ${smed.jar}... "/>80 <echo message="compiling sources for smed.jar ... "/> 82 81 <javac srcdir="${smed.src.dir}" classpath="${josm}" debug="true" destdir="${smed.build.dir}"> 83 82 <compilerarg value="-Xlint:deprecation"/> … … 85 84 </javac> 86 85 </target> 87 88 <!-- 89 ********************************************************** 90 ** compile - comp iles the source tree86 87 <!-- 88 ********************************************************** 89 ** compile - complies the source tree 91 90 ********************************************************** 92 91 --> … … 126 125 </copy> 127 126 128 <jar destfile="${smed .jar}" basedir="${smed.build.dir}">127 <jar destfile="${smed}" basedir="${smed.build.dir}"> 129 128 <!-- 130 129 ************************************************ … … 172 171 </fileset> 173 172 </copy> 173 174 <delete> 175 <fileset dir="${plugin.dist.dir}"> 176 <include name="*smed_ex.jar"/> 177 </fileset> 178 </delete> 179 174 180 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 175 181 <!-- … … 194 200 </jar> 195 201 196 <copy file="${plugin.jar}" todir="${smed.plugins}"/>197 198 202 </target> 199 203 … … 204 208 --> 205 209 <target name="clean"> 206 <delete dir="${plugin.build.dir}"/>207 <delete file="${plugin.jar}"/>208 210 <delete dir="${smed.build.dir}"/> 209 <delete file="${smed.jar}"/> 211 <delete file="${smed}"/> 212 <delete> 213 <fileset dir="${plugin.dist.dir}"> 214 <include name="*smed_ex.jar"/> 215 </fileset> 216 </delete> 217 210 218 </target> 211 219 … … 217 225 <target name="install" depends="dist"> 218 226 <property environment="env"/> 219 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins/splug " else="${user.home}/.josm/plugins/splug">227 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins/splug/" else="${user.home}/.josm/plugins/splug/"> 220 228 <and> 221 229 <os family="windows"/> 222 230 </and> 223 231 </condition> 232 233 <delete> 234 <fileset dir="${josm.plugins.dir}"> 235 <include name="*smed_ex.jar"/> 236 </fileset> 237 </delete> 238 224 239 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 225 240 </target> -
applications/editors/josm/plugins/smed_ex/src/smed_ex/SmedEx.java
r23209 r23244 16 16 public class SmedEx implements SmedPluggable { 17 17 18 19 18 private JPanel jPanel = null; // @jve:decl-index=0:visual-constraint="78,30" 19 private JButton jButton = null; 20 20 21 22 23 24 25 21 @Override 22 public boolean stop() { 23 // TODO Auto-generated method stub 24 return false; 25 } 26 26 27 28 27 @Override 28 public String getName() { 29 29 30 return "hello";31 30 return "Hello"; 31 } 32 32 33 34 33 @Override 34 public String getInfo() { 35 35 36 37 36 return "say hello"; 37 } 38 38 39 @Override 40 public JComponent getComponent() { 39 @Override 40 public JComponent getComponent() { 41 42 return getJPanel(); 43 } 41 44 42 return getJPanel(); 43 } 45 @Override 46 public void setPluginManager(SmedPluginManager manager) { 47 // TODO Auto-generated method stub 44 48 45 @Override 46 public void setPluginManager(SmedPluginManager manager) { 47 // TODO Auto-generated method stub 49 } 48 50 49 } 51 /** 52 * This method initializes jPanel 53 * 54 * @return javax.swing.JPanel 55 */ 56 private JPanel getJPanel() { 57 if (jPanel == null) { 58 jPanel = new JPanel(); 59 jPanel.setLayout(null); 60 jPanel.setPreferredSize(new Dimension(200, 130)); 61 jPanel.add(getJButton(), null); 62 } 63 return jPanel; 64 } 50 65 51 /** 52 * This method initializes jPanel 53 * 54 * @return javax.swing.JPanel 55 */ 56 private JPanel getJPanel() { 57 if (jPanel == null) { 58 jPanel = new JPanel(); 59 jPanel.setLayout(null); 60 jPanel.setPreferredSize(new Dimension(200, 130)); 61 jPanel.add(getJButton(), null); 62 } 63 return jPanel; 64 } 66 /** 67 * This method initializes jButton 68 * 69 * @return javax.swing.JButton 70 */ 71 private JButton getJButton() { 72 if (jButton == null) { 73 jButton = new JButton(); 74 jButton.setBounds(new Rectangle(15, 40, 160, 40)); 75 jButton.setText("Hello World!"); 76 77 jButton.addActionListener(new ActionListener() { 65 78 66 /** 67 * This method initializes jButton 68 * 69 * @return javax.swing.JButton 70 */ 71 private JButton getJButton() { 72 if (jButton == null) { 73 jButton = new JButton(); 74 jButton.setBounds(new Rectangle(15, 40, 160, 40)); 75 jButton.setText("Hello World!"); 79 @Override 80 public void actionPerformed(ActionEvent e) { 81 JOptionPane.showMessageDialog( null, "it works" ); 82 } 83 84 }); 85 } 86 return jButton; 87 } 76 88 77 jButton.addActionListener(new ActionListener() { 78 79 @Override 80 public void actionPerformed(ActionEvent e) { 81 JOptionPane.showMessageDialog( null, "it works" ); 82 } 83 84 }); 85 } 86 return jButton; 87 } 88 89 @Override 90 public boolean start() { 91 // TODO Auto-generated method stub 92 return false; 93 } 89 @Override 90 public boolean start() { 91 // TODO Auto-generated method stub 92 return false; 93 } 94 94 95 95 }
Note:
See TracChangeset
for help on using the changeset viewer.