List of usage examples for java.awt.event AdjustmentEvent getSource
public Object getSource()
From source file:Main.java
public void adjustmentValueChanged(AdjustmentEvent evt) { Object source = evt.getSource(); int newValue = bar.getValue(); System.out.println(newValue); repaint();/* www . ja v a 2s .co m*/ }
From source file:edu.pdi2.visual.ThresholdSignature.java
private void scrollBarAdjustmentValueChanged(AdjustmentEvent evt) { Integer index = (Integer) evt.getSource(); valueLabels[index].setText(Integer.toString(evt.getValue())); banda[index] = evt.getValue();//from w w w.j ava2 s. c o m plot(); }
From source file:com.pingtel.sipviewer.SIPViewerFrame.java
@Override public void adjustmentValueChanged(AdjustmentEvent e) { // we detect which vertical bar has been adjusted then // we make same scroll changes to the index column // that shows time, also scrolling in time index column // triggers scrolling in the respective scroll pane if (e.getSource().equals(m_scrollPaneVBar)) m_scrollPaneTimeIndexVBar.setValue(e.getValue()); else if (e.getSource().equals(m_scrollPaneVBarSecond)) m_scrollPaneTimeIndexVBarSecond.setValue(e.getValue()); else if (e.getSource().equals(m_scrollPaneTimeIndexVBar)) m_scrollPaneVBar.setValue(e.getValue()); else if (e.getSource().equals(m_scrollPaneTimeIndexVBarSecond)) m_scrollPaneVBarSecond.setValue(e.getValue()); }
From source file:edu.ucla.stat.SOCR.analyses.gui.NormalPower.java
public void adjustmentValueChanged(AdjustmentEvent e) { if (e.getSource() == sampleSizeBar) { int tempSampleSize = sampleSizeBar.getValue(); sampleSizeText.setText(tempSampleSize + ""); this.sampleSize = tempSampleSize; ////////////System.out.println("sampleSizeBar.getValue() = " + tempSampleSize); if (useSampleSize) { hypothesisPanel.setVisible(true); sampleSizePanel.setVisible(true); powerPanel.setVisible(false); this.power = 0; powerText.setText(""); } else if (usePower) { hypothesisPanel.setVisible(true); sampleSizePanel.setVisible(false); powerPanel.setVisible(true); this.sampleSize = 0; sampleSizeText.setText(""); }//from w w w. j a va 2s.c om } else if (e.getSource() == powerBar) { int tempPower = powerBar.getValue(); if (tempPower == Double.NaN) { tempPower = 95; } powerText.setText("." + tempPower); this.power = .01 * tempPower; ////////////System.out.println("set powerBar.getValue() = " + tempPower); if (useSampleSize) { hypothesisPanel.setVisible(true); sampleSizePanel.setVisible(true); powerPanel.setVisible(false); this.power = 0; powerText.setText(""); } else if (usePower) { hypothesisPanel.setVisible(true); sampleSizePanel.setVisible(false); powerPanel.setVisible(true); this.sampleSize = 0; sampleSizeText.setText(""); } } }