package tim.prune.data;
+import tim.prune.DataSubscriber;
import tim.prune.UpdateMessageBroker;
/**
private int _currentPoint = -1;
private boolean _valid = false;
private int _startIndex = -1, _endIndex = -1;
+ private int _currentPhotoIndex = -1;
private IntegerRange _altitudeRange = null;
private int _climb = -1, _descent = -1;
private int _altitudeFormat = Altitude.FORMAT_NONE;
/**
- * @param inFormat distance units to use, from class Distance
+ * @param inUnits distance units to use, from class Distance
* @return distance of Selection in specified units
*/
public double getDistance(int inUnits)
{
- return Distance.convertRadians(_angDistance, inUnits);
+ return Distance.convertRadiansToDistance(_angDistance, inUnits);
}
{
_currentPoint = -1;
deselectRange();
+ deselectPhoto();
}
}
+ /**
+ * Deselect photo
+ */
+ public void deselectPhoto()
+ {
+ _currentPhotoIndex = -1;
+ check();
+ }
+
+
+ /**
+ * Select the specified photo and point
+ * @param inPhotoIndex index of selected photo in PhotoList
+ * @param inPointIndex index of selected point
+ */
+ public void selectPhotoAndPoint(int inPhotoIndex, int inPointIndex)
+ {
+ _currentPhotoIndex = inPhotoIndex;
+ if (inPointIndex > -1)
+ {
+ // select associated point, if any
+ selectPoint(inPointIndex);
+ }
+ else
+ {
+ // Check if not already done
+ check();
+ }
+ }
+
+
+ /**
+ * @return currently selected photo index
+ */
+ public int getCurrentPhotoIndex()
+ {
+ return _currentPhotoIndex;
+ }
+
+
/**
* Check that the selection still makes sense
* and fire update message to listeners
_currentPoint = _startIndex = _endIndex = -1;
}
}
- _broker.informSubscribers();
+ _broker.informSubscribers(DataSubscriber.SELECTION_CHANGED);
}
}