X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fexamples%2Flauncher%2FMenuPanel.java;h=30c7ee3c94e8a0139adb1fe2e71b5a2591d2c2cb;hp=10178e388015230677f6275805b46538b9620f0d;hb=cea6336f011484356f2d4294d45849f3c398e2e7;hpb=b2c4a8941f5a618b83913fa1a1456d1ef2f77e77 diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java index 10178e3..30c7ee3 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java @@ -1,5 +1,5 @@ /* - * 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 @@ -17,8 +17,7 @@ import java.io.IOException; 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:")); @@ -29,10 +28,11 @@ class MenuPanel extends JPanel { 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"); } @@ -94,6 +94,17 @@ class MenuPanel extends JPanel { } } + 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"); @@ -101,11 +112,7 @@ class MenuPanel extends JPanel { @Override public void actionPerformed(final ActionEvent e) { - try { - OctreeDemo.main(null); - } catch (final IOException e1) { - e1.printStackTrace(); - } + OctreeDemo.main(null); } }