Changeset 23667 in osm for applications/editors/josm/plugins
- Timestamp:
- 2010-10-17T16:29:50+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java
r23529 r23667 117 117 public void jump(Time GPSAbsTime) 118 118 { 119 goTo(getWaypoint(GPSAbsTime.getTime()-start.getTime().getTime())); //TODO replace Time by Date? 119 Date zero=start.getTime(); 120 Time starttime = new Time(zero.getHours(),zero.getMinutes(),zero.getSeconds()); 121 long diff=GPSAbsTime.getTime()-starttime.getTime(); 122 goTo(getWaypoint(diff)); //TODO replace Time by Date? 120 123 } 121 124 … … 339 342 int pos = Math.round(relTime/1000);//TODO ugly quick hack 340 343 goTo(pos); 341 //if (autoCenter) Main.map.mapView.344 if (autoCenter) Main.map.mapView.zoomTo(curr.getCoor()); 342 345 } 343 346 -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java
r23529 r23667 122 122 Point p; 123 123 //TODO Source out redundant calculations 124 //TODO make icon transparent125 124 //draw all GPS points 126 125 g.setColor(Color.YELLOW); //new Color(0,255,0,128) … … 172 171 icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2); 173 172 //g.drawString(mins.format(iconPosition.getTime()),p.x-10,p.y-10); //TODO when synced we might wan't to use a different layout 174 g.drawString(gpsTimeCode.format(iconPosition.getTime()),p.x-1 0,p.y-10);173 g.drawString(gpsTimeCode.format(iconPosition.getTime()),p.x-15,p.y-15); 175 174 } 176 175 } … … 180 179 p=Main.map.mapView.getPoint(gps.getCurr().getEastNorth()); 181 180 icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2); 182 g.drawString(gpsTimeCode.format(gps.getCurr().getTime()),p.x-1 0,p.y-10);181 g.drawString(gpsTimeCode.format(gps.getCurr().getTime()),p.x-15,p.y-15); 183 182 } 184 183 } -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java
r23529 r23667 1 1 package org.openstreetmap.josm.plugins.videomapping; 2 2 3 import java.awt.BorderLayout; 4 import java.awt.Panel; 3 5 import java.awt.event.ActionEvent; 4 6 import java.awt.event.KeyEvent; … … 6 8 import java.text.SimpleDateFormat; 7 9 import java.util.Date; 10 11 import javax.swing.Box; 12 import javax.swing.InputVerifier; 13 import javax.swing.JButton; 8 14 import javax.swing.JCheckBoxMenuItem; 15 import javax.swing.JComponent; 16 import javax.swing.JDialog; 9 17 import javax.swing.JFileChooser; 18 import javax.swing.JFormattedTextField; 10 19 import javax.swing.JMenu; 11 20 import javax.swing.JMenuItem; 12 21 import javax.swing.JOptionPane; 22 import javax.swing.JPanel; 13 23 import javax.swing.JRadioButtonMenuItem; 24 import javax.swing.text.MaskFormatter; 14 25 15 26 import org.openstreetmap.josm.Main; … … 46 57 private final String VM_JUMPLENGTH="videomapping.jumplength"; 47 58 private final String VM_LOOPLENGTH="videomapping.looplength"; 59 private String deinterlacer; 48 60 private boolean autocenter; 49 private String deinterlacer;50 61 private Integer jumplength,looplength; 51 62 private String mru; … … 114 125 VRemove.setEnabled(true); 115 126 layer.getVideoPlayer().setSubtitleAction(VSubTitles); 127 player=layer.getVideoPlayer(); 116 128 } 117 129 } … … 127 139 128 140 VStart = new JosmAction(tr("Play/Pause"), "audio-playpause", tr("starts/pauses video playback"), 129 Shortcut.registerShortcut("videomapping:startstop"," ",KeyEvent.VK_NUMPAD5, Shortcut.GROUP_DIRECT), false) {141 Shortcut.registerShortcut("videomapping:startstop","Video: "+tr("Play/Pause"),KeyEvent.VK_NUMPAD5, Shortcut.GROUP_DIRECT), false) { 130 142 131 143 public void actionPerformed(ActionEvent e) { … … 134 146 }; 135 147 Vbackward = new JosmAction(tr("Backward"), "audio-prev", tr("jumps n sec back"), 136 Shortcut.registerShortcut("videomapping:backward"," ",KeyEvent.VK_NUMPAD4, Shortcut.GROUP_DIRECT), false) {148 Shortcut.registerShortcut("videomapping:backward","Video: "+tr("Backward"),KeyEvent.VK_NUMPAD4, Shortcut.GROUP_DIRECT), false) { 137 149 public void actionPerformed(ActionEvent e) { 138 150 player.backward(); 151 } 152 }; 153 Vforward= new JosmAction(tr("Forward"), "audio-next", tr("jumps n sec forward"), 154 Shortcut.registerShortcut("videomapping:forward","Video: "+tr("Forward"),KeyEvent.VK_NUMPAD6, Shortcut.GROUP_DIRECT), false) { 155 156 public void actionPerformed(ActionEvent e) { 157 player.forward(); 158 159 } 160 }; 161 Vfaster= new JosmAction(tr("Faster"), "audio-faster", tr("faster playback"), 162 Shortcut.registerShortcut("videomapping:faster","Video: "+tr("Faster"),KeyEvent.VK_NUMPAD8, Shortcut.GROUP_DIRECT), false) { 163 164 public void actionPerformed(ActionEvent e) { 165 player.faster(); 166 167 } 168 }; 169 Vslower= new JosmAction(tr("Slower"), "audio-slower", tr("slower playback"), 170 Shortcut.registerShortcut("videomapping:slower","Video: "+tr("Slower"),KeyEvent.VK_NUMPAD2, Shortcut.GROUP_DIRECT), false) { 171 172 public void actionPerformed(ActionEvent e) { 173 player.slower(); 139 174 140 175 } … … 142 177 VJump= new JosmAction(tr("Jump To"), "jumpto", tr("jumps to the entered gps time"),null, false) { 143 178 public void actionPerformed(ActionEvent e) { 144 String s =JOptionPane.showInputDialog(tr("please enter GPS timecode"),"10:07:57"); 145 SimpleDateFormat format= new SimpleDateFormat("hh:mm:ss"); 146 Date t; 147 try { 148 t = format.parse(s); 149 if (t!=null) 150 { 151 player.jumpToGPSTime(t.getTime()); 152 } 153 } catch (ParseException e1) { 154 // TODO Auto-generated catch block 155 e1.printStackTrace(); 156 } 157 158 } 159 }; 160 Vforward= new JosmAction(tr("Forward"), "audio-next", tr("jumps n sec forward"), 161 Shortcut.registerShortcut("videomapping:forward","",KeyEvent.VK_NUMPAD6, Shortcut.GROUP_DIRECT), false) { 162 163 public void actionPerformed(ActionEvent e) { 164 player.forward(); 165 166 } 167 }; 168 Vfaster= new JosmAction(tr("Faster"), "audio-faster", tr("faster playback"), 169 Shortcut.registerShortcut("videomapping:faster","",KeyEvent.VK_NUMPAD8, Shortcut.GROUP_DIRECT), false) { 170 171 public void actionPerformed(ActionEvent e) { 172 player.faster(); 173 174 } 175 }; 176 Vslower= new JosmAction(tr("Slower"), "audio-slower", tr("slower playback"), 177 Shortcut.registerShortcut("videomapping:slower","",KeyEvent.VK_NUMPAD2, Shortcut.GROUP_DIRECT), false) { 178 179 public void actionPerformed(ActionEvent e) { 180 player.slower(); 181 182 } 179 String s; 180 try { 181 JOptionPane d=new JOptionPane(tr("Jump to"), JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION); 182 JFormattedTextField inp = new JFormattedTextField(new MaskFormatter("##:##:##")); 183 inp.setText("00:00:01"); 184 inp.setInputVerifier(new InputVerifier() { 185 @Override 186 public boolean verify(JComponent input) { 187 // TODO Auto-generated method stub 188 return false; 189 } 190 }); 191 //TODO here we should show the GPS time range to the user 192 if(d.showConfirmDialog(Main.main.panel,inp, tr("Jump to"),JOptionPane.OK_CANCEL_OPTION)==JOptionPane.OK_OPTION) 193 { 194 s=inp.getText(); 195 Date t; 196 SimpleDateFormat sdf= new SimpleDateFormat("hh:mm:ss"); 197 t = sdf.parse(s); 198 if (t!=null) 199 { 200 player.jumpToGPSTime(t.getTime()); 201 } 202 } 203 } catch (ParseException e1) { 204 // TODO Auto-generated catch block 205 e1.printStackTrace(); 206 } 207 208 } 209 210 183 211 }; 184 212 Vloop= new JosmAction(tr("Loop"), "loop", tr("loops n sec around current position"), 185 Shortcut.registerShortcut("videomapping:loop"," ",KeyEvent.VK_NUMPAD7, Shortcut.GROUP_DIRECT), false) {213 Shortcut.registerShortcut("videomapping:loop","Video: "+tr("loop"),KeyEvent.VK_NUMPAD7, Shortcut.GROUP_DIRECT), false) { 186 214 187 215 public void actionPerformed(ActionEvent e) { -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java
r23529 r23667 4 4 import java.awt.event.ActionListener; 5 5 import java.io.File; 6 import java.sql.Date; 6 7 import java.sql.Time; 7 8 import java.util.List; … … 12 13 import javax.swing.JCheckBoxMenuItem; 13 14 15 import org.openstreetmap.josm.Main; 14 16 import org.openstreetmap.josm.data.gpx.WayPoint; 15 17 import org.openstreetmap.josm.plugins.videomapping.GpsPlayer; … … 61 63 public void playing(long time) { 62 64 //sync the GPS back 63 if(synced) gps.jump(getGPSTime(time)); 65 if(synced) { 66 gps.jump(getGPSTime(time)); 67 } 64 68 65 69 } … … 148 152 public void jumpToGPSTime(long gpsT) 149 153 { 150 /*if(!synced)154 if(!synced) 151 155 { 152 156 //when not synced we can just move the icon to the right position 153 gps.jump(new Date(gpsT));157 gps.jump(new Time(gpsT)); 154 158 Main.map.mapView.repaint(); 155 } */159 } 156 160 video.jump(getVideoTime(gpsT)); 157 161 }
Note:
See TracChangeset
for help on using the changeset viewer.