public int getClosestPosition(double longitude, double latitude, double threshold) { return delegate.getClosestPosition(longitude, latitude, threshold); }
public int getClosestPosition(CompactCalendar time, long threshold) { return delegate.getClosestPosition(time, threshold); }
private void selectPosition(Double longitude, Double latitude, Double threshold, boolean replaceSelection) { int row = positionsModel.getClosestPosition(longitude, latitude, threshold); if (row != -1) positionsSelectionModel.setSelectedPositions(new int[]{row}, replaceSelection); }
private void removePosition(LatLong latLong, Double threshold) { int row = positionsModel.getClosestPosition(latLong.longitude, latLong.latitude, threshold); log.info("Deleting position at " + latLong + " from row " + row); if (row != -1) { positionsModel.remove(new int[]{row}); } }
private void deletePosition(Double longitude, Double latitude, Double threshold) { int row = positionsModel.getClosestPosition(longitude, latitude, threshold); if (row != -1) { positionsModel.remove(new int[]{row}); executor.execute(new Runnable() { public void run() { synchronized (notificationMutex) { haveToRepaintRouteImmediately = true; routeUpdateReason = "delete position"; notificationMutex.notifyAll(); } } }); } }
private void selectPosition(LatLong latLong, Double threshold, boolean replaceSelection) { int row = positionsModel.getClosestPosition(latLong.longitude, latLong.latitude, threshold); if (row != -1 && !mapViewMoverAndZoomer.isMousePressedOnMarker()) { log.info("Selecting position at " + latLong + ", row is " + row); positionsSelectionModel.setSelectedPositions(new int[]{row}, replaceSelection); } }
private int getClosestPositionByCoordinates(NavigationPosition position) { PositionsModel originalPositionsModel = RouteConverter.getInstance().getConvertPanel().getPositionsModel(); double threshold = preferences.getDouble(CLOSEST_POSITION_BY_COORDINATES_THRESHOLD_PREFERENCE, 25); return position.hasCoordinates() ? originalPositionsModel.getClosestPosition(position.getLongitude(), position.getLatitude(), threshold) : -1; }
private int getClosestPositionByTime(NavigationPosition position) { if (!position.hasTime()) return -1; RouteConverter r = RouteConverter.getInstance(); PositionsModel originalPositionsModel = r.getConvertPanel().getPositionsModel(); CompactCalendar time = position.getTime(); if (!time.getTimeZoneId().equals(r.getPhotoTimeZone().getTimeZoneId())) time = time.asUTCTimeInTimeZone(r.getPhotoTimeZone().getTimeZone()); long threshold = preferences.getLong(CLOSEST_POSITION_BY_TIME_THRESHOLD_PREFERENCE, 5 * 1000); return originalPositionsModel.getClosestPosition(time, threshold); }