List of usage examples for javax.swing.event ChangeEvent getSource
public Object getSource()
From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java
private void snowPoleSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_snowPoleSpinnerStateChanged {//GEN-HEADEREND:event_snowPoleSpinnerStateChanged final JSpinner source = (JSpinner) evt.getSource(); final TerrainParameters params = this.parent.getParameters().getTerrainParameters(); params.setSnowlinePole(((float) ((Integer) source.getValue()).intValue()) / 100.0f); }
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 riverSeedSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_riverSeedSpinnerStateChanged {//GEN-HEADEREND:event_riverSeedSpinnerStateChanged final JSpinner source = (JSpinner) evt.getSource(); final TerrainParameters params = this.parent.getParameters().getTerrainParameters(); params.setRiversSeed((Integer) source.getValue()); }
From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java
private void noiseTermSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_noiseTermSpinnerStateChanged {//GEN-HEADEREND:event_noiseTermSpinnerStateChanged final JSpinner source = (JSpinner) evt.getSource(); final TerrainParameters params = this.parent.getParameters().getTerrainParameters(); params.setNoiseTerms((Integer) source.getValue()); }
From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java
private void powerLawSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_powerLawSpinnerStateChanged {//GEN-HEADEREND:event_powerLawSpinnerStateChanged final JSpinner source = (JSpinner) evt.getSource(); final TerrainParameters params = this.parent.getParameters().getTerrainParameters(); params.setPowerLaw(((float) ((Integer) source.getValue()).intValue()) / 100.0f); if (log.isDebugEnabled()) { log.debug("Power law set to: " + params.getPowerLaw()); }// w w w. j ava 2 s .co m }
From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java
private void cloudsSeedSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_cloudsSeedSpinnerStateChanged {//GEN-HEADEREND:event_cloudsSeedSpinnerStateChanged final JSpinner source = (JSpinner) evt.getSource(); final CloudParameters params = this.parent.getParameters().getCloudParameters(); Integer intval = (Integer) source.getValue(); params.setSeed(intval);/*from w w w . j a v a 2 s . c o m*/ }
From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java
private void terrainSeedSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_terrainSeedSpinnerStateChanged {//GEN-HEADEREND:event_terrainSeedSpinnerStateChanged final JSpinner source = (JSpinner) evt.getSource(); final TerrainParameters params = this.parent.getParameters().getTerrainParameters(); params.setTerrainSeed((Integer) source.getValue()); }
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.joey.software.regionSelectionToolkit.controlers.ImageProfileToolDynamicRangePanel.java
public JPanel getControls() { if (controls == null) { controls = new JPanel(new BorderLayout()); JPanel dirButton = new JPanel(new GridLayout(1, 2)); dirButton.add(moveUpData);/*from www . j a v a2 s. c o m*/ dirButton.add(moveDownData); JPanel pointsPanel = new JPanel(new BorderLayout()); pointsPanel.add(saveData, BorderLayout.NORTH); pointsPanel.add(numPoints, BorderLayout.CENTER); pointsPanel.add(updatePoints, BorderLayout.EAST); pointsPanel.add(showFlattenedButton, BorderLayout.SOUTH); JPanel offsetPane = new JPanel(new BorderLayout()); offsetPane.add(showOffset, BorderLayout.WEST); offsetPane.add(offset, BorderLayout.CENTER); JPanel temp = new JPanel(new BorderLayout()); temp.add(offsetPane, BorderLayout.NORTH); temp.add(transparance, BorderLayout.CENTER); JPanel toolPanel = new JPanel(new BorderLayout()); toolPanel.add(dirButton, BorderLayout.NORTH); toolPanel.add(pointsPanel, BorderLayout.CENTER); toolPanel.add(temp, BorderLayout.SOUTH); controls.add(toolPanel, BorderLayout.NORTH); transparance.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { panel.repaint(); } }); showOffset.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { panel.repaint(); } }); offset.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { panel.shapeChanged(); panel.repaint(); } }); showFlattenedButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { showFlattenedImage(); } }); updatePoints.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setDataPoints((Integer) numPoints.getValue()); } }); moveUPTimer = new Timer(delay, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { addValue(1.0f / view.getImage().getImage().getHeight()); } }); moveDownTimer = new Timer(delay, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { addValue(-1.0f / view.getImage().getImage().getHeight()); } }); moveUpData.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { JButton btn2 = (JButton) e.getSource(); ButtonModel model = btn2.getModel(); if (model.isPressed() && !moveUPTimer.isRunning()) { moveUPTimer.start(); } else if (!model.isPressed() && moveUPTimer.isRunning()) { moveUPTimer.stop(); } } }); moveDownData.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { JButton btn2 = (JButton) e.getSource(); ButtonModel model = btn2.getModel(); if (model.isPressed() && !moveDownTimer.isRunning()) { moveDownTimer.start(); } else if (!model.isPressed() && moveDownTimer.isRunning()) { moveDownTimer.stop(); } } }); moveUpData.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { addValue(1.0f / view.getImage().getImage().getHeight()); } }); moveDownData.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { addValue(-1.0f / view.getImage().getImage().getHeight()); } }); saveData.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { saveData(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }); } return controls; }
From source file:com.alvermont.terraj.fracplanet.ui.ControlsDialog.java
private void fogDistanceSpinnerStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_fogDistanceSpinnerStateChanged {//GEN-HEADEREND:event_fogDistanceSpinnerStateChanged final JSpinner source = (JSpinner) evt.getSource(); float value = ((Integer) fogDistanceSpinner.getValue()) / 100.0f; this.parent.getParameters().getRenderParameters().setFogDistance(value); }