added a test for the particle engine
This commit is contained in:
parent
e3f5017007
commit
d3a6c31dd1
4 changed files with 419 additions and 18 deletions
348
src/ei/engine/test/ParticlesTestFrame.java
Normal file
348
src/ei/engine/test/ParticlesTestFrame.java
Normal file
|
|
@ -0,0 +1,348 @@
|
|||
package ei.engine.test;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import java.awt.Dimension;
|
||||
import javax.swing.JCheckBox;
|
||||
import java.awt.FlowLayout;
|
||||
import javax.swing.JSlider;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class ParticlesTestFrame{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private JFrame jFrame = null; // @jve:decl-index=0:visual-constraint="106,71"
|
||||
private JPanel jContentPane = null;
|
||||
public JCheckBox regenerate = null;
|
||||
public JCheckBox rainbow = null;
|
||||
public JSlider slowdown = null;
|
||||
public JSlider yspeed = null;
|
||||
public JSlider xspeed = null;
|
||||
public JSlider maxSpeedX = null;
|
||||
public JSlider maxSpeedY = null;
|
||||
public JSlider maxSpeedZ = null;
|
||||
private JLabel jLabel = null;
|
||||
private JLabel jLabel1 = null;
|
||||
public JSlider pullForceX = null;
|
||||
public JSlider pullForceY = null;
|
||||
public JSlider pullForceZ = null;
|
||||
private JLabel jLabel2 = null;
|
||||
public JSlider life = null;
|
||||
private JLabel jLabel3 = null;
|
||||
private JLabel jLabel4 = null;
|
||||
private JLabel jLabel5 = null;
|
||||
public JSlider size = null;
|
||||
/**
|
||||
* This method initializes jFrame
|
||||
*
|
||||
* @return javax.swing.JFrame
|
||||
*/
|
||||
public JFrame getJFrame() {
|
||||
if (jFrame == null) {
|
||||
jFrame = new JFrame();
|
||||
jFrame.setSize(new Dimension(219, 627));
|
||||
jFrame.setTitle("ParticleTest");
|
||||
jFrame.setContentPane(getJContentPane());
|
||||
}
|
||||
return jFrame;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes jContentPane
|
||||
*
|
||||
* @return javax.swing.JPanel
|
||||
*/
|
||||
private JPanel getJContentPane() {
|
||||
if (jContentPane == null) {
|
||||
jLabel5 = new JLabel();
|
||||
jLabel5.setText("size");
|
||||
jLabel4 = new JLabel();
|
||||
jLabel4.setText("Speed");
|
||||
jLabel3 = new JLabel();
|
||||
jLabel3.setText("Slowdown");
|
||||
jLabel2 = new JLabel();
|
||||
jLabel2.setText("Life");
|
||||
FlowLayout flowLayout = new FlowLayout();
|
||||
flowLayout.setHgap(5);
|
||||
jLabel1 = new JLabel();
|
||||
jLabel1.setText("pullForce");
|
||||
jLabel = new JLabel();
|
||||
jLabel.setText("MaxSpeed");
|
||||
jContentPane = new JPanel();
|
||||
jContentPane.setLayout(flowLayout);
|
||||
jContentPane.add(getRegenerate(), null);
|
||||
jContentPane.add(getRainbow(), null);
|
||||
jContentPane.add(jLabel3, null);
|
||||
jContentPane.add(getSlowdown(), null);
|
||||
jContentPane.add(jLabel4, null);
|
||||
jContentPane.add(getXspeed(), null);
|
||||
jContentPane.add(getYspeed(), null);
|
||||
jContentPane.add(jLabel, null);
|
||||
jContentPane.add(getMaxSpeedX(), null);
|
||||
jContentPane.add(getMaxSpeedY(), null);
|
||||
jContentPane.add(getMaxSpeedZ(), null);
|
||||
jContentPane.add(jLabel1, null);
|
||||
jContentPane.add(getPullForceX(), null);
|
||||
jContentPane.add(getPullForceY(), null);
|
||||
jContentPane.add(getPullForceZ(), null);
|
||||
jContentPane.add(jLabel2, null);
|
||||
jContentPane.add(getLife(), null);
|
||||
jContentPane.add(jLabel5, null);
|
||||
jContentPane.add(getSize(), null);
|
||||
}
|
||||
return jContentPane;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes regenerate
|
||||
*
|
||||
* @return javax.swing.JCheckBox
|
||||
*/
|
||||
private JCheckBox getRegenerate() {
|
||||
if (regenerate == null) {
|
||||
regenerate = new JCheckBox();
|
||||
regenerate.setSelected(true);
|
||||
regenerate.setText("Regenerate");
|
||||
regenerate.setName("");
|
||||
}
|
||||
return regenerate;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes rainbow
|
||||
*
|
||||
* @return javax.swing.JCheckBox
|
||||
*/
|
||||
private JCheckBox getRainbow() {
|
||||
if (rainbow == null) {
|
||||
rainbow = new JCheckBox();
|
||||
rainbow.setText("Rainbow");
|
||||
rainbow.setName("jCheckBox1");
|
||||
rainbow.setSelected(true);
|
||||
}
|
||||
return rainbow;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes slowdown
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getSlowdown() {
|
||||
if (slowdown == null) {
|
||||
slowdown = new JSlider();
|
||||
slowdown.setMaximum(10);
|
||||
slowdown.setPaintTicks(true);
|
||||
slowdown.setPaintLabels(true);
|
||||
slowdown.setToolTipText("Slowdown");
|
||||
slowdown.setName("Slowdown");
|
||||
slowdown.setSnapToTicks(true);
|
||||
slowdown.setMinorTickSpacing(1);
|
||||
slowdown.setMajorTickSpacing(1);
|
||||
slowdown.setValue(1);
|
||||
}
|
||||
return slowdown;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes yspeed
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getYspeed() {
|
||||
if (yspeed == null) {
|
||||
yspeed = new JSlider();
|
||||
yspeed.setName("yspeed");
|
||||
yspeed.setMaximum(1000);
|
||||
yspeed.setPaintLabels(true);
|
||||
yspeed.setPaintTicks(false);
|
||||
yspeed.setValue(1);
|
||||
yspeed.setSnapToTicks(false);
|
||||
yspeed.setMajorTickSpacing(200);
|
||||
yspeed.setToolTipText("yspeed");
|
||||
}
|
||||
return yspeed;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes xspeed
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getXspeed() {
|
||||
if (xspeed == null) {
|
||||
xspeed = new JSlider();
|
||||
xspeed.setName("xspeed");
|
||||
xspeed.setMaximum(1000);
|
||||
xspeed.setPaintLabels(true);
|
||||
xspeed.setPaintTicks(false);
|
||||
xspeed.setValue(1);
|
||||
xspeed.setSnapToTicks(false);
|
||||
xspeed.setMajorTickSpacing(200);
|
||||
xspeed.setToolTipText("xspeed");
|
||||
}
|
||||
return xspeed;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes maxSpeedX
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getMaxSpeedX() {
|
||||
if (maxSpeedX == null) {
|
||||
maxSpeedX = new JSlider();
|
||||
maxSpeedX.setName("MaxSpeedX");
|
||||
maxSpeedX.setMaximum(1000);
|
||||
maxSpeedX.setPaintLabels(true);
|
||||
maxSpeedX.setPaintTicks(false);
|
||||
maxSpeedX.setValue(400);
|
||||
maxSpeedX.setSnapToTicks(false);
|
||||
maxSpeedX.setMajorTickSpacing(200);
|
||||
maxSpeedX.setToolTipText("MaxSpeedX");
|
||||
}
|
||||
return maxSpeedX;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes maxSpeedY
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getMaxSpeedY() {
|
||||
if (maxSpeedY == null) {
|
||||
maxSpeedY = new JSlider();
|
||||
maxSpeedY.setName("MaxSpeedY");
|
||||
maxSpeedY.setMaximum(1000);
|
||||
maxSpeedY.setPaintLabels(true);
|
||||
maxSpeedY.setPaintTicks(false);
|
||||
maxSpeedY.setValue(400);
|
||||
maxSpeedY.setSnapToTicks(false);
|
||||
maxSpeedY.setMajorTickSpacing(200);
|
||||
maxSpeedY.setToolTipText("MaxSpeedY");
|
||||
}
|
||||
return maxSpeedY;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes maxSpeedZ
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getMaxSpeedZ() {
|
||||
if (maxSpeedZ == null) {
|
||||
maxSpeedZ = new JSlider();
|
||||
maxSpeedZ.setName("MaxSpeedZ");
|
||||
maxSpeedZ.setMaximum(1000);
|
||||
maxSpeedZ.setPaintLabels(true);
|
||||
maxSpeedZ.setPaintTicks(false);
|
||||
maxSpeedZ.setValue(1);
|
||||
maxSpeedZ.setSnapToTicks(false);
|
||||
maxSpeedZ.setMajorTickSpacing(200);
|
||||
maxSpeedZ.setToolTipText("MaxSpeedZ");
|
||||
}
|
||||
return maxSpeedZ;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes pullForceX
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getPullForceX() {
|
||||
if (pullForceX == null) {
|
||||
pullForceX = new JSlider();
|
||||
pullForceX.setName("pullForceX");
|
||||
pullForceX.setMaximum(50);
|
||||
pullForceX.setPaintLabels(true);
|
||||
pullForceX.setPaintTicks(false);
|
||||
pullForceX.setValue(1);
|
||||
pullForceX.setSnapToTicks(true);
|
||||
pullForceX.setMajorTickSpacing(5);
|
||||
pullForceX.setToolTipText("pullForceX");
|
||||
}
|
||||
return pullForceX;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes pullForceY
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getPullForceY() {
|
||||
if (pullForceY == null) {
|
||||
pullForceY = new JSlider();
|
||||
pullForceY.setName("pullForceY");
|
||||
pullForceY.setMaximum(50);
|
||||
pullForceY.setPaintLabels(true);
|
||||
pullForceY.setPaintTicks(false);
|
||||
pullForceY.setValue(1);
|
||||
pullForceY.setSnapToTicks(true);
|
||||
pullForceY.setMajorTickSpacing(5);
|
||||
pullForceY.setToolTipText("pullForceY");
|
||||
}
|
||||
return pullForceY;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes pullForceZ
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getPullForceZ() {
|
||||
if (pullForceZ == null) {
|
||||
pullForceZ = new JSlider();
|
||||
pullForceZ.setName("pullForceZ");
|
||||
pullForceZ.setMaximum(50);
|
||||
pullForceZ.setPaintLabels(true);
|
||||
pullForceZ.setPaintTicks(false);
|
||||
pullForceZ.setValue(1);
|
||||
pullForceZ.setSnapToTicks(true);
|
||||
pullForceZ.setMajorTickSpacing(5);
|
||||
pullForceZ.setToolTipText("pullForceZ");
|
||||
}
|
||||
return pullForceZ;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes life
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getLife() {
|
||||
if (life == null) {
|
||||
life = new JSlider();
|
||||
life.setName("life");
|
||||
life.setMaximum(10);
|
||||
life.setPaintLabels(true);
|
||||
life.setPaintTicks(false);
|
||||
life.setValue(1);
|
||||
life.setSnapToTicks(true);
|
||||
life.setMajorTickSpacing(1);
|
||||
life.setToolTipText("life");
|
||||
}
|
||||
return life;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes size
|
||||
*
|
||||
* @return javax.swing.JSlider
|
||||
*/
|
||||
private JSlider getSize() {
|
||||
if (size == null) {
|
||||
size = new JSlider();
|
||||
size.setName("size");
|
||||
size.setMaximum(50);
|
||||
size.setPaintLabels(true);
|
||||
size.setPaintTicks(false);
|
||||
size.setValue(5);
|
||||
size.setSnapToTicks(true);
|
||||
size.setMajorTickSpacing(5);
|
||||
size.setToolTipText("size");
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue