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

Adapt to latest josm

Location:
applications/editors/josm/plugins/videomapping
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/videomapping/.classpath

    r21631 r22550  
    55        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
    66        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
    7         <classpathentry kind="lib" path="D:/Projekte/Studium/GeoProjekt/working/VideoMapping/lib/jna.jar"/>
    8         <classpathentry kind="lib" path="D:/Projekte/Studium/GeoProjekt/working/VideoMapping/lib/vlcj-1.1h.jar">
    9                 <attributes>
    10                         <attribute name="javadoc_location" value="jar:file:/D:/Projekte/Studium/GeoProjekt/working/vlcj/vlcj-1.1h-javadoc.jar!/"/>
    11                 </attributes>
    12         </classpathentry>
    13         <classpathentry kind="lib" path="D:/Projekte/Studium/GeoProjekt/working/VideoMapping/lib/log4j.jar"/>
     7        <classpathentry kind="lib" path="lib/jna.jar"/>
     8        <classpathentry kind="lib" path="lib/log4j.jar"/>
     9        <classpathentry kind="lib" path="lib/vlcj-1.1h.jar"/>
    1410        <classpathentry kind="output" path="bin"/>
    1511</classpath>
  • applications/editors/josm/plugins/videomapping/build.xml

    r21706 r22550  
    3333        <property name="commit.message" value="videomapping" />
    3434        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    35         <property name="plugin.main.version" value="1234" />
     35        <property name="plugin.main.version" value="3408" />
    3636
    3737
     
    110110                                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/VideoMapping"/>
    111111                                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
    112                                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>                             
     112                                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    113113                        </manifest>
    114114                        <zipfileset src="lib/vlcj-1.1h.jar" />
     
    165165
    166166        <!--
    167         ************************** Publishing the plugin *********************************** 
     167        ************************** Publishing the plugin ***********************************
    168168        -->
    169169        <!--
    170                 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
     170                ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    171171                ** property ${coreversion.info.entry.revision}
    172172                **
     
    217217
    218218        <!--
    219                 ** commits the plugin.jar 
     219                ** commits the plugin.jar
    220220                -->
    221221        <target name="commit-dist">
    222222                <echo>
    223223        ***** Properties of published ${plugin.jar} *****
    224         Commit message    : '${commit.message}'                                 
     224        Commit message    : '${commit.message}'
    225225        Plugin-Mainversion: ${plugin.main.version}
    226226        JOSM build version: ${coreversion.info.entry.revision}
    227227        Plugin-Version    : ${version.entry.commit.revision}
    228         ***** / Properties of published ${plugin.jar} *****                                     
    229                                                
     228        ***** / Properties of published ${plugin.jar} *****
     229
    230230        Now commiting ${plugin.jar} ...
    231231        </echo>
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java

    r21779 r22550  
    22
    33
    4 import java.sql.Time;
    5 import java.text.DateFormat;
    6 import java.text.SimpleDateFormat;
    7 import java.util.ArrayList;
    8 import java.util.Collection;
    9 import java.util.Date;
    10 import java.util.HashSet;
    11 import java.util.Iterator;
    12 import java.util.LinkedList;
    13 import java.util.List;
    14 import java.util.ListIterator;
    15 import java.util.Set;
    16 import java.util.Timer;
    17 import java.util.TimerTask;
     4import static org.openstreetmap.josm.tools.I18n.tr;
    185
    196import java.awt.Color;
    20 import java.awt.Component;
    217import java.awt.Cursor;
    22 import java.awt.Dimension;
    238import java.awt.Graphics2D;
    249import java.awt.Point;
    2510import java.awt.Rectangle;
    26 import java.awt.event.ActionEvent;
    27 import java.awt.event.KeyEvent;
    28 import java.awt.event.KeyListener;
    2911import java.awt.event.MouseEvent;
    3012import java.awt.event.MouseListener;
    3113import java.awt.event.MouseMotionListener;
    32 
    33 import javax.swing.*;
    34 
    35 import static org.openstreetmap.josm.tools.I18n.*;
     14import java.text.SimpleDateFormat;
     15import java.util.HashSet;
     16import java.util.LinkedList;
     17import java.util.List;
     18import java.util.Set;
     19
     20import javax.swing.Action;
     21import javax.swing.Icon;
     22import javax.swing.ImageIcon;
    3623
    3724import org.openstreetmap.josm.Main;
    38 import org.openstreetmap.josm.actions.InfoAction;
    3925import org.openstreetmap.josm.data.Bounds;
    40 import org.openstreetmap.josm.data.gpx.GpxData;
    4126import org.openstreetmap.josm.data.gpx.WayPoint;
    42 import org.openstreetmap.josm.data.osm.DataSet;
    43 import org.openstreetmap.josm.data.osm.Node;
    4427import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    4528import org.openstreetmap.josm.gui.MapView;
     
    4831import org.openstreetmap.josm.gui.layer.Layer;
    4932import org.openstreetmap.josm.plugins.videomapping.video.GPSVideoPlayer;
    50 import org.openstreetmap.josm.tools.ImageProvider;
    51 import org.openstreetmap.josm.tools.Shortcut;
    52 
    53 import com.sun.jna.StringArray;
    5433
    5534//Basic rendering and GPS layer interaction
     
    6544        private SimpleDateFormat ms;
    6645        private GPSVideoPlayer gps;
    67                
     46
    6847        public PositionLayer(String name, final List<WayPoint> ls) {
    6948                super(name);
     
    7453                ms= new SimpleDateFormat("mm:ss");
    7554                Main.map.mapView.addMouseListener(this);
    76                 Main.map.mapView.addMouseMotionListener(this);                                                 
    77                
     55                Main.map.mapView.addMouseMotionListener(this);
     56
    7857        }
    7958
     
    9473
    9574        @Override
    96         public Component[] getMenuEntries() {
    97         return new Component[]{
    98                 new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)),
    99                 new JMenuItem(LayerListDialog.getInstance().createDeleteLayerAction(this)),
    100                 new JSeparator(),
     75        public Action[] getMenuEntries() {
     76        return new Action[]{
     77                LayerListDialog.getInstance().createShowHideLayerAction(),
     78                LayerListDialog.getInstance().createDeleteLayerAction(),
     79                SeparatorLayerAction.INSTANCE,
    10180                //TODO here my stuff
    102                 new JSeparator(),
    103                 new JMenuItem(new LayerListPopup.InfoAction(this))};//TODO here infos about the linked videos
    104         }
    105          
     81                new LayerListPopup.InfoAction(this)};//TODO here infos about the linked videos
     82        }
     83
    10684
    10785
     
    11997        @Override
    12098        public void mergeFrom(Layer arg0) {
    121                
    122         }
    123 
    124        
    125        
     99
     100        }
     101
     102
     103
    126104        @Override
    127105        //Draw the current position, infos, waypoints
     
    177155                        {
    178156                                p=Main.map.mapView.getPoint(iconPosition.getEastNorth());
    179                                 icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);                         
     157                                icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);
    180158                                g.drawString(mins.format(iconPosition.getTime()),p.x-10,p.y-10);
    181159                        }
     
    185163                        if (player.getCurr()!=null){
    186164                        p=Main.map.mapView.getPoint(player.getCurr().getEastNorth());
    187                         icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);                 
     165                        icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);
    188166                        g.drawString(ms.format(player.getRelativeTime()),p.x-10,p.y-10);
    189167                        }
    190168                }
    191169        }
    192        
     170
    193171        //finds the first waypoint that is nearby the given point
    194172        private WayPoint getNearestWayPoint(Point mouse)
     
    202180                        p = Main.map.mapView.getPoint(n.getEastNorth());
    203181                        if (rect.contains(p))
    204                         {                               
     182                        {
    205183                                return n;
    206184                        }
    207                        
     185
    208186                }
    209187                return null;
    210                
    211         }
    212        
     188
     189        }
     190
    213191        //upper left corner like rectangle
    214192        private Rectangle getIconRect()
     
    225203        }
    226204
    227         public void mouseClicked(MouseEvent e) {               
    228         }
    229 
    230         public void mouseEntered(MouseEvent arg0) {     
     205        public void mouseClicked(MouseEvent e) {
     206        }
     207
     208        public void mouseEntered(MouseEvent arg0) {
    231209        }
    232210
     
    247225                        }
    248226                }
    249                
    250         }
    251        
     227
     228        }
     229
    252230        //
    253         public void mouseReleased(MouseEvent e) {               
     231        public void mouseReleased(MouseEvent e) {
    254232                //only leftclicks on our layer
    255233                if(e.getButton() == MouseEvent.BUTTON1) {
     
    270248                        Main.map.mapView.repaint();
    271249                }
    272                
    273         }
    274        
     250
     251        }
     252
    275253        //slide and restrict during movement
    276         public void mouseDragged(MouseEvent e) {               
     254        public void mouseDragged(MouseEvent e) {
    277255                if(dragIcon)
    278                 {                       
     256                {
    279257                        mouse=e.getPoint();
    280258                        //restrict to GPS track
     
    286264
    287265        //visualize drag&drop
    288         public void mouseMoved(MouseEvent e) {         
     266        public void mouseMoved(MouseEvent e) {
    289267                if (player.getCurr()!=null)
    290                 {                                               
     268                {
    291269                        if (getIconRect().contains(e.getPoint()))
    292270                        {
     
    298276                        }
    299277                }
    300                
     278
    301279        }
    302280
    303281        public void setGPSPlayer(GPSVideoPlayer player) {
    304282                this.gps = player;
    305                
    306         }
    307        
     283
     284        }
     285
    308286        public static void addObserver(PlayerObserver observer) {
    309287
     
    312290    }
    313291
    314  
     292
    315293
    316294    public static void removeObserver(PlayerObserver observer) {
Note: See TracChangeset for help on using the changeset viewer.