/* For License see bottom */
package jpianotrain.gui.action;
import static jpianotrain.util.ResourceKeys.ACTION_MAJORTONNETZ_NAME;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import javax.swing.JDialog;
import jpianotrain.ApplicationContext;
import jpianotrain.gui.TonnetzMajorPanel;
import jpianotrain.staff.Tonnetz;
import jpianotrain.util.ResourceFactory;
/**
*
* @author methke01
* @since 0.0.3
*/
public class MajorTonnetzAction extends AbstractAction {
public MajorTonnetzAction() {
super(ACTION_MAJORTONNETZ_NAME);
}
@Override
public void actionPerformed(ActionEvent e) {
Tonnetz t=new Tonnetz(Tonnetz.Sort.NORMAL);
TonnetzMajorPanel tmp=new TonnetzMajorPanel(t);
if (dlg==null) {
dlg=new JDialog(ApplicationContext.getInstance().getDefaultDialogOwner(),
ResourceFactory.getString(ACTION_MAJORTONNETZ_NAME),
false);
dlg.setLayout(new BorderLayout());
dlg.add(tmp, BorderLayout.CENTER);
dlg.pack();
//Dimension d=dlg.getSize();
//d.setSize(new Dimension(d.width, d.height+200));
}
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).
*/