/* License see bottom */
package jpianotrain.gui.action;
import static jpianotrain.util.ResourceKeys.ACTION_SCALE_PANE_NAME;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import javax.swing.JDialog;
import jpianotrain.ApplicationContext;
import jpianotrain.gui.ScalePane;
import jpianotrain.util.ResourceFactory;
/**
* Displays the circle of fifths in a
* separte (non modal) dialog.
*
* @since 0.0.3
* @author Alexander Methke
*/
public class ScalePaneAction extends AbstractAction {
public ScalePaneAction() {
super(ACTION_SCALE_PANE_NAME);
}
/**
* Possibly creates the dialog and displays
* it.
*/
public void actionPerformed(ActionEvent e) {
if (dlg==null) {
dlg=new JDialog(ApplicationContext.getInstance().getDefaultDialogOwner(),
ResourceFactory.getString(ACTION_SCALE_PANE_NAME),
false);
dlg.setLayout(new BorderLayout());
dlg.add(new ScalePane(), BorderLayout.CENTER);
dlg.setSize(new Dimension(550, 220));
}
if (dlg.isVisible()) {
dlg.toFront();
} else {
dlg.setVisible(true);
}
}
private JDialog dlg;
}
/*
Copyright (C) 2008 Alexander Methke
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program (gplv3.txt).
*/