Ignore:
Timestamp:
2010-08-19T08:44:44+02:00 (14 years ago)
Author:
guardian
Message:

(including last commit)
newest versions vlc, subtitle support, several fixes

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

Legend:

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

    r22550 r22691  
    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="lib/jna.jar"/>
    8         <classpathentry kind="lib" path="lib/log4j.jar"/>
    9         <classpathentry kind="lib" path="lib/vlcj-1.1h.jar"/>
     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.1.2.jar">
     9                <attributes>
     10                        <attribute name="javadoc_location" value="jar:file:/D:/Projekte/Studium/GeoProjekt/working/vlcj/vlcj-1.1.2.jar!/"/>
     11                </attributes>
     12        </classpathentry>
     13        <classpathentry kind="lib" path="D:/Projekte/Studium/GeoProjekt/working/VideoMapping/lib/log4j.jar"/>
    1014        <classpathentry kind="output" path="bin"/>
    1115</classpath>
  • applications/editors/josm/plugins/videomapping/build.xml

    r22550 r22691  
    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="3408" />
     35        <property name="plugin.main.version" value="1234" />
    3636
    3737
     
    4040      ** should not be necessary to change the following properties
    4141     -->
    42         <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
     42        <property name="josm"                   location="../JOSM/dist/josm-custom.jar"/> <!-- patched for my own workbench, will fix if I understand how you have to setup it right-->
    4343        <property name="plugin.build.dir"       value="build"/>
    4444        <property name="plugin.src.dir"         value="src"/>
    4545        <!-- this is the directory where the plugin jar is copied to -->
    46         <property name="plugin.dist.dir"        value="../../dist"/>
     46        <property name="plugin.dist.dir"        value="../JOSM/dist"/>
    4747        <property name="ant.build.javac.target" value="1.5"/>
    4848        <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
     49        <property name="vlcj"                  value="lib/vlcj-1.1.2.jar"/>
     50        <property name="jna"                  value="lib/jna.jar"/>
     51        <property name="log4j"                  value="lib/log4j.jar"/>
    4952        <!--
    5053    **********************************************************
     
    6669                        <compilerarg value="-Xlint:deprecation"/>
    6770                        <compilerarg value="-Xlint:unchecked"/>
    68                         <classpath>
    69                                 <fileset dir="lib">
    70                                         <include name="**/*.jar"/>
    71                                 </fileset>
    72                         </classpath>
     71                        <classpath>
     72                                <pathelement location="${vlcj}"/> <!--Add external library -->
     73                                <pathelement location="${jna}"/>
     74                                <pathelement location="${log4j}"/>
     75                        </classpath>
    7376                </javac>
    7477        </target>
     
    107110                                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    108111                                <attribute name="Plugin-Description" value="(This Plugin is currently work in progress!!!) Links and syncs a georeferenced video against a GPS track, to use it for identify visible objects."/>
    109                                 <attribute name="Plugin-Icon" value="images/videomapping.png"/>
    110112                                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/VideoMapping"/>
    111113                                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
    112                                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
     114                                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>                             
    113115                        </manifest>
    114                         <zipfileset src="lib/vlcj-1.1h.jar" />
    115                         <zipfileset src="lib/log4j.jar" />
    116                         <zipfileset src="lib/jna.jar" />
    117                         <zipfileset src="lib/platform.jar" />
    118116                </jar>
    119117        </target>
     
    165163
    166164        <!--
    167         ************************** Publishing the plugin ***********************************
     165        ************************** Publishing the plugin *********************************** 
    168166        -->
    169167        <!--
    170                 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
     168                ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
    171169                ** property ${coreversion.info.entry.revision}
    172170                **
     
    217215
    218216        <!--
    219                 ** commits the plugin.jar
     217                ** commits the plugin.jar 
    220218                -->
    221219        <target name="commit-dist">
    222220                <echo>
    223221        ***** Properties of published ${plugin.jar} *****
    224         Commit message    : '${commit.message}'
     222        Commit message    : '${commit.message}'                                 
    225223        Plugin-Mainversion: ${plugin.main.version}
    226224        JOSM build version: ${coreversion.info.entry.revision}
    227225        Plugin-Version    : ${version.entry.commit.revision}
    228         ***** / Properties of published ${plugin.jar} *****
    229 
     226        ***** / Properties of published ${plugin.jar} *****                                     
     227                                               
    230228        Now commiting ${plugin.jar} ...
    231229        </echo>
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java

    r22690 r22691  
    22
    33
    4 import static org.openstreetmap.josm.tools.I18n.tr;
     4import java.sql.Time;
     5import java.text.DateFormat;
     6import java.text.SimpleDateFormat;
     7import java.util.ArrayList;
     8import java.util.Collection;
     9import java.util.Date;
     10import java.util.HashSet;
     11import java.util.Iterator;
     12import java.util.LinkedList;
     13import java.util.List;
     14import java.util.ListIterator;
     15import java.util.Set;
     16import java.util.Timer;
     17import java.util.TimerTask;
    518
    619import java.awt.Color;
     20import java.awt.Component;
    721import java.awt.Cursor;
     22import java.awt.Dimension;
    823import java.awt.Graphics2D;
    924import java.awt.Point;
    1025import java.awt.Rectangle;
     26import java.awt.event.ActionEvent;
     27import java.awt.event.KeyEvent;
     28import java.awt.event.KeyListener;
    1129import java.awt.event.MouseEvent;
    1230import java.awt.event.MouseListener;
    1331import java.awt.event.MouseMotionListener;
    14 import java.text.SimpleDateFormat;
    15 import java.util.HashSet;
    16 import java.util.LinkedList;
    17 import java.util.List;
    18 import java.util.Set;
    19 
    20 import javax.swing.Action;
    21 import javax.swing.Icon;
    22 import javax.swing.ImageIcon;
     32
     33import javax.swing.*;
     34
     35import static org.openstreetmap.josm.tools.I18n.*;
    2336
    2437import org.openstreetmap.josm.Main;
     38import org.openstreetmap.josm.actions.InfoAction;
    2539import org.openstreetmap.josm.data.Bounds;
     40import org.openstreetmap.josm.data.gpx.GpxData;
    2641import org.openstreetmap.josm.data.gpx.WayPoint;
     42import org.openstreetmap.josm.data.osm.DataSet;
     43import org.openstreetmap.josm.data.osm.Node;
    2744import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    2845import org.openstreetmap.josm.gui.MapView;
     
    3148import org.openstreetmap.josm.gui.layer.Layer;
    3249import org.openstreetmap.josm.plugins.videomapping.video.GPSVideoPlayer;
     50import org.openstreetmap.josm.tools.ImageProvider;
     51import org.openstreetmap.josm.tools.Shortcut;
     52
     53import com.sun.jna.StringArray;
    3354
    3455//Basic rendering and GPS layer interaction
     
    4566        private SimpleDateFormat gpsTimeCode;
    4667        private GPSVideoPlayer gps;
    47 
     68               
    4869        public PositionLayer(String name, final List<WayPoint> ls) {
    4970                super(name);
     
    5576                gpsTimeCode= new SimpleDateFormat("hh:mm:ss");
    5677                Main.map.mapView.addMouseListener(this);
    57                 Main.map.mapView.addMouseMotionListener(this);
    58 
     78                Main.map.mapView.addMouseMotionListener(this);                                                 
     79               
    5980        }
    6081
     
    7596
    7697        @Override
    77         public Action[] getMenuEntries() {
    78         return new Action[]{
    79                 LayerListDialog.getInstance().createShowHideLayerAction(),
    80                 LayerListDialog.getInstance().createDeleteLayerAction(),
    81                 SeparatorLayerAction.INSTANCE,
     98        public Component[] getMenuEntries() {
     99        return new Component[]{
     100                new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)),
     101                new JMenuItem(LayerListDialog.getInstance().createDeleteLayerAction(this)),
     102                new JSeparator(),
    82103                //TODO here my stuff
    83                 new LayerListPopup.InfoAction(this)};//TODO here infos about the linked videos
    84         }
    85 
     104                new JSeparator(),
     105                new JMenuItem(new LayerListPopup.InfoAction(this))};//TODO here infos about the linked videos
     106        }
     107         
    86108
    87109
     
    99121        @Override
    100122        public void mergeFrom(Layer arg0) {
    101 
    102         }
    103 
    104 
    105 
     123               
     124        }
     125
     126       
     127       
    106128        @Override
    107129        //Draw the current position, infos, waypoints
     
    157179                        {
    158180                                p=Main.map.mapView.getPoint(iconPosition.getEastNorth());
    159                                 icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);
     181                                icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);                         
    160182                                //g.drawString(mins.format(iconPosition.getTime()),p.x-10,p.y-10); //TODO when synced we might wan't to use a different layout
    161183                                g.drawString(gpsTimeCode.format(iconPosition.getTime()),p.x-10,p.y-10);
     
    166188                        if (player.getCurr()!=null){
    167189                        p=Main.map.mapView.getPoint(player.getCurr().getEastNorth());
    168                         icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);
     190                        icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);                 
    169191                        g.drawString(gpsTimeCode.format(player.getCurr().getTime()),p.x-10,p.y-10);
    170192                        }
    171193                }
    172194        }
    173 
     195       
    174196        //finds the first waypoint that is nearby the given point
    175197        private WayPoint getNearestWayPoint(Point mouse)
     
    183205                        p = Main.map.mapView.getPoint(n.getEastNorth());
    184206                        if (rect.contains(p))
    185                         {
     207                        {                               
    186208                                return n;
    187209                        }
    188 
     210                       
    189211                }
    190212                return null;
    191 
    192         }
    193 
     213               
     214        }
     215       
    194216        //upper left corner like rectangle
    195217        private Rectangle getIconRect()
     
    206228        }
    207229
    208         public void mouseClicked(MouseEvent e) {
    209         }
    210 
    211         public void mouseEntered(MouseEvent arg0) {
     230        public void mouseClicked(MouseEvent e) {               
     231        }
     232
     233        public void mouseEntered(MouseEvent arg0) {     
    212234        }
    213235
     
    228250                        }
    229251                }
    230 
    231         }
    232 
     252               
     253        }
     254       
    233255        //
    234         public void mouseReleased(MouseEvent e) {
     256        public void mouseReleased(MouseEvent e) {               
    235257                //only leftclicks on our layer
    236258                if(e.getButton() == MouseEvent.BUTTON1) {
     
    251273                        Main.map.mapView.repaint();
    252274                }
    253 
    254         }
    255 
     275               
     276        }
     277       
    256278        //slide and restrict during movement
    257         public void mouseDragged(MouseEvent e) {
     279        public void mouseDragged(MouseEvent e) {               
    258280                if(dragIcon)
    259                 {
     281                {                       
    260282                        mouse=e.getPoint();
    261283                        //restrict to GPS track
     
    267289
    268290        //visualize drag&drop
    269         public void mouseMoved(MouseEvent e) {
     291        public void mouseMoved(MouseEvent e) {         
    270292                if (player.getCurr()!=null)
    271                 {
     293                {                                               
    272294                        if (getIconRect().contains(e.getPoint()))
    273295                        {
     
    279301                        }
    280302                }
    281 
     303               
    282304        }
    283305
    284306        public void setGPSPlayer(GPSVideoPlayer player) {
    285307                this.gps = player;
    286 
    287         }
    288 
     308               
     309        }
     310       
    289311        public static void addObserver(PlayerObserver observer) {
    290312
     
    293315    }
    294316
    295 
     317 
    296318
    297319    public static void removeObserver(PlayerObserver observer) {
Note: See TracChangeset for help on using the changeset viewer.