legalParams = true;
List<ITextComponent<?>> fields = new ArrayList<ITextComponent<?>>();
double days = obs.get(obs.size() - 1).getJD() - obs.get(0).getJD();
DoubleField minPeriodField = new DoubleField("Minimum Period", 0.01,
days, minPeriod);
fields.add(minPeriodField);
fields.add(minPeriodField);
DoubleField maxPeriodField = new DoubleField("Maximum Period", 0.0,
days, maxPeriod == 0.0 ? days : maxPeriod);
fields.add(maxPeriodField);
DoubleField resolutionField = new DoubleField("Resolution", 0.0, 1.0,
resolution);
fields.add(resolutionField);
// Set<String> binSet = new TreeSet<String>();
// binSet.add("4");
// binSet.add("10");
// binSet.add("20");
// binSet.add("50");
// SelectableTextField binsField = new SelectableTextField("Bins",
// binSet);
IntegerField binsField = new IntegerField("Bins", 0, 50, bins);
fields.add(binsField);
MultiEntryComponentDialog dlg = new MultiEntryComponentDialog(
"AoV Parameters", fields);
cancelled = dlg.isCancelled();
if (!cancelled) {
try {
bins = binsField.getValue();
if (bins <= 0) {
MessageBox.showErrorDialog("AoV Parameters",
"Number of bins must be greater than zero");
legalParams = false;
}
} catch (Exception e) {
legalParams = false;
}
minPeriod = minPeriodField.getValue();
maxPeriod = maxPeriodField.getValue();
resolution = resolutionField.getValue();
if (minPeriod > maxPeriod) {
MessageBox
.showErrorDialog("AoV Parameters",
"Minimum period must be less than or equal to maximum period");