Changeset 24999 in osm for applications/editors/josm


Ignore:
Timestamp:
2011-01-08T13:45:42+01:00 (14 years ago)
Author:
upliner
Message:

make wms-turbo-challenge compatible with recent JOSM.

Still works only for WMS layers. Unfortunately, no way to race around Bing imagery yet.

Location:
applications/editors/josm/plugins/wms-turbo-challenge2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wms-turbo-challenge2/.classpath

    r21477 r24999  
    44        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    55        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
    6         <classpathentry combineaccessrules="false" kind="src" path="/wmsplugin"/>
    76        <classpathentry kind="output" path="build"/>
    87</classpath>
  • applications/editors/josm/plugins/wms-turbo-challenge2/build.xml

    r21706 r24999  
    1616    <property name="plugin.dist.dir"        value="../../dist"/>
    1717    <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    18     <property name="wmsplugin"              location="${plugin.dist.dir}/wmsplugin.jar:${user.home}/.josm/plugins/wmsplugin.jar"/>
    1918
    2019    <!--
     
    3433    <target name="compile" depends="init">
    3534        <echo message="compiling sources for  ${plugin.jar} ... "/>
    36         <javac srcdir="src" classpath="${josm}:${wmsplugin}" debug="true" destdir="${plugin.build.dir}">
     35        <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
    3736            <compilerarg value="-Xlint:deprecation"/>
    3837            <compilerarg value="-Xlint:unchecked"/>
     
    6766                <attribute name="Plugin-Icon" value="images/wmsracer.png"/>
    6867                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WMS_Racer"/>
    69                 <attribute name="Plugin-Mainversion" value="3252"/>
     68                <attribute name="Plugin-Mainversion" value="3715"/>
    7069                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    7170            </manifest>
  • applications/editors/josm/plugins/wms-turbo-challenge2/src/wmsturbochallenge/GameWindow.java

    r23190 r24999  
    66package wmsturbochallenge;
    77
    8 import org.openstreetmap.josm.gui.layer.Layer;
    9 import org.openstreetmap.josm.gui.layer.GpxLayer;
    10 import org.openstreetmap.josm.gui.MapView;
     8import java.awt.Color;
     9import java.awt.Graphics;
     10import java.awt.Image;
     11import java.awt.Point;
     12import java.awt.Toolkit;
     13import java.awt.event.ActionEvent;
     14import java.awt.event.ActionListener;
     15import java.awt.event.KeyAdapter;
     16import java.awt.event.KeyEvent;
     17import java.awt.image.BufferedImage;
     18import java.util.ArrayList;
     19import java.util.Arrays;
     20import java.util.Collection;
     21import java.util.HashMap;
     22import java.util.List;
     23
     24import javax.swing.ImageIcon;
     25import javax.swing.JFrame;
     26import javax.swing.JPanel;
     27import javax.swing.Timer;
     28
    1129import org.openstreetmap.josm.Main;
    12 
    1330import org.openstreetmap.josm.data.ProjectionBounds;
    1431import org.openstreetmap.josm.data.coor.EastNorth;
    15 import org.openstreetmap.josm.data.coor.LatLon;
    1632import org.openstreetmap.josm.data.gpx.GpxData;
    17 import org.openstreetmap.josm.data.gpx.GpxTrack;
    1833import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
    1934import org.openstreetmap.josm.data.gpx.WayPoint;
    20 
    21 import java.util.Collection;
    22 import java.util.ArrayList;
    23 import java.util.List;
    24 import java.util.Arrays;
    25 import java.util.HashMap;
    26 
    27 import java.awt.Point;
    28 import java.awt.event.ActionEvent;
    29 import java.awt.event.ActionListener;
    30 import java.awt.event.KeyEvent;
    31 import java.awt.event.KeyAdapter;
    32 import java.awt.Toolkit;
    33 import java.awt.Graphics;
    34 import java.awt.Color;
    35 import java.awt.Image;
    36 import java.awt.image.BufferedImage;
    37 
    38 import javax.swing.JFrame;
    39 import javax.swing.JPanel;
    40 import javax.swing.ImageIcon;
    41 import javax.swing.Timer;
     35import org.openstreetmap.josm.gui.layer.GpxLayer;
     36import org.openstreetmap.josm.gui.layer.Layer;
     37import org.openstreetmap.josm.gui.layer.WMSLayer;
    4238
    4339public class GameWindow extends JFrame implements ActionListener {
     
    110106        }
    111107
     108        @Override
    112109        public void start() {
    113110            super.start();
     
    394391        /* If the layer is a WMS layer, check if any tiles are
    395392         * missing */
    396         if (ground instanceof wmsplugin.WMSLayer) {
    397             wmsplugin.WMSLayer wms = (wmsplugin.WMSLayer) ground;
     393        if (ground instanceof WMSLayer) {
     394            WMSLayer wms = (WMSLayer) ground;
    398395            downloading = wms.hasAutoDownload() && (
    399396                    null == wms.findImage(new EastNorth(
     
    590587        }
    591588
     589        @Override
    592590        public void paint(Graphics g) {
    593591            int w = (int) getSize().getWidth();
     
    639637
    640638    protected class TAdapter extends KeyAdapter {
     639        @Override
    641640        public void keyPressed(KeyEvent e) {
    642641            int key = e.getKeyCode();
     
    682681        }
    683682
     683        @Override
    684684        public void keyReleased(KeyEvent e) {
    685685            int key = e.getKeyCode();
Note: See TracChangeset for help on using the changeset viewer.