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