Moved galaxy object to 3D engine demonstration project
[sixth-3d-demos.git] / src / main / java / eu / svjatoslav / sixth / e3d / examples / launcher / ApplicationListPanel.java
1 /*
2  * Sixth 3D engine demos. Author: Svjatoslav Agejenko. 
3  * This project is released under Creative Commons Zero (CC0) license.
4  *
5 */
6
7 package eu.svjatoslav.sixth.e3d.examples.launcher;
8
9 import eu.svjatoslav.sixth.e3d.examples.*;
10 import eu.svjatoslav.sixth.e3d.examples.galaxy_demo.PointCloudDemo;
11
12 import javax.swing.*;
13 import java.awt.event.ActionEvent;
14
15 class ApplicationListPanel extends JPanel {
16     private static final long serialVersionUID = 2012721856427052560L;
17
18     ApplicationListPanel() {
19         final GroupLayout groupLayout = new GroupLayout(this);
20         GroupLayout.SequentialGroup sequentialGroup = groupLayout.createSequentialGroup();
21         sequentialGroup.addComponent(new JLabel("Choose an example to launch:"));
22         sequentialGroup.addComponent(new JButton(new ShowOctree()));
23         sequentialGroup.addComponent(new JButton(new ShowMathGraphs()));
24         sequentialGroup.addComponent(new JButton(new ShowPointCloud()));
25         sequentialGroup.addComponent(new JButton(new ShowRain()));
26         sequentialGroup.addComponent(new JButton(new ShowTextEditors()));
27         sequentialGroup.addComponent(new JButton(new ShowTextEditors2()));
28         sequentialGroup.addComponent(new JButton(new ShowGameOfLife()));
29         sequentialGroup.addComponent(new JButton(new ShowRandomPolygons()));
30     }
31
32     private static class ShowTextEditors extends AbstractAction {
33         ShowTextEditors() {
34             putValue(NAME, "Text editors");
35         }
36
37         @Override
38         public void actionPerformed(final ActionEvent e) {
39             TextEditorDemo.main(null);
40         }
41     }
42
43     private static class ShowTextEditors2 extends AbstractAction {
44         ShowTextEditors2() {
45             putValue(NAME, "Text editors city");
46         }
47
48         @Override
49         public void actionPerformed(final ActionEvent e) {
50             TextEditorDemo2.main(null);
51         }
52     }
53
54
55     private static class ShowRain extends AbstractAction {
56         ShowRain() {
57             putValue(NAME, "Raining numbers");
58         }
59
60         @Override
61         public void actionPerformed(final ActionEvent e) {
62             RainingNumbersDemo.main(null);
63         }
64     }
65
66     private static class ShowPointCloud extends AbstractAction {
67         ShowPointCloud() {
68             putValue(NAME, "Point cloud galaxy");
69         }
70
71         @Override
72         public void actionPerformed(final ActionEvent e) {
73             PointCloudDemo.main(null);
74         }
75     }
76
77     private static class ShowMathGraphs extends AbstractAction {
78         ShowMathGraphs() {
79             putValue(NAME, "Mathematical graphs");
80         }
81
82         @Override
83         public void actionPerformed(final ActionEvent e) {
84             GraphDemo.main(null);
85         }
86     }
87
88     private static class ShowRandomPolygons extends AbstractAction {
89         ShowRandomPolygons() {
90             putValue(NAME, "Random polygons");
91         }
92
93         @Override
94         public void actionPerformed(final ActionEvent e) {
95             RandomPolygonsDemo.main(null);
96         }
97     }
98
99     private static class ShowOctree extends AbstractAction {
100         ShowOctree() {
101             putValue(NAME, "Volumetric Octree");
102         }
103
104         @Override
105         public void actionPerformed(final ActionEvent e) {
106             OctreeDemo.main(null);
107         }
108     }
109
110     private static class ShowGameOfLife extends AbstractAction {
111         ShowGameOfLife() {
112             putValue(NAME, "Game of Life");
113         }
114
115         @Override
116         public void actionPerformed(final ActionEvent e) {
117             eu.svjatoslav.sixth.e3d.examples.life_demo.Main.main(null);
118         }
119     }
120
121 }