use of blue.ui.core.score.undo.SetColorEdit in project blue by kunstmusik.
the class SetColorAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
if (scoreObjects.size() > 0) {
Color retVal = JColorChooser.showDialog(WindowManager.getDefault().getMainWindow(), "Choose Color", scoreObjects.iterator().next().getBackgroundColor());
SetColorEdit top = null;
if (retVal != null) {
for (ScoreObject sObj : scoreObjects) {
Color old = sObj.getBackgroundColor();
sObj.setBackgroundColor(retVal);
SetColorEdit edit = new SetColorEdit(sObj, old, retVal);
if (top == null) {
top = edit;
} else {
top.addEdit(edit);
}
}
BlueUndoManager.setUndoManager("score");
BlueUndoManager.addEdit(top);
}
}
}
Aggregations