- DataPoint trackPoint = _trackInfo.getCurrentPoint();
- Photo selectedPhoto = _photoListModel.getPhoto(_photoList.getSelectedIndex());
- // Get selected Photo, if it's still there
- DataPoint photoPoint = null;
- if (selectedPhoto != null) {
- photoPoint = _photoListModel.getPhoto(_photoList.getSelectedIndex()).getDataPoint();
- }
- // Compare selected photo with selected point
- if ( (photoPoint != null && (trackPoint == null || !photoPoint.equals(trackPoint)))
- || (_trackInfo.getSelection().getCurrentPhotoIndex() < 0) )
+ int photoIndex = _trackInfo.getSelection().getCurrentPhotoIndex();
+ int listSelection = _photoList.getSelectedIndex();
+ // Change listbox selection if indexes not equal
+ if (listSelection != photoIndex)