Ignore:
Timestamp:
2013-03-29T11:01:50+01:00 (11 years ago)
Author:
malcolmh
Message:

all primitives

Location:
applications/editors/josm/plugins/smed
Files:
6 edited

Legend:

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

    r29351 r29423  
    11<?xml version="1.0" encoding="utf-8"?>
    22<!--
    3 ** This is a template build file for a JOSM  plugin.
    4 **
    5 ** Maintaining versions
    6 ** ====================
    7 ** See README.template
    8 **
    9 ** Usage
    10 ** =====
    11 ** Call "ant help" to get possible build targets.
    12 **
     3***** Please do not update this file!!!! *****
     4** It is an 'oddball' build, therefore the standard template will not work **
    135-->
    14 <project name="SeaMapEditor" default="dist" basedir=".">
     6<project name="SeaMapEditor" basedir=".">
    157    <!-- enter the SVN commit message -->
    168    <property name="commit.message" value="New release"/>
     
    1810    <property name="plugin.main.version" value="4394"/>
    1911    <!-- should not be necessary to change the following properties -->
    20 
    21     <property name="plugin.author" value="Werner, Malcolm"/>
    22     <property name="plugin.class" value="smed.Smed"/>
    23     <property name="plugin.description" value="Create and edit seamaps for OpenSeaMap"/>
    24     <property name="plugin.icon" value="images/Smed.png"/>
    25     <property name="plugin.link" value="http://openseamap.org/"/>
    26 
    27     <!-- ** include targets that all plugins have in common ** -->
    28     <import file="../build-common.xml"/>
    29 
    30     <target name="setup-dist">
    31         <antcall target="setup-dist-default" />
     12    <property name="josm" location="../../core/dist/josm-custom.jar"/>
     13    <property name="plugin.build.dir" value="build/"/>
     14    <property name="plugin.src.dir" value="src/"/>
     15    <property name="smed.dist.dir" value="dist/"/>
     16    <!-- this is the directory where the plugin jar is copied to -->
     17    <property name="plugin.dist.dir" value="../../dist/"/>
     18    <property name="smed_core.dist.dir" value="core/dist/"/>
     19    <property name="ant.build.javac.target" value="1.5"/>
     20    <property name="plugin.jar" value="${plugin.dist.dir}${ant.project.name}.jar"/>
     21    <!--
     22    **********************************************************
     23    ** init - initializes the build
     24    **********************************************************
     25    -->
     26    <target name="init">
     27        <mkdir dir="${plugin.build.dir}"/>
     28        <mkdir dir="${smed_core.dist.dir}"/>
     29        <mkdir dir="${smed.dist.dir}"/>
     30    </target>
     31    <!--
     32    **********************************************************
     33    ** compile - complies the source tree
     34    **********************************************************
     35    -->
     36    <target name="compile" depends="init">
     37        <echo message="compiling sources for  ${plugin.jar} ... "/>
     38        <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
     39            <compilerarg value="-Xlint:deprecation"/>
     40            <compilerarg value="-Xlint:unchecked"/>
     41        </javac>
     42    </target>
     43    <!--
     44    **********************************************************
     45    ** dist - creates the plugin jar
     46    **********************************************************
     47    -->
     48    <target name="dist" depends="compile, revision">
     49        <echo message="creating ${ant.project.name}.jar ... "/>
     50        <copy todir="${plugin.build.dir}/images">
     51            <fileset dir="images"/>
     52        </copy>
     53        <copy todir="${plugin.build.dir}/data">
     54            <fileset dir="data"/>
     55        </copy>
    3256        <copy todir="${plugin.build.dir}/smed/msg">
    3357            <fileset dir="${plugin.src.dir}/smed/msg"/>
    3458        </copy>
    35     </target>
    36 
     59        <copy todir="${plugin.build.dir}">
     60            <fileset dir="${smed.dist.dir}"/>
     61        </copy>
     62        <copy todir="${plugin.build.dir}">
     63            <fileset dir=".">
     64                <include name="*.txt"/>
     65            </fileset>
     66        </copy>
     67        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
     68            <!--
     69        ************************************************
     70        ** configure these properties. Most of them will be copied to the plugins
     71        ** manifest file. Property values will also show up in the list available
     72        ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
     73        **
     74        ************************************************
     75    -->
     76            <manifest>
     77                <attribute name="Author" value="Werner, Malcolm"/>
     78                <attribute name="Plugin-Class" value="smed.Smed"/>
     79                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
     80                <attribute name="Plugin-Description" value="Create and edit seamaps for OpenSeaMap"/>
     81                <attribute name="Plugin-Icon" value="images/Smed.png"/>
     82                <attribute name="Plugin-Link" value="http://openseamap.org/"/>
     83                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
     84                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
     85            </manifest>
     86        </jar>
     87        <!-- install interface -->
     88        <copy file="${plugin.jar}" todir="${smed_core.dist.dir}"/>
     89    </target>
     90    <!--
     91    **********************************************************
     92    ** revision - extracts the current revision number for the
     93    **    file build.number and stores it in the XML property
     94    **    version.*
     95    **********************************************************
     96    -->
     97    <target name="revision">
     98        <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
     99            <env key="LANG" value="C"/>
     100            <arg value="info"/>
     101            <arg value="--xml"/>
     102            <arg value="."/>
     103        </exec>
     104        <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
     105        <delete file="REVISION"/>
     106    </target>
     107    <!--
     108    **********************************************************
     109    ** clean - clean up the build environment
     110    **********************************************************
     111    -->
     112    <target name="clean">
     113        <delete dir="${plugin.build.dir}"/>
     114        <delete dir="${smed_core.dist.dir}"/>
     115        <delete dir="${smed.dist.dir}"/>
     116        <delete file="${plugin.jar}"/>
     117    </target>
     118    <!--
     119    **********************************************************
     120    ** install - install the plugin in your local JOSM installation
     121    **********************************************************
     122    -->
     123    <target name="install" depends="dist">
     124        <property environment="env"/>
     125        <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
     126            <and>
     127                <os family="windows"/>
     128            </and>
     129        </condition>
     130        <delete dir="${josm.plugins.dir}/splug"/>
     131        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
     132    </target>
     133    <!--
     134    ************************** Publishing the plugin ***********************************
     135    -->
     136    <!--
     137    ** extracts the JOSM release for the JOSM version in ../core and saves it in the
     138    ** property ${coreversion.info.entry.revision}
     139    -->
     140    <target name="core-info">
     141        <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
     142            <env key="LANG" value="C"/>
     143            <arg value="info"/>
     144            <arg value="--xml"/>
     145            <arg value="../../core"/>
     146        </exec>
     147        <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
     148        <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
     149        <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
     150        <delete file="core.info.xml"/>
     151    </target>
     152    <!-- commits the source tree for this plugin -->
     153    <target name="commit-current">
     154        <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
     155        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     156            <env key="LANG" value="C"/>
     157            <arg value="commit"/>
     158            <arg value="-m '${commit.message}'"/>
     159            <arg value="."/>
     160        </exec>
     161    </target>
     162    <!-- updates (svn up) the source tree for this plugin -->
     163    <target name="update-current">
     164        <echo>Updating plugin source ...</echo>
     165        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     166            <env key="LANG" value="C"/>
     167            <arg value="up"/>
     168            <arg value="."/>
     169        </exec>
     170        <echo>Updating ${plugin.jar} ...</echo>
     171        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     172            <env key="LANG" value="C"/>
     173            <arg value="up"/>
     174            <arg value="../dist/${plugin.jar}"/>
     175        </exec>
     176    </target>
     177    <!-- commits the plugin.jar -->
     178    <target name="commit-dist">
     179        <echo>
     180    ***** Properties of published ${plugin.jar} *****
     181    Commit message    : '${commit.message}'                   
     182    Plugin-Mainversion: ${plugin.main.version}
     183    JOSM build version: ${coreversion.info.entry.revision}
     184    Plugin-Version    : ${version.entry.commit.revision}
     185    ***** / Properties of published ${plugin.jar} *****                   
     186                       
     187    Now commiting ${plugin.jar} ...
     188    </echo>
     189        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     190            <env key="LANG" value="C"/>
     191            <arg value="-m '${commit.message}'"/>
     192            <arg value="commit"/>
     193            <arg value="${plugin.jar}"/>
     194        </exec>
     195    </target>
     196    <!-- make sure svn is present as a command line tool -->
     197    <target name="ensure-svn-present">
     198        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
     199            <env key="LANG" value="C"/>
     200            <arg value="--version"/>
     201        </exec>
     202        <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
     203            <!-- return code not set at all? Most likely svn isn't installed -->
     204            <condition>
     205                <not>
     206                    <isset property="svn.exit.code"/>
     207                </not>
     208            </condition>
     209        </fail>
     210        <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
     211            <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
     212            <condition>
     213                <isfailure code="${svn.exit.code}"/>
     214            </condition>
     215        </fail>
     216    </target>
     217    <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
     218    </target>
    37219</project>
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java

    r29060 r29423  
    2121        public PanelMain panelMain = null;
    2222
    23         public Node node = null;
     23        public OsmPrimitive node = null;
    2424        private Collection<? extends OsmPrimitive> Selection = null;
    2525
    2626        public SelectionChangedListener SmpListener = new SelectionChangedListener() {
    2727                public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
    28                         Node nextNode = null;
     28                        OsmPrimitive nextNode = null;
    2929                        Selection = newSelection;
    3030
    3131                        for (OsmPrimitive osm : Selection) {
    32                                 if (osm instanceof Node) {
    33                                         nextNode = (Node) osm;
    34                                         if (Selection.size() == 1) {
    35                                                 if (nextNode.compareTo(node) != 0) {
    36                                                         node = nextNode;
    37                                                         panelMain.mark.parseMark(node);
    38                                                 }
    39                                         } else {
    40                                                 node = null;
    41                                                 panelMain.mark.clrMark();
    42                                                 manager.showVisualMessage(Messages.getString("OneNode"));
     32                                nextNode = (OsmPrimitive) osm;
     33                                if (Selection.size() == 1) {
     34                                        if (nextNode.compareTo(node) != 0) {
     35                                                node = nextNode;
     36                                                panelMain.mark.parseMark(node);
    4337                                        }
     38                                } else {
     39                                        node = null;
     40                                        panelMain.mark.clrMark();
     41                                        manager.showVisualMessage(Messages.getString("OneNode"));
    4442                                }
    4543                        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages.properties

    r28457 r29423  
    6565CircleDay=Circular daymark
    6666
    67 SelectNode=Please select a node
    68 OneNode=Please select only one node
    69 NoMark=No seamark recognised at this node
     67SelectNode=Please select a feature
     68OneNode=Please select only one feature
     69NoMark=No seamark recognised on this feature
    7070
    7171NoChar=No character
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_de.properties

    r29031 r29423  
    6565CircleDay=Kreis Tagzeichen
    6666
    67 SelectNode=Bitte einen Knoten auswählen
    68 OneNode=Bitte nur einen Knoten auswählen
    69 NoMark=Knoten nicht als Seezeichen identifiziert
     67SelectNode=Bitte einen Kartenobjekt auswählen
     68OneNode=Bitte nur einen Kartenobjekt auswählen
     69NoMark=Kartenobjekt nicht als Seezeichen identifiziert
    7070
    7171NoChar=Keinen Charakter
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_en.properties

    r28457 r29423  
    6565CircleDay=Circular daymark
    6666
    67 SelectNode=Please select a node
    68 OneNode=Please select only one node
    69 NoMark=No seamark recognised at this node
     67SelectNode=Please select a feature
     68OneNode=Please select only one feature
     69NoMark=No seamark recognised on this feature
    7070
    7171NoChar=No character
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r28881 r29423  
    99
    1010import org.openstreetmap.josm.Main;
    11 import org.openstreetmap.josm.data.osm.Node;
     11import org.openstreetmap.josm.data.osm.*;
    1212import org.openstreetmap.josm.command.ChangePropertyCommand;
    1313
     
    13961396        }
    13971397
    1398         public void parseMark(Node node) {
     1398        public void parseMark(OsmPrimitive node) {
    13991399                dlg.manager.showVisualMessage("");
    14001400                String str = Main.pref.get("smedplugin.IALA");
     
    25362536        }
    25372537
    2538         public void saveSign(Node node) {
     2538        public void saveSign(OsmPrimitive node) {
    25392539               
    25402540                if (getObject() != Obj.UNKOBJ) {
Note: See TracChangeset for help on using the changeset viewer.