code.append("particles.setRenderState(zstate);\n");
code.append(name + ".setRenderState(zstate);\n");
    private void regenCode() {        StringBuffer code = new StringBuffer();        if (particleMesh == null) {            codeTextArea.setText("");            return;        }        code.append("ParticleMesh particles = ParticleFactory.buildParticles(\"myParticles\", "                + particleMesh.getNumParticles()                + ");\n");        code.append("particles.setGravityForce("                + codeString(particleMesh.getGravityForce())                + ");\n");        code.append("particles.setEmissionDirection("                + codeString(particleMesh.getEmissionDirection())                + ");\n");        code.append("particles.setMaximumAngle("                + particleMesh.getMaximumAngle()                + "f);\n");        code.append("particles.setMinimumAngle("                + particleMesh.getMinimumAngle()                + "f);\n");        code.append("particles.setSpeed(" + particleMesh.getParticleController().getSpeed()                + "f);\n");        code.append("particles.setMinimumLifeTime("                + particleMesh.getMinimumLifeTime()                + "f);\n");        code.append("particles.setMaximumLifeTime("                + particleMesh.getMaximumLifeTime()                + "f);\n");        code.append("particles.setStartSize("                + particleMesh.getStartSize() + "f);\n");        code.append("particles.setEndSize("                + particleMesh.getEndSize() + "f);\n");        code.append("particles.setStartColor("                + codeString(particleMesh.getStartColor())                + ");\n");        code.append("particles.setEndColor("                + codeString(particleMesh.getEndColor()) + ");\n");        code.append("particles.setRandomMod("                + particleMesh.getRandomMod() + "f);\n");        code.append("particles.setControlFlow("                + particleMesh.getParticleController().getControlFlow() + ");\n");        code.append("particles.setReleaseRate("                + particleMesh.getReleaseRate() + ");\n");        code.append("particles.setReleaseVariance("                + particleMesh.getReleaseVariance() + "f);\n");        code.append("particles.setInitialVelocity("                + particleMesh.getInitialVelocity() + "f);\n");        code.append("particles.setParticleSpinSpeed("                + particleMesh.getParticleSpinSpeed() + "f);\n");        code.append("\n");        code.append("particles.warmUp(1000);\n");        code.append("\n");        code.append("particles.setRenderState(YOUR TEXTURE STATE);\n");        code.append("particles.setRenderState(YOUR ALPHA STATE);\n");        code.append("ZBufferState zstate = DisplaySystem.getDisplaySystem().getRenderer().createZBufferState();\n");        code.append("zstate.setEnabled(false);\n");        code.append("particles.setRenderState(zstate);\n");        codeTextArea.setText(code.toString());        codeTextArea.setCaretPosition(0);    }