當前位置: 首頁>>代碼示例>>Java>>正文


Java JSlider.getValueIsAdjusting方法代碼示例

本文整理匯總了Java中javax.swing.JSlider.getValueIsAdjusting方法的典型用法代碼示例。如果您正苦於以下問題:Java JSlider.getValueIsAdjusting方法的具體用法?Java JSlider.getValueIsAdjusting怎麽用?Java JSlider.getValueIsAdjusting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JSlider的用法示例。


在下文中一共展示了JSlider.getValueIsAdjusting方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: stateChanged

import javax.swing.JSlider; //導入方法依賴的package包/類
@Override
    public void stateChanged(ChangeEvent e) {
                       JSlider source = (JSlider)e.getSource();
        if (!source.getValueIsAdjusting()) {
            int fps = source.getValue();
            String varName = source.getName();
            //regenerate data set and repaint
               int i;
            for( i = 1; i<vars.size();i++)
               if(vars.get(i).contentEquals(varName))
                   break;
           varsValues.set(i,rangesLeft.get(i).add(steps.get(i).multiply(new BigDecimal(fps))));
          //System.out.println(i); 
String   chartName=FunctionToPlot;


    for(int j = 1; j < vars.size();j++){
        chartName = SmartReplace.get(chartName,vars.get(j),varsValues.get(j).toPlainString()); 
         //chartName = chartName.replace(vars.get(j),varsValues.get(j).toPlainString()); 
        sliderLabels[j-1].setText(vars.get(j)+'='+varsValues.get(j).toPlainString());
      }
try{
       chartP.setChart(createChart(getDataset(),chartName));
}
catch(Exception ex){
 System.out.println(ex.getMessage());
}
    // chartPanel = new ChartPanel(chart);
    
//contentPanel.repaint();
//this.repaint();
//this.setVisible(true);
}
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
 
開發者ID:mathhobbit,項目名稱:EditCalculateAndChart,代碼行數:36,代碼來源:grPlt.java

示例2: stateChanged

import javax.swing.JSlider; //導入方法依賴的package包/類
@Override
    public void stateChanged(ChangeEvent e) {
               JSlider source = (JSlider)e.getSource();
        if (!source.getValueIsAdjusting()) {
            int fps = source.getValue();
            String varName = source.getName();
            //regenerate data set and repaint
               int i;
            for( i = 1; i<vars.size();i++)
               if(vars.get(i).contentEquals(varName))
                   break;
           varsValues.set(i,rangesLeft.get(i).add(steps.get(i).multiply(new BigDecimal(fps))));
          //System.out.println(i); 
String   chartName=FunctionToPlot;


    for(int j = 1; j < vars.size();j++){
        chartName = SmartReplace.get(chartName,vars.get(j),varsValues.get(j).toPlainString()); 
         //chartName = chartName.replace(vars.get(j),varsValues.get(j).toPlainString()); 
        sliderLabels[j-1].setText(vars.get(j)+'='+varsValues.get(j).toPlainString());
      }
try{
       chartP.setChart(createPolarChart(getDataset(),chartName));
}
catch(Exception ex){
 System.out.println(ex.getMessage());
}
    // chartPanel = new ChartPanel(chart);
    
//contentPanel.repaint();
//this.repaint();
//this.setVisible(true);
}
}
 
開發者ID:mathhobbit,項目名稱:EditCalculateAndChart,代碼行數:35,代碼來源:plrPlt.java

示例3: setServo

import javax.swing.JSlider; //導入方法依賴的package包/類
void setServo (int servo,ChangeEvent evt){
    if(hwInterface==null){
        log.warning("interface is null");
        return;
    }
    if ( !( evt.getSource() instanceof JSlider ) ){
        log.warning("evt not from a slider: " + evt);
    }
    JSlider slider = (JSlider)evt.getSource();
    if ( !liveSlidersEnabled && slider.getValueIsAdjusting() ){
        return;
    }
    float f = (float)slider.getValue() / MAX_SLIDER;
    if ( hwInterface == null ){
        log.warning("null hardware interface");
        return;
    }
    try{
        if ( synchronizeCheckBox.isSelected() ){
            setAllServos(f);
        } else{
            hwInterface.setServoValue(servo,f);
        }
    } catch ( HardwareInterfaceException e ){
        e.printStackTrace();
    }
}
 
開發者ID:SensorsINI,項目名稱:jaer,代碼行數:28,代碼來源:ServoTest.java


注:本文中的javax.swing.JSlider.getValueIsAdjusting方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。