}
/** Open a dialog to select a dataset to edit.
*/
protected void _selectDataset() {
Query query = new Query();
int numSets = ((EditablePlot) plot).getNumDataSets();
String[] choices = new String[numSets + 1];
for (int i = 0; i < numSets; i++) {
choices[i + 1] = plot.getLegend(i);
if (choices[i + 1] == null) {
choices[i + 1] = "" + i;
}
}
choices[0] = "none";
query.setTextWidth(20);
query.addChoice("choice",
"Choose a data set, then drag the right mouse button", choices,
choices[0]);
ComponentDialog dialog = new ComponentDialog(this, "Select dataset",
query);
String buttonPressed = dialog.buttonPressed();
if (buttonPressed.equals("OK")) {
int result = query.getIntValue("choice");
if (result > 0) {
((EditablePlot) plot).setEditable(result - 1);
} else {
// none...