2 * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public License
6 * or later as published by the Free Software Foundation.
9 package eu.svjatoslav.sixth.e3d.examples.launcher;
11 import eu.svjatoslav.sixth.e3d.examples.*;
14 import java.awt.event.ActionEvent;
15 import java.io.IOException;
17 class MenuPanel extends JPanel {
18 private static final long serialVersionUID = 2012721856427052560L;
21 final GroupLayout groupLayout = new GroupLayout(this);
22 GroupLayout.SequentialGroup sequentialGroup = groupLayout.createSequentialGroup();
23 sequentialGroup.addComponent(new JLabel("Choose an example to launch:"));
24 sequentialGroup.addComponent(new JButton(new ShowOctree()));
25 sequentialGroup.addComponent(new JButton(new ShowMathGraphs()));
26 sequentialGroup.addComponent(new JButton(new ShowPointcloud()));
27 sequentialGroup.addComponent(new JButton(new ShowRain()));
28 sequentialGroup.addComponent(new JButton(new ShowSinusMap()));
29 sequentialGroup.addComponent(new JButton(new ShowTextEditors()));
30 sequentialGroup.addComponent(new JButton(new ShowGameOfLife()));
31 sequentialGroup.addComponent(new JButton(new ShowRandomPolygons()));
34 private class ShowTextEditors extends AbstractAction {
36 putValue(NAME, "Text editors");
40 public void actionPerformed(final ActionEvent e) {
41 TextEditorDemo.main(null);
45 private class ShowSinusMap extends AbstractAction {
46 public ShowSinusMap() {
47 putValue(NAME, "Wireframe sphere and ploygon landscape");
51 public void actionPerformed(final ActionEvent e) {
52 SphereDemo.main(null);
56 private class ShowRain extends AbstractAction {
58 putValue(NAME, "Raining numbers");
62 public void actionPerformed(final ActionEvent e) {
64 RainingNumbersDemo.main(null);
65 } catch (final IOException e1) {
71 private class ShowPointcloud extends AbstractAction {
72 public ShowPointcloud() {
73 putValue(NAME, "Pointcloud galaxy");
77 public void actionPerformed(final ActionEvent e) {
78 PointCloudDemo.main(null);
82 private class ShowMathGraphs extends AbstractAction {
83 public ShowMathGraphs() {
84 putValue(NAME, "Mathematical graphs");
88 public void actionPerformed(final ActionEvent e) {
91 } catch (final IOException e1) {
97 private class ShowRandomPolygons extends AbstractAction {
98 public ShowRandomPolygons() {
99 putValue(NAME, "Random polygons");
103 public void actionPerformed(final ActionEvent e) {
104 RandomPolygonsDemo.main(null);
108 private class ShowOctree extends AbstractAction {
109 public ShowOctree() {
110 putValue(NAME, "Volumetric Octree");
114 public void actionPerformed(final ActionEvent e) {
115 OctreeDemo.main(null);
119 private class ShowGameOfLife extends AbstractAction {
120 public ShowGameOfLife() {
121 putValue(NAME, "Game of Life");
125 public void actionPerformed(final ActionEvent e) {
126 eu.svjatoslav.sixth.e3d.examples.life.Main.main(null);