Changeset 19469 in osm


Ignore:
Timestamp:
2010-01-13T15:10:15+01:00 (14 years ago)
Author:
guggis
Message:

'Changed the constructor signature of the plugin main class'

Location:
applications/editors/josm/plugins/plastic_laf
Files:
2 edited

Legend:

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

    r14016 r19469  
     1<?xml version="1.0" encoding="UTF-8"?>
     2<!--
     3** This is the build file for the plastic_laf plugin.
     4**
     5** Maintaining versions
     6** ====================
     7** see README.template
     8**
     9** Usage
     10** =====
     11** To build it run
     12**
     13**    > ant  dist
     14**
     15** To install the generated plugin locally (in you default plugin directory) run
     16**
     17**    > ant  install
     18**
     19** The generated plugin jar is not automatically available in JOSMs plugin configuration
     20** dialog. You have to check it in first.
     21**
     22** Use the ant target 'publish' to check in the plugin and make it available to other
     23** JOSM users:
     24**    set the properties commit.message and plugin.main.version
     25** and run
     26**    > ant  publish
     27**
     28**
     29-->
    130<project name="plastic_laf" default="dist" basedir=".">
    2     <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
    3     <property name="plugin.dist.dir"        value="../../dist"/>
    4     <property name="plugin.build.dir"       value="build"/>
    5     <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    6     <property name="ant.build.javac.target" value="1.5"/>
    7     <property name="looks"                  value="lib/looks-2.2.1.jar"/>
    8     <target name="init">
    9         <mkdir dir="${plugin.build.dir}"/>
    10     </target>
    11     <target name="compile" depends="init">
    12         <echo message="creating ${plugin.jar}"/>
    13         <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
    14             <compilerarg value="-Xlint:deprecation"/>
    15             <compilerarg value="-Xlint:unchecked"/>
    16             <classpath>
    17                 <pathelement location="${josm}"/>
    18                 <pathelement location="${looks}"/>
    19             </classpath>
    20         </javac>
    21     </target>
    22     <target name="dist" depends="compile,revision">
    23         <unjar dest="${plugin.build.dir}" src="${looks}"/>
    24         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    25             <manifest>
    26                 <attribute name="Author" value="Imi"/>
    27                 <attribute name="Plugin-Class" value="plastic_laf.Plugin"/>
    28                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    29                 <attribute name="Plugin-Description" value="The great JGoodies Plastic Look and Feel."/>
    30                 <attribute name="Plugin-Early" value="true"/>
    31                 <attribute name="Plugin-Link" value="http://www.jgoodies.com/"/>
    32                 <attribute name="Plugin-Mainversion" value="1465"/>
    33                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    34             </manifest>
    35         </jar>
    36     </target>
    37     <target name="revision">
    38         <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    39             <env key="LANG" value="C"/>
    40             <arg value="info"/>
    41             <arg value="--xml"/>
    42             <arg value="."/>
    43         </exec>
    44         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    45         <delete file="REVISION"/>
    46     </target>
    47     <target name="clean">
    48         <delete dir="${plugin.build.dir}"/>
    49         <delete file="${plugin.jar}"/>
    50     </target>
    51     <target name="install" depends="dist">
    52         <property environment="env"/>
    53         <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
    54             <and>
    55                 <os family="windows"/>
    56             </and>
    57         </condition>
    58         <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    59     </target>
     31
     32        <!-- enter the SVN commit message -->
     33        <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
     34        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     35        <property name="plugin.main.version" value="2830" />
     36
     37        <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
     38        <property name="plugin.dist.dir"        value="../../dist"/>
     39        <property name="plugin.build.dir"       value="build"/>
     40        <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
     41        <property name="ant.build.javac.target" value="1.5"/>
     42        <property name="looks"                  value="lib/looks-2.2.1.jar"/>
     43        <target name="init">
     44                <mkdir dir="${plugin.build.dir}"/>
     45        </target>
     46        <target name="compile" depends="init">
     47                <echo message="creating ${plugin.jar}"/>
     48                <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
     49                        <compilerarg value="-Xlint:deprecation"/>
     50                        <compilerarg value="-Xlint:unchecked"/>
     51                        <classpath>
     52                                <pathelement location="${josm}"/>
     53                                <pathelement location="${looks}"/>
     54                        </classpath>
     55                </javac>
     56        </target>
     57        <target name="dist" depends="compile,revision">
     58                <unjar dest="${plugin.build.dir}" src="${looks}"/>
     59                <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
     60                        <manifest>
     61                                <attribute name="Author" value="Imi"/>
     62                                <attribute name="Plugin-Class" value="plastic_laf.Plugin"/>
     63                                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
     64                                <attribute name="Plugin-Description" value="The great JGoodies Plastic Look and Feel."/>
     65                                <attribute name="Plugin-Early" value="true"/>
     66                                <attribute name="Plugin-Link" value="http://www.jgoodies.com/"/>
     67                                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
     68                                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
     69                        </manifest>
     70                </jar>
     71        </target>
     72        <target name="revision">
     73                <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
     74                        <env key="LANG" value="C"/>
     75                        <arg value="info"/>
     76                        <arg value="--xml"/>
     77                        <arg value="."/>
     78                </exec>
     79                <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
     80                <delete file="REVISION"/>
     81        </target>
     82        <target name="clean">
     83                <delete dir="${plugin.build.dir}"/>
     84                <delete file="${plugin.jar}"/>
     85        </target>
     86        <target name="install" depends="dist">
     87                <property environment="env"/>
     88                <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
     89                        <and>
     90                                <os family="windows"/>
     91                        </and>
     92                </condition>
     93                <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
     94        </target>
     95
     96        <!--
     97        ************************** Publishing the plugin ***********************************
     98        -->
     99        <!--
     100                ** extracts the JOSM release for the JOSM version in ../core and saves it in the
     101                ** property ${coreversion.info.entry.revision}
     102                **
     103                -->
     104        <target name="core-info">
     105                <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
     106                        <env key="LANG" value="C"/>
     107                        <arg value="info"/>
     108                        <arg value="--xml"/>
     109                        <arg value="../../core"/>
     110                </exec>
     111                <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
     112                <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
     113                <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
     114                <delete file="core.info.xml" />
     115        </target>
     116
     117        <!--
     118                ** commits the source tree for this plugin
     119                -->
     120        <target name="commit-current">
     121                <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
     122                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     123                        <env key="LANG" value="C"/>
     124                        <arg value="commit"/>
     125                        <arg value="-m '${commit.message}'"/>
     126                        <arg value="."/>
     127                </exec>
     128        </target>
     129
     130        <!--
     131                ** updates (svn up) the source tree for this plugin
     132                -->
     133        <target name="update-current">
     134                <echo>Updating plugin source ...</echo>
     135                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     136                        <env key="LANG" value="C"/>
     137                        <arg value="up"/>
     138                        <arg value="."/>
     139                </exec>
     140                <echo>Updating ${plugin.jar} ...</echo>
     141                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     142                        <env key="LANG" value="C"/>
     143                        <arg value="up"/>
     144                        <arg value="../dist/${plugin.jar}"/>
     145                </exec>
     146        </target>
     147
     148        <!--
     149                ** commits the plugin.jar
     150                -->
     151        <target name="commit-dist">
     152                <echo>
     153        ***** Properties of published ${plugin.jar} *****
     154        Commit message    : '${commit.message}'                                 
     155        Plugin-Mainversion: ${plugin.main.version}
     156        JOSM build version: ${coreversion.info.entry.revision}
     157        Plugin-Version    : ${version.entry.commit.revision}
     158        ***** / Properties of published ${plugin.jar} *****                                     
     159                                               
     160        Now commiting ${plugin.jar} ...
     161        </echo>
     162                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     163                        <env key="LANG" value="C"/>
     164                        <arg value="-m '${commit.message}'"/>
     165                        <arg value="commit"/>
     166                        <arg value="${plugin.jar}"/>
     167                </exec>
     168        </target>
     169
     170        <!-- ** make sure svn is present as a command line tool ** -->
     171        <target name="ensure-svn-present">
     172                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
     173                        <env key="LANG" value="C" />
     174                        <arg value="--version" />
     175                </exec>
     176                <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
     177                        <!-- return code not set at all? Most likely svn isn't installed -->
     178                        <condition>
     179                                <not>
     180                                        <isset property="svn.exit.code" />
     181                                </not>
     182                        </condition>
     183                </fail>
     184                <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
     185                        <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
     186                        <condition>
     187                                <isfailure code="${svn.exit.code}" />
     188                        </condition>
     189                </fail>
     190        </target>
     191
     192        <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
     193        </target>
    60194</project>
  • applications/editors/josm/plugins/plastic_laf/src/plastic_laf/Plugin.java

    r13497 r19469  
    44import javax.swing.UnsupportedLookAndFeelException;
    55
     6import org.openstreetmap.josm.plugins.PluginInformation;
     7
    68import com.jgoodies.looks.plastic.PlasticLookAndFeel;
    79
    810public class Plugin {
    9     public Plugin() throws UnsupportedLookAndFeelException {
     11    public Plugin(PluginInformation info) throws UnsupportedLookAndFeelException {
    1012        UIManager.getDefaults().put("ClassLoader", getClass().getClassLoader());
    1113        UIManager.setLookAndFeel(new PlasticLookAndFeel());
Note: See TracChangeset for help on using the changeset viewer.