// if synced jump in video to this GPS timecode public void jumpTo(Date GPSTime) { if ((GPSTime.after(firstWayPoint.getTime()) & (GPSTime.before(lastWayPoint.getTime())))) { long diff = GPSTime.getTime() - start.getTime(); player.setTime(diff); System.out.println(diff); } }
// calculates attributes basing upon the current position public void doSync(VideoPositionLayer layer) { this.videoPositionLayer = layer; if (isSynced()) removeSyncedWayPoints(); syncWayPoint = layer.getCurrentWayPoint(); syncVideoTime = getCurrentTime(); // calc now, to avoid calculations on every click start = new Date(syncWayPoint.getTime().getTime() - syncVideoTime); end = new Date(start.getTime() + player.getLength()); firstWayPoint = getFirstGPS(); lastWayPoint = getLastGPS(); markSyncedWayPoints(); Main.map.mapView.repaint(); }