Example usage for javax.swing JSpinner getValue

List of usage examples for javax.swing JSpinner getValue

Introduction

In this page you can find the example usage for javax.swing JSpinner getValue.

Prototype

public Object getValue() 

Source Link

Document

Returns the current value of the model, typically this value is displayed by the editor.

Usage

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void snowEquatorSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_snowEquatorSpinnerStateChanged
{//GEN-HEADEREND:event_snowEquatorSpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();
    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    params.setSnowlineEquator(((float) ((Integer) source.getValue()).intValue()) / 100.0f);
}

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void horizPeturbSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_horizPeturbSpinnerStateChanged
{//GEN-HEADEREND:event_horizPeturbSpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();
    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    final float value = (float) (((Integer) source.getValue()).intValue()) / 100.0f;

    params.getVariation().setX(value);//w  w  w  .  j  a va  2 s.  c  om

    if (log.isDebugEnabled()) {
        log.debug("Horizontal peturbation set to: " + params.getVariation().getX());
    }
}

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void vertPeturbSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_vertPeturbSpinnerStateChanged
{//GEN-HEADEREND:event_vertPeturbSpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();
    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    final float value = (float) (((Integer) source.getValue()).intValue()) / 100.0f;

    params.getVariation().setZ(value);//from   w w  w  .  ja v  a  2  s  .  c  om

    if (log.isDebugEnabled()) {
        log.debug("Vertical peturbation set to: " + params.getVariation().getZ());
    }
}

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void snowPowerLawSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_snowPowerLawSpinnerStateChanged
{//GEN-HEADEREND:event_snowPowerLawSpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();
    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    params.setSnowlinePowerLaw(((float) ((Integer) source.getValue()).intValue()) / 100.0f);
}

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void unperturbedSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_unperturbedSpinnerStateChanged
{//GEN-HEADEREND:event_unperturbedSpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();
    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    params.setSubdivisionsUnperturbed((Integer) source.getValue());

    if (log.isDebugEnabled()) {
        log.debug("Subdivisions set to: " + params.getSubdivisions());
    }/*from  ww w.  j  a v a 2  s . c o m*/
}

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void noiseAmplitudeSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_noiseAmplitudeSpinnerStateChanged
{//GEN-HEADEREND:event_noiseAmplitudeSpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();
    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    params.setNoiseAmplitude(((float) ((Integer) source.getValue()).intValue()) / 100.0f);

    if (log.isDebugEnabled()) {
        log.debug("Noise amplitude set to: " + params.getNoiseAmplitude());
    }//  ww  w  . jav  a 2  s . co  m
}

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void noiseFrequencySpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_noiseFrequencySpinnerStateChanged
{//GEN-HEADEREND:event_noiseFrequencySpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();
    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    params.setNoiseFrequency(((float) ((Integer) source.getValue()).intValue()) / 100.0f);

    if (log.isDebugEnabled()) {
        log.debug("Noise frequency set to: " + params.getNoiseFrequency());
    }//from   w  w  w.ja v a 2s.  com
}

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void snowSlopeSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_snowSlopeSpinnerStateChanged
{//GEN-HEADEREND:event_snowSlopeSpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();
    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    params.setSnowlineSlopeEffect(((float) ((Integer) source.getValue()).intValue()) / 100.0f);
}

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void snowGlacierSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_snowGlacierSpinnerStateChanged
{//GEN-HEADEREND:event_snowGlacierSpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();

    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    params.setSnowlineGlacierEffect(((float) ((Integer) source.getValue()).intValue()) / 100.0f);
}

From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java

private void noiseAmplitudeDecaySpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_noiseAmplitudeDecaySpinnerStateChanged
{//GEN-HEADEREND:event_noiseAmplitudeDecaySpinnerStateChanged

    final JSpinner source = (JSpinner) evt.getSource();
    final TerrainParameters params = this.parent.getParameters().getTerrainParameters();

    params.setNoiseAmplitudeDecay(((float) ((Integer) source.getValue()).intValue()) / 100.0f);

    if (log.isDebugEnabled()) {
        log.debug("Noise amplitude decay set to: " + params.getNoiseAmplitudeDecay());
    }/*from w w  w .  j a va 2 s.  co  m*/
}