Search in sources :

Example 1 with SetColorEdit

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);
        }
    }
}
Also used : SetColorEdit(blue.ui.core.score.undo.SetColorEdit) Color(java.awt.Color) ScoreObject(blue.score.ScoreObject)

Aggregations

ScoreObject (blue.score.ScoreObject)1 SetColorEdit (blue.ui.core.score.undo.SetColorEdit)1 Color (java.awt.Color)1