Changeset 18404 in osm


Ignore:
Timestamp:
2009-11-01T13:19:59+01:00 (15 years ago)
Author:
stoecker
Message:

updated some stuff to current JOSM

Location:
applications/editors/josm/plugins
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/build.xml

    r18289 r18404  
    2626                <attribute name="Plugin-Description" value="A special handler for the French land registry WMS server."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/FR:JOSM/Fr:Plugin/Cadastre"/>
    28                 <attribute name="Plugin-Mainversion" value="2012"/>
    29                 <attribute name="Plugin-Stage" value="2327"/>
     28                <attribute name="Plugin-Mainversion" value="2327"/>
     29                <attribute name="Plugin-Stage" value="60"/>
    3030                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3131            </manifest>
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r18314 r18404  
    22
    33import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    4 import static org.openstreetmap.josm.tools.I18n.marktr;
    54import static org.openstreetmap.josm.tools.I18n.tr;
    65
     
    134133
    135134        if (cadastreJMenu == null) {
    136             cadastreJMenu = menu.addMenu(marktr("Cadastre"), KeyEvent.VK_C, menu.defaultMenuPos, ht("/Menu/Cadastre"));
     135            cadastreJMenu = menu.addMenu(tr("Cadastre"), KeyEvent.VK_C, menu.defaultMenuPos, ht("/Plugin/CadastreFr"));
    137136            JosmAction grab = new MenuActionGrab();
    138137            JMenuItem menuGrab = new JMenuItem(grab);
  • applications/editors/josm/plugins/czechaddress/build.xml

    r17603 r18404  
    5252            <attribute name="Plugin-Description" value="Creating and handling address nodes and buildings within Czech Republic."/>
    5353            <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/Cz:JOSM/Plugins/CzechAddress"/>
    54             <attribute name="Plugin-Mainversion" value="2093"/>
     54            <attribute name="Plugin-Mainversion" value="2323"/>
    5555            <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    5656        </manifest>
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/CzechAddressPlugin.java

    r16750 r18404  
    11package org.openstreetmap.josm.plugins.czechaddress;
     2
     3import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    24
    35import java.awt.event.KeyEvent;
     
    184186    public void pluginStatusChanged(int message) {
    185187        if (message == MESSAGE_DATABASE_LOADED) {
    186             czechMenu = Main.main.menu.addMenu("Adresy", KeyEvent.VK_A, 4);
     188            czechMenu = Main.main.menu.addMenu("Adresy", KeyEvent.VK_A, 4, ht("/Plugin/CzechAddress"));
    187189            menuItems.add(MainMenu.add(czechMenu, new PointManipulatorAction()));
    188190            menuItems.add(MainMenu.add(czechMenu, new GroupManipulatorAction()));
  • applications/editors/josm/plugins/livegps/build.xml

    r16945 r18404  
    2626                <attribute name="Plugin-Description" value="Support live GPS input (moving dot) through a connection to gpsd server."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/LiveGPS"/>
    28                 <attribute name="Plugin-Mainversion" value="1890"/>
     28                <attribute name="Plugin-Mainversion" value="2323"/>
    2929                <attribute name="Plugin-Stage" value="50"/>
    3030                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
  • applications/editors/josm/plugins/livegps/src/livegps/LiveGpsPlugin.java

    r16945 r18404  
    11package livegps;
    22
    3 import static org.openstreetmap.josm.tools.I18n.marktr;
     3import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     
    9898    {
    9999        MainMenu menu = Main.main.menu;
    100         lgpsmenu = menu.addMenu(marktr("LiveGPS"), KeyEvent.VK_G, menu.defaultMenuPos);
     100        lgpsmenu = menu.addMenu(tr("LiveGPS"), KeyEvent.VK_G, menu.defaultMenuPos, ht("/Plugin/LiveGPS"));
    101101
    102102        JosmAction captureAction = new CaptureAction();
  • applications/editors/josm/plugins/piclayer/build.xml

    r17323 r18404  
    8181                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    8282                <attribute name="Plugin-Description" value="This plugin allows to display any picture as a background in the editor and align it with the map."/>
    83                 <attribute name="Plugin-Mainversion" value="1728"/>
     83                <attribute name="Plugin-Mainversion" value="2323"/>
    8484                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    8585            </manifest>
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java

    r17321 r18404  
    2121package org.openstreetmap.josm.plugins.piclayer;
    2222
     23import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
     24import static org.openstreetmap.josm.tools.I18n.tr;
     25
    2326import java.awt.event.KeyEvent;
    2427import javax.swing.JMenu;
     
    3538 */
    3639public class PicLayerPlugin extends Plugin implements LayerChangeListener {
    37        
    38         // Plugin menu
    39         private JMenu m_menu = null;
    40        
    41         // Toolbar buttons
    42         private IconToggleButton m_movePictureButton = null;
    43         private IconToggleButton m_rotatePictureButton = null;
    44         private IconToggleButton m_scalexPictureButton = null;
    45         private IconToggleButton m_scaleyPictureButton = null;
    46         private IconToggleButton m_scalexyPictureButton = null;
    47        
    48         // Menu actions
    49         private NewLayerFromFileAction          m_newFromFileAction = null; 
    50         private NewLayerFromClipboardAction m_newFromClipAction = null;
    5140
    52         /**
    53          * Constructor...
    54          */
    55         public PicLayerPlugin() {
    56                
    57                 // Create menu entry
    58                 if ( Main.main.menu != null ) {
    59                         m_menu = Main.main.menu.addMenu( "PicLayer" , KeyEvent.VK_I, Main.main.menu.defaultMenuPos );
    60                 }
    61                
    62                 // Add menu items
    63                 if ( m_menu != null ) {
    64                         m_menu.add( m_newFromFileAction = new NewLayerFromFileAction() );
    65                         m_menu.add( m_newFromClipAction = new NewLayerFromClipboardAction() );
    66                         m_menu.addSeparator();
    67                         m_menu.add( new HelpAction() );
    68                         m_newFromFileAction.setEnabled( false );
    69                         m_newFromClipAction.setEnabled( false );
    70                 }
    71                
    72                 // Listen to layers
    73                 Layer.listeners.add( this );
    74                
    75         }
    76        
     41    // Plugin menu
     42    private JMenu m_menu = null;
     43
     44    // Toolbar buttons
     45    private IconToggleButton m_movePictureButton = null;
     46    private IconToggleButton m_rotatePictureButton = null;
     47    private IconToggleButton m_scalexPictureButton = null;
     48    private IconToggleButton m_scaleyPictureButton = null;
     49    private IconToggleButton m_scalexyPictureButton = null;
     50
     51    // Menu actions
     52    private NewLayerFromFileAction      m_newFromFileAction = null;
     53    private NewLayerFromClipboardAction m_newFromClipAction = null;
     54
     55    /**
     56     * Constructor...
     57     */
     58    public PicLayerPlugin() {
     59
     60        // Create menu entry
     61        if ( Main.main.menu != null ) {
     62            m_menu = Main.main.menu.addMenu(tr("PicLayer") , KeyEvent.VK_I, Main.main.menu.defaultMenuPos, ht("/Plugin/PicLayer"));
     63        }
     64
     65        // Add menu items
     66        if ( m_menu != null ) {
     67            m_menu.add( m_newFromFileAction = new NewLayerFromFileAction() );
     68            m_menu.add( m_newFromClipAction = new NewLayerFromClipboardAction() );
     69            m_menu.addSeparator();
     70            m_menu.add( new HelpAction() );
     71            m_newFromFileAction.setEnabled( false );
     72            m_newFromClipAction.setEnabled( false );
     73        }
     74
     75        // Listen to layers
     76        Layer.listeners.add( this );
     77
     78    }
     79
    7780    /**
    7881     * Called when the map is created. Creates the toolbar buttons.
     
    8083    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    8184        if(newFrame != null) {
    82                 // Create plugin map modes
    83                 MovePictureAction movePictureAction = new MovePictureAction(newFrame);
    84                 RotatePictureAction rotatePictureAction = new RotatePictureAction(newFrame);
    85                 ScaleXYPictureAction scaleXYPictureAction = new ScaleXYPictureAction(newFrame);
    86                 ScaleXPictureAction scaleXPictureAction = new ScaleXPictureAction(newFrame);
    87                 ScaleYPictureAction scaleYPictureAction = new ScaleYPictureAction(newFrame);
    88                 // Create plugin buttons and add them to the toolbar
    89                 m_movePictureButton = new IconToggleButton(movePictureAction);
     85            // Create plugin map modes
     86            MovePictureAction movePictureAction = new MovePictureAction(newFrame);
     87            RotatePictureAction rotatePictureAction = new RotatePictureAction(newFrame);
     88            ScaleXYPictureAction scaleXYPictureAction = new ScaleXYPictureAction(newFrame);
     89            ScaleXPictureAction scaleXPictureAction = new ScaleXPictureAction(newFrame);
     90            ScaleYPictureAction scaleYPictureAction = new ScaleYPictureAction(newFrame);
     91            // Create plugin buttons and add them to the toolbar
     92            m_movePictureButton = new IconToggleButton(movePictureAction);
    9093            m_rotatePictureButton = new IconToggleButton(rotatePictureAction);
    9194            m_scalexyPictureButton = new IconToggleButton(scaleXYPictureAction);
     
    109112    }
    110113
    111         /**
    112         * The toolbar buttons shall be active only when the PicLayer is active.
    113         */
    114         public void activeLayerChange(Layer oldLayer, Layer newLayer) {
    115         }
     114    /**
     115    * The toolbar buttons shall be active only when the PicLayer is active.
     116    */
     117    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
     118    }
    116119
    117         /**
    118         * The menu is enabled once another layer is first created. This is needed
    119         * because the picture must be positioned based on the current mapview (so
    120         * one must exist first). User should not be able to load a picture too early.
    121         */
    122         public void layerAdded(Layer arg0) {
    123                 m_newFromFileAction.setEnabled( true );
    124                 m_newFromClipAction.setEnabled( true );
    125         }
     120    /**
     121    * The menu is enabled once another layer is first created. This is needed
     122    * because the picture must be positioned based on the current mapview (so
     123    * one must exist first). User should not be able to load a picture too early.
     124    */
     125    public void layerAdded(Layer arg0) {
     126        m_newFromFileAction.setEnabled( true );
     127        m_newFromClipAction.setEnabled( true );
     128    }
    126129
    127         /**
    128          * When all layers are gone - the menu is gone too.
    129          */
    130         public void layerRemoved(Layer arg0) {
    131                 boolean enable = Main.map.mapView.getAllLayers().size() != 0;
    132                 m_newFromFileAction.setEnabled( enable );
    133                 m_newFromClipAction.setEnabled( enable );
    134         }       
    135        
     130    /**
     131     * When all layers are gone - the menu is gone too.
     132     */
     133    public void layerRemoved(Layer arg0) {
     134        boolean enable = Main.map.mapView.getAllLayers().size() != 0;
     135        m_newFromFileAction.setEnabled( enable );
     136        m_newFromClipAction.setEnabled( enable );
     137    }
    136138};
  • applications/editors/josm/plugins/routing/build.xml

    r17544 r18404  
    4444                <attribute name="Plugin-Description" value="Provides routing capabilities."/>
    4545                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Routing"/>
    46                 <attribute name="Plugin-Mainversion" value="2082"/>
     46                <attribute name="Plugin-Mainversion" value="2323"/>
    4747                <attribute name="Plugin-Stage" value="50"/>
    4848                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java

    r16799 r18404  
    137137        layers = new ArrayList<RoutingLayer>();
    138138        // Add menu
    139         menu = new RoutingMenu(marktr("Routing"));
     139        menu = new RoutingMenu();
    140140        // Register this class as LayerChangeListener
    141141        Layer.listeners.add(this);
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingMenu.java

    r15710 r18404  
    2828package com.innovant.josm.plugin.routing.gui;
    2929
     30import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    3031import static org.openstreetmap.josm.tools.I18n.tr;
    3132
     
    7172     * @param s
    7273     */
    73     public RoutingMenu(final String name) {
     74    public RoutingMenu() {
    7475        MainMenu mm = Main.main.menu;
    75         menu = mm.addMenu(name, KeyEvent.VK_O, mm.defaultMenuPos);
     76        menu = mm.addMenu(tr("Routing"), KeyEvent.VK_O, mm.defaultMenuPos, ht("/Plugin/Routing"));
    7677
    7778        startMI = new JMenuItem(tr("Add routing layer"));
  • applications/editors/josm/plugins/walkingpapers/build.xml

    r17822 r18404  
    2626                <attribute name="Plugin-Description" value="Supports downloading tiled, scanned maps from walking-papers.org. This plugin is still under early development and may be buggy."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/WalkingPapers"/>
    28                 <attribute name="Plugin-Mainversion" value="2196"/>
     28                <attribute name="Plugin-Mainversion" value="2323"/>
    2929                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3030            </manifest>
  • applications/editors/josm/plugins/walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersPlugin.java

    r18198 r18404  
    11package org.openstreetmap.josm.plugins.walkingpapers;
    22
     3import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    34import static org.openstreetmap.josm.tools.I18n.tr;
    45
     
    2021public class WalkingPapersPlugin extends Plugin
    2122{
    22         static JMenu walkingPapersMenu;
    23        
     23    static JMenu walkingPapersMenu;
     24
    2425    public WalkingPapersPlugin()
    2526    {
    2627        MainMenu menu = Main.main.menu;
    27         walkingPapersMenu = menu.addMenu(tr("Walking Papers"), KeyEvent.VK_K, menu.defaultMenuPos);
     28        walkingPapersMenu = menu.addMenu(tr("Walking Papers"), KeyEvent.VK_K, menu.defaultMenuPos, ht("/Plugin/WalkingPapers"));
    2829        walkingPapersMenu.add(new JMenuItem(new WalkingPapersAddLayerAction()));
    2930    }
    30 
    3131}
  • applications/editors/josm/plugins/wmsplugin/build.xml

    r17817 r18404  
    1818** To build against the core in ../../core, create a correct manifest and deploy to
    1919** SVN, run
    20 **    - set the property commit.message 
     20**    - set the property commit.message
    2121**    - set the property josm.reference.release to lowest JOSM release number this
    2222**      plugin build is compatible with
     
    3232    <property name="ant.build.javac.target" value="1.5"/>
    3333        <property name="commit.message"         value="fixing JOSM issue #3186" />
    34         <property name="josm.reference.release" value="2196" />
    35        
     34        <property name="josm.reference.release" value="2323" />
     35
    3636    <target name="init">
    3737        <mkdir dir="${plugin.build.dir}"/>
     
    8585        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    8686    </target>
    87        
     87
    8888        <target name="core-info">
    8989                <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
     
    9898                </target>
    9999
    100                
     100
    101101                <target name="commit-current">
    102102                        <echo>Commiting the plugin source ...</echo>
     
    106106                                    <arg value="-m &quot;${commit.message}&quot;"/>
    107107                                    <arg value="."/>
    108                     </exec>         
     108                    </exec>
    109109                </target>
    110110
    111                
     111
    112112                <target name="update-current">
    113113                        <echo>Updating basedir ...</echo>
     
    116116                                    <arg value="up"/>
    117117                                    <arg value="."/>
    118                     </exec>         
     118                    </exec>
    119119                        <echo>Updating ${plugin.jar} ...</echo>
    120120                    <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     
    122122                                    <arg value="up"/>
    123123                                    <arg value="${plugin.jar}"/>
    124                     </exec>         
     124                    </exec>
    125125                </target>
    126                
     126
    127127                <target name="commit-dist">
    128128                                <echo>Commiting ${plugin.jar} ...</echo>
     
    132132                                                <arg value="-m &quot;${commit.message}&quot;"/>
    133133                                            <arg value="${plugin.jar}"/>
    134                             </exec>         
     134                            </exec>
    135135                </target>
    136                
     136
    137137                <target name="deploy" depends="core-info,commit-current,update-current,clean,dist,commit-dist">
    138138                </target>
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java

    r17556 r18404  
    11package wmsplugin;
    22
    3 import static org.openstreetmap.josm.tools.I18n.marktr;
     3import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     
    5151    static int overlapEast = 14;
    5252    static int overlapNorth = 4;
    53    
     53
    5454    // remember state of menu item to restore on changed preferences
    5555    static private boolean menuEnabled = false;
    56    
     56
    5757    protected void initExporterAndImporter() {
    5858        ExtensionFileFilter.exporters.add(new WMSLayerExporter());
     
    9494        TreeSet<String> keys = new TreeSet<String>(prefs.keySet());
    9595
    96         // Here we load the settings for "overlap" checkbox and spinboxes. 
    97          
    98         try { 
    99             doOverlap = Boolean.valueOf(prefs.get("wmsplugin.url.overlap"));             
    100         } catch (Exception e) {} // If sth fails, we drop to default settings. 
    101  
    102         try { 
    103             overlapEast = Integer.valueOf(prefs.get("wmsplugin.url.overlapEast"));             
    104         } catch (Exception e) {} // If sth fails, we drop to default settings. 
    105  
    106         try { 
    107             overlapNorth = Integer.valueOf(prefs.get("wmsplugin.url.overlapNorth"));             
    108         } catch (Exception e) {} // If sth fails, we drop to default settings. 
     96        // Here we load the settings for "overlap" checkbox and spinboxes.
     97
     98        try {
     99            doOverlap = Boolean.valueOf(prefs.get("wmsplugin.url.overlap"));
     100        } catch (Exception e) {} // If sth fails, we drop to default settings.
     101
     102        try {
     103            overlapEast = Integer.valueOf(prefs.get("wmsplugin.url.overlapEast"));
     104        } catch (Exception e) {} // If sth fails, we drop to default settings.
     105
     106        try {
     107            overlapNorth = Integer.valueOf(prefs.get("wmsplugin.url.overlapNorth"));
     108        } catch (Exception e) {} // If sth fails, we drop to default settings.
    109109
    110110        // And then the names+urls of WMS servers
     
    169169
    170170        if (wmsJMenu == null)
    171             wmsJMenu = menu.addMenu(marktr("WMS"), KeyEvent.VK_W, menu.defaultMenuPos);
     171            wmsJMenu = menu.addMenu(tr("WMS"), KeyEvent.VK_W, menu.defaultMenuPos, ht("/Plugin/WMS"));
    172172        else
    173173            wmsJMenu.removeAll();
Note: See TracChangeset for help on using the changeset viewer.