/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
class MenuPanel extends JPanel {
private static final long serialVersionUID = 2012721856427052560L;
- public MenuPanel() {
-
+ MenuPanel() {
final GroupLayout groupLayout = new GroupLayout(this);
GroupLayout.SequentialGroup sequentialGroup = groupLayout.createSequentialGroup();
sequentialGroup.addComponent(new JLabel("Choose an example to launch:"));
sequentialGroup.addComponent(new JButton(new ShowSinusMap()));
sequentialGroup.addComponent(new JButton(new ShowTextEditors()));
sequentialGroup.addComponent(new JButton(new ShowGameOfLife()));
+ sequentialGroup.addComponent(new JButton(new ShowRandomPolygons()));
}
private class ShowTextEditors extends AbstractAction {
- public ShowTextEditors() {
+ ShowTextEditors() {
putValue(NAME, "Text editors");
}
}
}
+ private class ShowRandomPolygons extends AbstractAction {
+ public ShowRandomPolygons() {
+ putValue(NAME, "Random polygons");
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent e) {
+ RandomPolygonsDemo.main(null);
+ }
+ }
+
private class ShowOctree extends AbstractAction {
public ShowOctree() {
putValue(NAME, "Volumetric Octree");
@Override
public void actionPerformed(final ActionEvent e) {
- try {
- OctreeDemo.main(null);
- } catch (final IOException e1) {
- e1.printStackTrace();
- }
+ OctreeDemo.main(null);
}
}