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%2FApplicationListPanel.java;fp=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fexamples%2Flauncher%2FApplicationListPanel.java;h=2b3b643dd8405792bbc2d6ad6f0cbe52e1b4b884;hp=0000000000000000000000000000000000000000;hb=08719db537fae3645ca86f9ee6f8deba4dadf4f4;hpb=f0ebc20d0438fc46be1d98fb3643bd4196cb64c9 diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/ApplicationListPanel.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/ApplicationListPanel.java new file mode 100644 index 0000000..2b3b643 --- /dev/null +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/ApplicationListPanel.java @@ -0,0 +1,120 @@ +/* + * Sixth 3D engine demos. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. + * +*/ + +package eu.svjatoslav.sixth.e3d.examples.launcher; + +import eu.svjatoslav.sixth.e3d.examples.*; + +import javax.swing.*; +import java.awt.event.ActionEvent; + +class ApplicationListPanel extends JPanel { + private static final long serialVersionUID = 2012721856427052560L; + + ApplicationListPanel() { + 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 ShowOctree())); + sequentialGroup.addComponent(new JButton(new ShowMathGraphs())); + sequentialGroup.addComponent(new JButton(new ShowPointCloud())); + sequentialGroup.addComponent(new JButton(new ShowRain())); + sequentialGroup.addComponent(new JButton(new ShowTextEditors())); + sequentialGroup.addComponent(new JButton(new ShowTextEditors2())); + sequentialGroup.addComponent(new JButton(new ShowGameOfLife())); + sequentialGroup.addComponent(new JButton(new ShowRandomPolygons())); + } + + private static class ShowTextEditors extends AbstractAction { + ShowTextEditors() { + putValue(NAME, "Text editors"); + } + + @Override + public void actionPerformed(final ActionEvent e) { + TextEditorDemo.main(null); + } + } + + private static class ShowTextEditors2 extends AbstractAction { + ShowTextEditors2() { + putValue(NAME, "Text editors city"); + } + + @Override + public void actionPerformed(final ActionEvent e) { + TextEditorDemo2.main(null); + } + } + + + private static class ShowRain extends AbstractAction { + ShowRain() { + putValue(NAME, "Raining numbers"); + } + + @Override + public void actionPerformed(final ActionEvent e) { + RainingNumbersDemo.main(null); + } + } + + private static class ShowPointCloud extends AbstractAction { + ShowPointCloud() { + putValue(NAME, "Point cloud galaxy"); + } + + @Override + public void actionPerformed(final ActionEvent e) { + PointCloudDemo.main(null); + } + } + + private static class ShowMathGraphs extends AbstractAction { + ShowMathGraphs() { + putValue(NAME, "Mathematical graphs"); + } + + @Override + public void actionPerformed(final ActionEvent e) { + GraphDemo.main(null); + } + } + + private static class ShowRandomPolygons extends AbstractAction { + ShowRandomPolygons() { + putValue(NAME, "Random polygons"); + } + + @Override + public void actionPerformed(final ActionEvent e) { + RandomPolygonsDemo.main(null); + } + } + + private static class ShowOctree extends AbstractAction { + ShowOctree() { + putValue(NAME, "Volumetric Octree"); + } + + @Override + public void actionPerformed(final ActionEvent e) { + OctreeDemo.main(null); + } + } + + private static class ShowGameOfLife extends AbstractAction { + ShowGameOfLife() { + putValue(NAME, "Game of Life"); + } + + @Override + public void actionPerformed(final ActionEvent e) { + eu.svjatoslav.sixth.e3d.examples.life_demo.Main.main(null); + } + } + +}