Search in sources :

Example 1 with DynamicsModifier

use of com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier in project libgdx by libgdx.

the class DynamicsInfluencerPanel method velocitySelected.

protected void velocitySelected() {
    //Show the velocity value panel
    int index = velocityTable.getSelectedRow();
    if (index == -1)
        return;
    DynamicsModifier velocityValue = velocities.get(index).velocityValue;
    EditorPanel velocityPanel = getVelocityPanel(velocityValue);
    //Show the selected velocity
    if (selectedVelocityPanel != null && selectedVelocityPanel != velocityPanel)
        selectedVelocityPanel.setVisible(false);
    velocityPanel.setVisible(true);
    velocityPanel.showContent(true);
    selectedVelocityPanel = velocityPanel;
}
Also used : DynamicsModifier(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier)

Example 2 with DynamicsModifier

use of com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier in project libgdx by libgdx.

the class DynamicsInfluencerPanel method set.

private void set(DynamicsInfluencer influencer) {
    //Clear
    for (int i = velocityTableModel.getRowCount() - 1; i >= 0; i--) {
        velocityTableModel.removeRow(i);
    }
    velocities.clear();
    //Add
    for (int i = 0, c = influencer.velocities.size; i < c; ++i) {
        velocities.add(new VelocityWrapper((DynamicsModifier) influencer.velocities.items[i], true));
        velocityTableModel.addRow(new Object[] { "Velocity " + i, true });
    }
    DefaultComboBoxModel model = (DefaultComboBoxModel) velocityBox.getModel();
    model.removeAllElements();
    for (Object velocityObject : getAvailableVelocities(editor.getControllerType())) {
        model.addElement(velocityObject);
    }
}
Also used : DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) DynamicsModifier(com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier)

Aggregations

DynamicsModifier (com.badlogic.gdx.graphics.g3d.particles.influencers.DynamicsModifier)2 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)1