Changeset 22691 in osm for applications/editors/josm
- Timestamp:
- 2010-08-19T08:44:44+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/videomapping
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/videomapping/.classpath
r22550 r22691 5 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> 6 6 <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"/> 10 14 <classpathentry kind="output" path="bin"/> 11 15 </classpath> -
applications/editors/josm/plugins/videomapping/build.xml
r22550 r22691 33 33 <property name="commit.message" value="videomapping" /> 34 34 <!-- 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" /> 36 36 37 37 … … 40 40 ** should not be necessary to change the following properties 41 41 --> 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--> 43 43 <property name="plugin.build.dir" value="build"/> 44 44 <property name="plugin.src.dir" value="src"/> 45 45 <!-- 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"/> 47 47 <property name="ant.build.javac.target" value="1.5"/> 48 48 <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"/> 49 52 <!-- 50 53 ********************************************************** … … 66 69 <compilerarg value="-Xlint:deprecation"/> 67 70 <compilerarg value="-Xlint:unchecked"/> 68 69 <fileset dir="lib">70 <include name="**/*.jar"/>71 </fileset>72 71 <classpath> 72 <pathelement location="${vlcj}"/> <!--Add external library --> 73 <pathelement location="${jna}"/> 74 <pathelement location="${log4j}"/> 75 </classpath> 73 76 </javac> 74 77 </target> … … 107 110 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 108 111 <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"/>110 112 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/VideoMapping"/> 111 113 <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}"/> 113 115 </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" />118 116 </jar> 119 117 </target> … … 165 163 166 164 <!-- 167 ************************** Publishing the plugin *********************************** 165 ************************** Publishing the plugin *********************************** 168 166 --> 169 167 <!-- 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 171 169 ** property ${coreversion.info.entry.revision} 172 170 ** … … 217 215 218 216 <!-- 219 ** commits the plugin.jar 217 ** commits the plugin.jar 220 218 --> 221 219 <target name="commit-dist"> 222 220 <echo> 223 221 ***** Properties of published ${plugin.jar} ***** 224 Commit message : '${commit.message}' 222 Commit message : '${commit.message}' 225 223 Plugin-Mainversion: ${plugin.main.version} 226 224 JOSM build version: ${coreversion.info.entry.revision} 227 225 Plugin-Version : ${version.entry.commit.revision} 228 ***** / Properties of published ${plugin.jar} ***** 229 226 ***** / Properties of published ${plugin.jar} ***** 227 230 228 Now commiting ${plugin.jar} ... 231 229 </echo> -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java
r22690 r22691 2 2 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 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; 5 18 6 19 import java.awt.Color; 20 import java.awt.Component; 7 21 import java.awt.Cursor; 22 import java.awt.Dimension; 8 23 import java.awt.Graphics2D; 9 24 import java.awt.Point; 10 25 import java.awt.Rectangle; 26 import java.awt.event.ActionEvent; 27 import java.awt.event.KeyEvent; 28 import java.awt.event.KeyListener; 11 29 import java.awt.event.MouseEvent; 12 30 import java.awt.event.MouseListener; 13 31 import 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 33 import javax.swing.*; 34 35 import static org.openstreetmap.josm.tools.I18n.*; 23 36 24 37 import org.openstreetmap.josm.Main; 38 import org.openstreetmap.josm.actions.InfoAction; 25 39 import org.openstreetmap.josm.data.Bounds; 40 import org.openstreetmap.josm.data.gpx.GpxData; 26 41 import org.openstreetmap.josm.data.gpx.WayPoint; 42 import org.openstreetmap.josm.data.osm.DataSet; 43 import org.openstreetmap.josm.data.osm.Node; 27 44 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 28 45 import org.openstreetmap.josm.gui.MapView; … … 31 48 import org.openstreetmap.josm.gui.layer.Layer; 32 49 import 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; 33 54 34 55 //Basic rendering and GPS layer interaction … … 45 66 private SimpleDateFormat gpsTimeCode; 46 67 private GPSVideoPlayer gps; 47 68 48 69 public PositionLayer(String name, final List<WayPoint> ls) { 49 70 super(name); … … 55 76 gpsTimeCode= new SimpleDateFormat("hh:mm:ss"); 56 77 Main.map.mapView.addMouseListener(this); 57 Main.map.mapView.addMouseMotionListener(this); 58 78 Main.map.mapView.addMouseMotionListener(this); 79 59 80 } 60 81 … … 75 96 76 97 @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(), 82 103 //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 86 108 87 109 … … 99 121 @Override 100 122 public void mergeFrom(Layer arg0) { 101 102 } 103 104 105 123 124 } 125 126 127 106 128 @Override 107 129 //Draw the current position, infos, waypoints … … 157 179 { 158 180 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); 160 182 //g.drawString(mins.format(iconPosition.getTime()),p.x-10,p.y-10); //TODO when synced we might wan't to use a different layout 161 183 g.drawString(gpsTimeCode.format(iconPosition.getTime()),p.x-10,p.y-10); … … 166 188 if (player.getCurr()!=null){ 167 189 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); 169 191 g.drawString(gpsTimeCode.format(player.getCurr().getTime()),p.x-10,p.y-10); 170 192 } 171 193 } 172 194 } 173 195 174 196 //finds the first waypoint that is nearby the given point 175 197 private WayPoint getNearestWayPoint(Point mouse) … … 183 205 p = Main.map.mapView.getPoint(n.getEastNorth()); 184 206 if (rect.contains(p)) 185 { 207 { 186 208 return n; 187 209 } 188 210 189 211 } 190 212 return null; 191 192 } 193 213 214 } 215 194 216 //upper left corner like rectangle 195 217 private Rectangle getIconRect() … … 206 228 } 207 229 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) { 212 234 } 213 235 … … 228 250 } 229 251 } 230 231 } 232 252 253 } 254 233 255 // 234 public void mouseReleased(MouseEvent e) { 256 public void mouseReleased(MouseEvent e) { 235 257 //only leftclicks on our layer 236 258 if(e.getButton() == MouseEvent.BUTTON1) { … … 251 273 Main.map.mapView.repaint(); 252 274 } 253 254 } 255 275 276 } 277 256 278 //slide and restrict during movement 257 public void mouseDragged(MouseEvent e) { 279 public void mouseDragged(MouseEvent e) { 258 280 if(dragIcon) 259 { 281 { 260 282 mouse=e.getPoint(); 261 283 //restrict to GPS track … … 267 289 268 290 //visualize drag&drop 269 public void mouseMoved(MouseEvent e) { 291 public void mouseMoved(MouseEvent e) { 270 292 if (player.getCurr()!=null) 271 { 293 { 272 294 if (getIconRect().contains(e.getPoint())) 273 295 { … … 279 301 } 280 302 } 281 303 282 304 } 283 305 284 306 public void setGPSPlayer(GPSVideoPlayer player) { 285 307 this.gps = player; 286 287 } 288 308 309 } 310 289 311 public static void addObserver(PlayerObserver observer) { 290 312 … … 293 315 } 294 316 295 317 296 318 297 319 public static void removeObserver(PlayerObserver observer) {
Note:
See TracChangeset
for help on using the changeset viewer.