/*******************************************************************************
* Copyright (c) 2012-present Jakub Kováč, Jozef Brandýs, Katarína Kotrlová,
* Pavol Lukča, Ladislav Pápay, Viktor Tomkovič, Tatiana Tóthová
*
* 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. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package algvis.ui;
import javax.swing.*;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.border.TitledBorder;
import java.awt.*;
public class AlgVisStandalone {
public static void main(String[] args) {
try {
for (final LookAndFeelInfo info : UIManager
.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.put("nimbusBase", new Color(0xBB, 0xC3, 0xFF));
UIManager.put("TitledBorder.position", TitledBorder.CENTER);
UIManager
.put("nimbusBlueGrey", new Color(0xD1, 0xD1, 0xD1));
UIManager.put("control", new Color(0xFA, 0xFA, 0xFA));
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (final Exception e) {
// If Nimbus is not available, you can set the GUI to another look
// and feel.
e.printStackTrace();
}
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
final JFrame f = new MainFrame();
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.setVisible(true);
}
});
}
}
class MainFrame extends JFrame {
private static final long serialVersionUID = -1045189076645432320L;
private static final int WIDTH = 900;
private static final int HEIGHT = 650;
public MainFrame() {
setTitle("Gnarley Trees");
final AlgVis A = new AlgVis(getContentPane());
add(A);
pack();
A.init();
setSize(WIDTH, HEIGHT + 20); // add 20 for the frame title
}
}