package tim.prune.data;
+import tim.prune.DataSubscriber;
import tim.prune.UpdateMessageBroker;
/**
public class Selection
{
private Track _track = null;
- private UpdateMessageBroker _broker = null;
private int _currentPoint = -1;
private boolean _valid = false;
private int _startIndex = -1, _endIndex = -1;
/**
* Constructor
* @param inTrack track object
- * @param inBroker broker object
*/
- public Selection(Track inTrack, UpdateMessageBroker inBroker)
+ public Selection(Track inTrack)
{
_track = inTrack;
- _broker = inBroker;
}
/**
- * @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);
}
}
}
reset();
- _broker.informSubscribers();
+ UpdateMessageBroker.informSubscribers();
}
}
}
reset();
- _broker.informSubscribers();
+ UpdateMessageBroker.informSubscribers();
}
*/
public int getCurrentPhotoIndex()
{
- // System.out.println("Current photo index = " + _currentPhotoIndex);
return _currentPhotoIndex;
}
-
/**
* Check that the selection still makes sense
* and fire update message to listeners
_currentPoint = _startIndex = _endIndex = -1;
}
}
- _broker.informSubscribers();
+ UpdateMessageBroker.informSubscribers(DataSubscriber.SELECTION_CHANGED);
}
}