public void actionPerformed(ActionEvent e) {
try {
// Prompt user for star and JD range selection.
Mediator.getUI().getStatusPane().setMessage(
LocaleProps.get("STATUS_PANE_SELECT_STAR"));
StarSelectorDialog starSelectorDialog = StarSelectorDialog
.getInstance();
starSelectorDialog.showDialog();
if (!starSelectorDialog.isCancelled()) {
String starName = starSelectorDialog.getStarName();
String auid = starSelectorDialog.getAuid();
double minJD, maxJD;
// TODO: consider doing these value mods in the dialog
// getters to make this code more declarative.
if (!starSelectorDialog.wantAllData()) {
minJD = starSelectorDialog.getMinDate()
.getJulianDay();
maxJD = starSelectorDialog.getMaxDate()
.getJulianDay();
} else {
minJD = 0;
maxJD = Double.MAX_VALUE;
}
mediator.createObservationArtefactsFromDatabase(
starName, auid, minJD, maxJD,
starSelectorDialog.isLoadAdditive());
} else {
Mediator.getUI().getStatusPane().setMessage("");
}
} catch (Exception ex) {
completeProgress();