Changeset 22549 in osm


Ignore:
Timestamp:
2010-08-03T08:17:26+02:00 (14 years ago)
Author:
jttt
Message:

Adapt to latest josm

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

Legend:

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

    r21706 r22549  
    2424
    2525        <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
    26         <property name="plugin.main.version" value="2830" />
     26        <property name="plugin.main.version" value="3408" />
    2727
    2828        <!--
     
    138138
    139139        <!--
    140                  ************************** Publishing the plugin *********************************** 
    141                 -->
    142         <!--
    143                 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
     140                 ************************** Publishing the plugin ***********************************
     141                -->
     142        <!--
     143                ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    144144                ** property ${coreversion.info.entry.revision}
    145145                **
     
    190190
    191191        <!--
    192                 ** commits the plugin.jar 
     192                ** commits the plugin.jar
    193193                -->
    194194        <target name="commit-dist">
    195195                <echo>
    196196        ***** Properties of published ${plugin.jar} *****
    197         Commit message    : '${commit.message}'                                 
     197        Commit message    : '${commit.message}'
    198198        Plugin-Mainversion: ${plugin.main.version}
    199199        JOSM build version: ${coreversion.info.entry.revision}
    200200        Plugin-Version    : ${version.entry.commit.revision}
    201         ***** / Properties of published ${plugin.jar} *****                                     
    202                                                
     201        ***** / Properties of published ${plugin.jar} *****
     202
    203203        Now commiting ${plugin.jar} ...
    204204        </echo>
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/NewLayerFromClipboardAction.java

    r20217 r22549  
    5151                // Add layer only if successfully initialized
    5252                try {
    53                         layer.Initialize();
     53                        layer.initialize();
    5454                }
    5555                catch (IOException e) {
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/NewLayerFromFileAction.java

    r20217 r22549  
    9191                        // Add layer only if successfully initialized
    9292                        try {
    93                                 layer.Initialize();
     93                                layer.initialize();
    9494                        }
    9595                        catch (IOException e) {
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java

    r20217 r22549  
    2929import java.awt.Image;
    3030import java.awt.Toolkit;
     31import java.awt.event.ActionEvent;
    3132import java.awt.image.BufferedImage;
    3233import java.io.IOException;
     34import java.util.List;
    3335import java.util.Properties;
    3436
     37import javax.swing.AbstractAction;
     38import javax.swing.Action;
    3539import javax.swing.Icon;
    3640import javax.swing.ImageIcon;
    3741import javax.swing.JMenu;
    38 import javax.swing.JMenuItem;
    39 import javax.swing.JSeparator;
    4042
    4143import org.openstreetmap.josm.Main;
     
    6971    // The scale that was set on the map during image creation
    7072    private double m_initial_scale = 0;
    71     // Popup menu items
    72     private Component m_popupmenu[] = null;
    7373    // Layer icon
    7474    private Icon m_layericon = null;
     
    9393        m_counter++;
    9494
    95         // Create popup menu
    96         // Reset submenu
    97         JMenu reset_submenu = new JMenu(tr("Reset"));
    98         reset_submenu.add( new ResetPictureAllAction( this ) );
    99         reset_submenu.addSeparator();
    100         reset_submenu.add( new ResetPicturePositionAction( this ) );
    101         reset_submenu.add( new ResetPictureAngleAction( this ) );
    102         reset_submenu.add( new ResetPictureScaleAction( this ) );
    103         // Main menu
    104         m_popupmenu = new Component[]{
    105                 reset_submenu,
    106                 new JSeparator(),
    107                 new JMenuItem( new SavePictureCalibrationAction(this)),
    108                 new JMenuItem( new LoadPictureCalibrationAction(this)),
    109         };
    110 
    11195        // Load layer icon
    11296        m_layericon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(PicLayerAbstract.class.getResource("/images/layericon.png")));
     
    117101     * initial parameters. Throws exception if something fails.
    118102     */
    119     public void Initialize() throws IOException {
     103    public void initialize() throws IOException {
    120104
    121105        // Create image
     
    165149
    166150    @Override
    167     public Component[] getMenuEntries() {
    168         return m_popupmenu;
     151    public Action[] getMenuEntries() {
     152        // Main menu
     153        return new Action[] {
     154                new ResetSubmenuAction(),
     155                SeparatorLayerAction.INSTANCE,
     156                new SavePictureCalibrationAction(this),
     157                new LoadPictureCalibrationAction(this),
     158        };
    169159    }
    170160
     
    189179    public void paint(Graphics2D g2, MapView mv, Bounds bounds) {
    190180
    191         if ( m_image != null && g2 instanceof Graphics2D) {
     181        if ( m_image != null) {
    192182
    193183            // Position image at the right graphical place
     
    320310            Main.map.mapView.repaint();
    321311    }
     312
     313    private class ResetSubmenuAction extends AbstractAction implements LayerAction {
     314
     315        public ResetSubmenuAction() {
     316                super(tr("Reset"));
     317                }
     318
     319                public void actionPerformed(ActionEvent e) {
     320                }
     321
     322                public Component createMenuComponent() {
     323                        JMenu reset_submenu = new JMenu(this);
     324                reset_submenu.add( new ResetPictureAllAction( PicLayerAbstract.this ) );
     325                reset_submenu.addSeparator();
     326                reset_submenu.add( new ResetPicturePositionAction( PicLayerAbstract.this ) );
     327                reset_submenu.add( new ResetPictureAngleAction( PicLayerAbstract.this ) );
     328                reset_submenu.add( new ResetPictureScaleAction( PicLayerAbstract.this ) );
     329                return reset_submenu;
     330                }
     331
     332                public boolean supportLayers(List<Layer> layers) {
     333                        return layers.size() == 1 && layers.get(0) instanceof PicLayerAbstract;
     334                }
     335
     336    }
    322337}
  • applications/editors/josm/plugins/routes/build.xml

    r20427 r22549  
    2828
    2929        <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
    30         <property name="plugin.main.version" value="3116" />
     30        <property name="plugin.main.version" value="3408" />
    3131
    3232        <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteLayer.java

    r19532 r22549  
    22
    33import java.awt.Color;
    4 import java.awt.Component;
    54import java.awt.Graphics2D;
    65import java.awt.Stroke;
     
    87import java.util.List;
    98
     9import javax.swing.Action;
    1010import javax.swing.Icon;
    1111
     
    7373
    7474        @Override
    75         public Component[] getMenuEntries() {
    76                 return new Component[0];
     75        public Action[] getMenuEntries() {
     76                return new Action[0];
    7777        }
    7878
  • applications/editors/josm/plugins/routing/build.xml

    r21706 r22549  
    1818**
    1919** To build against the core in ../../core, create a correct manifest and deploy to
    20 ** SVN, 
     20** SVN,
    2121**    set the properties commit.message and plugin.main.version
    2222** and run
     
    2828
    2929        <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
    30         <property name="plugin.main.version" value="2830" />
     30        <property name="plugin.main.version" value="3408" />
    3131
    3232        <!-- Define some properties -->
     
    106106
    107107        <!--
    108                  ************************** Publishing the plugin *********************************** 
    109                 -->
    110         <!--
    111                 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
     108                 ************************** Publishing the plugin ***********************************
     109                -->
     110        <!--
     111                ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    112112                ** property ${coreversion.info.entry.revision}
    113113                **
     
    158158
    159159        <!--
    160                 ** commits the plugin.jar 
     160                ** commits the plugin.jar
    161161                -->
    162162        <target name="commit-dist">
    163163                <echo>
    164164        ***** Properties of published ${plugin.jar} *****
    165         Commit message    : '${commit.message}'                                 
     165        Commit message    : '${commit.message}'
    166166        Plugin-Mainversion: ${plugin.main.version}
    167167        JOSM build version: ${coreversion.info.entry.revision}
    168168        Plugin-Version    : ${version.entry.commit.revision}
    169         ***** / Properties of published ${plugin.jar} *****                                     
    170                                                
     169        ***** / Properties of published ${plugin.jar} *****
     170
    171171        Now commiting ${plugin.jar} ...
    172172        </echo>
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java

    r18962 r22549  
    3030import java.awt.BasicStroke;
    3131import java.awt.Color;
    32 import java.awt.Component;
    3332import java.awt.Graphics;
    3433import java.awt.Graphics2D;
     
    3938import java.util.List;
    4039
     40import javax.swing.Action;
    4141import javax.swing.Icon;
    42 import javax.swing.JMenuItem;
    43 import javax.swing.JSeparator;
    4442
    4543import org.apache.log4j.Logger;
     
    182180     */
    183181    @Override
    184     public Component[] getMenuEntries() {
    185         Collection<Component> components = new ArrayList<Component>();
    186         components.add(new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)));
     182    public Action[] getMenuEntries() {
     183        Collection<Action> components = new ArrayList<Action>();
     184        components.add(LayerListDialog.getInstance().createShowHideLayerAction());
    187185//        components.add(new JMenuItem(new LayerListDialog.ShowHideMarkerText(this)));
    188         components.add(new JMenuItem(LayerListDialog.getInstance().createDeleteLayerAction(this)));
    189         components.add(new JSeparator());
    190         components.add(new JMenuItem(new RenameLayerAction(getAssociatedFile(), this)));
    191         components.add(new JSeparator());
    192         components.add(new JMenuItem(new LayerListPopup.InfoAction(this)));
    193         return components.toArray(new Component[0]);
     186        components.add(LayerListDialog.getInstance().createDeleteLayerAction());
     187        components.add(SeparatorLayerAction.INSTANCE);
     188        components.add(new RenameLayerAction(getAssociatedFile(), this));
     189        components.add(SeparatorLayerAction.INSTANCE);
     190        components.add(new LayerListPopup.InfoAction(this));
     191        return components.toArray(new Action[0]);
    194192    }
    195193
  • applications/editors/josm/plugins/walkingpapers/build.xml

    r21706 r22549  
    1414**
    1515** To build against the core in ../../core, create a correct manifest and deploy to
    16 ** SVN, 
     16** SVN,
    1717**    set the properties commit.message and plugin.main.version
    1818** and run
     
    2323<project name="walkingpapers" default="dist" basedir=".">
    2424
    25         <!-- 
    26         ** update before publishing 
     25        <!--
     26        ** update before publishing
    2727        -->
    2828        <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
    29         <property name="plugin.main.version" value="2830" />
     29        <property name="plugin.main.version" value="3408" />
    3030
    31        
     31
    3232        <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
    3333        <property name="plugin.dist.dir"        value="../../dist"/>
     
    8787
    8888        <!--
    89                  ************************** Publishing the plugin *********************************** 
     89                 ************************** Publishing the plugin ***********************************
    9090                -->
    9191        <!--
    92                 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
     92                ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    9393                ** property ${coreversion.info.entry.revision}
    9494                **
     
    139139
    140140        <!--
    141                 ** commits the plugin.jar 
     141                ** commits the plugin.jar
    142142                -->
    143143        <target name="commit-dist">
    144144                <echo>
    145145        ***** Properties of published ${plugin.jar} *****
    146         Commit message    : '${commit.message}'                                 
     146        Commit message    : '${commit.message}'
    147147        Plugin-Mainversion: ${plugin.main.version}
    148148        JOSM build version: ${coreversion.info.entry.revision}
    149149        Plugin-Version    : ${version.entry.commit.revision}
    150         ***** / Properties of published ${plugin.jar} *****                                     
    151                                                
     150        ***** / Properties of published ${plugin.jar} *****
     151
    152152        Now commiting ${plugin.jar} ...
    153153        </echo>
  • applications/editors/josm/plugins/walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersLayer.java

    r19074 r22549  
    44
    55import java.awt.Color;
    6 import java.awt.Component;
    76import java.awt.Graphics2D;
    87import java.awt.Image;
     
    1413import java.util.TreeSet;
    1514
     15import javax.swing.Action;
    1616import javax.swing.Icon;
    17 import javax.swing.JMenuItem;
    18 import javax.swing.JSeparator;
    1917
    2018import org.openstreetmap.josm.Main;
     
    119117        }
    120118
    121         class TileTimeComp implements Comparator<WalkingPapersTile> {
     119        static class TileTimeComp implements Comparator<WalkingPapersTile> {
    122120                public int compare(WalkingPapersTile s1, WalkingPapersTile s2) {
    123121                        long t1 = s1.access_time();
     
    349347
    350348        @Override
    351         public Component[] getMenuEntries() {
    352                 return new Component[] {
    353                                 new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)),
    354                                 new JMenuItem(LayerListDialog.getInstance().createDeleteLayerAction(this)),
    355                                 new JSeparator(),
     349        public Action[] getMenuEntries() {
     350                return new Action[] {
     351                                LayerListDialog.getInstance().createShowHideLayerAction(),
     352                                LayerListDialog.getInstance().createDeleteLayerAction(),
     353                                SeparatorLayerAction.INSTANCE,
    356354                                // color,
    357355                                // new JMenuItem(new RenameLayerAction(associatedFile, this)),
    358                                 new JSeparator(),
    359                                 new JMenuItem(new LayerListPopup.InfoAction(this)) };
     356                                SeparatorLayerAction.INSTANCE,
     357                                new LayerListPopup.InfoAction(this) };
    360358        }
    361359
Note: See TracChangeset for help on using the changeset viewer.