}
- /**
- * Load the specified data into the Track
- * @param inFieldArray array of Field objects describing fields
- * @param inPointArray 2d object array containing data
- * @param inAltFormat altitude format
- */
- public void loadTrack(Field[] inFieldArray, Object[][] inPointArray, int inAltFormat)
- {
- _track.cropTo(0);
- _track.load(inFieldArray, inPointArray, inAltFormat);
- _selection.clearAll();
- }
-
-
/**
* Add a Set of Photos
* @param inSet Set containing Photo objects
* @return array containing number of photos and number of points added
*/
- public int[] addPhotos(Set inSet)
+ public int[] addPhotos(Set<Photo> inSet)
{
// Firstly count number of points and photos to add
int numPhotosToAdd = 0;
int numPointsToAdd = 0;
- Iterator iterator = null;
+ Iterator<Photo> iterator = null;
if (inSet != null && !inSet.isEmpty())
{
iterator = inSet.iterator();
{
try
{
- Photo photo = (Photo) iterator.next();
+ Photo photo = iterator.next();
if (photo != null && !_photoList.contains(photo))
{
numPhotosToAdd++;
{
try
{
- Photo photo = (Photo) iterator.next();
+ Photo photo = iterator.next();
if (photo != null && !_photoList.contains(photo))
{
// Add photo
/**
- * Compress the track to the given resolution
- * @param inResolution resolution
- * @return number of points deleted
- */
- public int compress(int inResolution)
- {
- int numDeleted = _track.compress(inResolution);
- if (numDeleted > 0) {
- _selection.clearAll();
- UpdateMessageBroker.informSubscribers();
- }
- return numDeleted;
- }
-
-
- /**
- * Delete all the duplicate points in the track
+ * Delete all the points which have been marked for deletion
* @return number of points deleted
*/
- public int deleteDuplicates()
+ public int deleteMarkedPoints()
{
- int numDeleted = _track.deleteDuplicates();
+ int numDeleted = _track.deleteMarkedPoints();
if (numDeleted > 0) {
_selection.clearAll();
UpdateMessageBroker.informSubscribers();
}
+ /**
+ * Average selected points to create a new one
+ * @return true if successful
+ */
+ public boolean average()
+ {
+ boolean success = _track.average(_selection.getStart(), _selection.getEnd());
+ if (success) {
+ _selection.selectPoint(_selection.getEnd()+1);
+ }
+ return success;
+ }
+
+
/**
* Select the given DataPoint
* @param inPoint DataPoint object to select