Ignore:
Timestamp:
2010-09-17T23:14:51+02:00 (15 years ago)
Author:
postfix
Message:

first really good working framework smed

Location:
applications/editors/josm/plugins/smed_ex
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed_ex/build.xml

    r23231 r23244  
    2828**
    2929-->
    30 <project name="01_smed_ex" basedir=".">
     30<project name="smed_ex" basedir=".">
    3131
    3232        <!-- enter the SVN commit message -->
     
    3535        <property name="plugin.main.version" value="3329" />
    3636
     37        <!-- Declaring  time-stamps-->
     38        <tstamp/>
    3739
    3840        <!--
     
    4143     -->
    4244        <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"/>
    4446        <property name="plugin.build.dir"       value="build"/>
     47        <property name="plugin.src.dir"         value="src"/>
    4548        <property name="smed.build.dir"         value="../smed/build"/>
    4649        <property name="smed.src.dir"           value="../smed/src"/>
    4750        <property name="smed.plugins"           value="../smed/plugins"/>
    48         <property name="plugin.src.dir"         value="src"/>
    4951        <!-- this is the directory where the plugin jar is copied to -->
    50         <property name="plugin.dist.dir"        value="../../dist"/>
    5152        <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"/>
    5655
    5756        <!--
     
    6261        <target name="init">
    6362                <mkdir dir="${plugin.build.dir}"/>
    64         </target>
    65 
     63                <mkdir dir="${plugin.dist.dir}"/>
     64        </target>
    6665        <!--
    6766    **********************************************************
     
    7978    -->
    8079        <target name="compile_smed" depends="init_smed">
    81                 <echo message="compiling sources for  ${smed.jar} ... "/>
     80                <echo message="compiling sources for smed.jar ... "/>
    8281                <javac srcdir="${smed.src.dir}" classpath="${josm}" debug="true" destdir="${smed.build.dir}">
    8382                        <compilerarg value="-Xlint:deprecation"/>
     
    8584                </javac>
    8685        </target>
    87        
    88         <!--
    89     **********************************************************
    90     ** compile - compiles the source tree
     86
     87        <!--
     88    **********************************************************
     89    ** compile - complies the source tree
    9190    **********************************************************
    9291    -->
     
    126125                </copy>
    127126
    128                 <jar destfile="${smed.jar}" basedir="${smed.build.dir}">
     127                <jar destfile="${smed}" basedir="${smed.build.dir}">
    129128                        <!--
    130129        ************************************************
     
    172171                        </fileset>
    173172                </copy>
     173               
     174                <delete>
     175                        <fileset dir="${plugin.dist.dir}">
     176                        <include name="*smed_ex.jar"/>
     177                        </fileset>
     178                </delete>
     179               
    174180                <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    175181                        <!--
     
    194200                </jar>
    195201               
    196                 <copy file="${plugin.jar}" todir="${smed.plugins}"/>
    197                
    198202        </target>
    199203       
     
    204208    -->
    205209        <target name="clean">
    206                 <delete dir="${plugin.build.dir}"/>
    207                 <delete file="${plugin.jar}"/>
    208210                <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
    210218        </target>
    211219
     
    217225        <target name="install" depends="dist">
    218226                <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/">
    220228                        <and>
    221229                                <os family="windows"/>
    222230                        </and>
    223231                </condition>
     232
     233                <delete>
     234                        <fileset dir="${josm.plugins.dir}">
     235                        <include name="*smed_ex.jar"/>
     236                        </fileset>
     237                </delete>
     238
    224239                <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    225240        </target>
  • applications/editors/josm/plugins/smed_ex/src/smed_ex/SmedEx.java

    r23209 r23244  
    1616public class SmedEx implements SmedPluggable {
    1717
    18     private JPanel jPanel = null;  //  @jve:decl-index=0:visual-constraint="78,30"
    19     private JButton jButton = null;
     18        private JPanel jPanel = null;  //  @jve:decl-index=0:visual-constraint="78,30"
     19        private JButton jButton = null;
    2020
    21     @Override
    22     public boolean stop() {
    23         // TODO Auto-generated method stub
    24         return false;
    25     }
     21        @Override
     22        public boolean stop() {
     23                // TODO Auto-generated method stub
     24                return false;
     25        }
    2626
    27     @Override
    28     public String getName() {
     27        @Override
     28        public String getName() {
    2929
    30         return "hello";
    31     }
     30                return "Hello";
     31        }
    3232
    33     @Override
    34     public String getInfo() {
     33        @Override
     34        public String getInfo() {
    3535
    36         return "say hello";
    37     }
     36                return "say hello";
     37        }
    3838
    39     @Override
    40     public JComponent getComponent() {
     39        @Override
     40        public JComponent getComponent() {
     41               
     42                return getJPanel();
     43        }
    4144
    42         return getJPanel();
    43     }
     45        @Override
     46        public void setPluginManager(SmedPluginManager manager) {
     47                // TODO Auto-generated method stub
    4448
    45     @Override
    46     public void setPluginManager(SmedPluginManager manager) {
    47         // TODO Auto-generated method stub
     49        }
    4850
    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        }
    5065
    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() {
    6578
    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        }
    7688
    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        }
    9494
    9595}
Note: See TracChangeset for help on using the changeset viewer.