- make EffectTrackVisualPanel not fail when no particle emitter is available

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9815 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent d0bbaec461
commit b545fffcbd
  1. 19
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/actions/impl/tracks/EffectTrackVisualPanel1.java

@ -48,7 +48,9 @@ public final class EffectTrackVisualPanel1 extends JPanel {
Spatial rootNode;
JmeAnimation animation;
/** Creates new form EffectTrackVisualPanel1 */
/**
* Creates new form EffectTrackVisualPanel1
*/
public EffectTrackVisualPanel1(Spatial rootNode, JmeAnimation animation) {
this.rootNode = rootNode;
this.animation = animation;
@ -59,9 +61,12 @@ public final class EffectTrackVisualPanel1 extends JPanel {
populateModel(rootNode, model);
jComboBox1.setModel(model);
jComboBox1.setRenderer(new ListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
return new JLabel(((Spatial) value).getName());
if (value instanceof Spatial) {
return new JLabel(((Spatial) value).getName());
} else{
return new JLabel("?");
}
}
});
jSlider1.setMaximum((int) (animation.getLookup().lookup(Animation.class).getLength() * 100));
@ -91,10 +96,10 @@ public final class EffectTrackVisualPanel1 extends JPanel {
return (float) jSlider1.getValue() / 100f;
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

Loading…
Cancel
Save