当前位置: 首页>>代码示例>>Java>>正文


Java ChangeEvent.getSource方法代码示例

本文整理汇总了Java中javax.swing.event.ChangeEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java ChangeEvent.getSource方法的具体用法?Java ChangeEvent.getSource怎么用?Java ChangeEvent.getSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.event.ChangeEvent的用法示例。


在下文中一共展示了ChangeEvent.getSource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
/** delayed change of query text */
@Override
public void stateChanged (ChangeEvent e) {
    Document doc = (Document)e.getSource();
    try {
        curTypedText = doc.getText(0, doc.getLength()).trim();
    } catch (BadLocationException ex) {
        // should never happen, nothing we can do probably
        return;
    }

    AddDependencyPanel.this.searchField.setForeground(defSearchC);

    if (curTypedText.length() > 0) {
        find(curTypedText);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:AddDependencyPanel.java

示例2: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
public void stateChanged(ChangeEvent e) {
    if (e.getSource() == measureTimestampRadio) {
        updateValidity();
    }

    if (e.getSource() == measureTimestampDurationRadio) {
        boolean selected = measureTimestampDurationRadio.isSelected();
        locationEndCustomizer.setEnabled(selected);
        locationEndHeaderLabel.setEnabled(selected);
        locationEndHeaderSeparator.setEnabled(selected);

        CodeProfilingPoint.Location endLocation = getPPEndLocation();

        if (selected && (endLocation != null) && (endLocation.getFile().trim().length() == 0)) {
            CodeProfilingPoint.Location startLocation = getPPStartLocation();
            CodeProfilingPoint.Location newEndLocation = new CodeProfilingPoint.Location(startLocation.getFile(),
                                                                                         startLocation.getLine() + 1,
                                                                                         CodeProfilingPoint.Location.OFFSET_END);
            locationEndCustomizer.setPPLocation(newEndLocation);
        }

        updateValidity();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:StopwatchCustomizer.java

示例3: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e) {
    Object source = e.getSource();
    if (source instanceof Collection) {
        FileObject bfo = this.fo;
        if (bfo == null) {
            return ;
        }
        for (Object obj : ((Collection) source)) {
            DataObject dobj = (DataObject) obj;
            FileObject primary = dobj.getPrimaryFile();
            if (bfo.equals(primary)) {
                synchronized (this) {
                    dobjRef = new WeakReference<DataObject>(dobj);
                    dobjwl = WeakListeners.propertyChange(this, dobj);
                    dobj.addPropertyChangeListener(dobjwl);
                    if (registryListener != null) {
                        DataObject.getRegistry().removeChangeListener(registryListener);
                        registryListener = null;
                    }
                }
                break;
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:FileMoveBreakpointsHandler.java

示例4: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(final ChangeEvent event) {
    Map.Entry<URL,JavaFileFilterImplementation>[] entries;
    synchronized (this.listensOn) {
        entries = listensOn.entrySet().toArray(new Map.Entry[listensOn.size()]);
    }
    final Object source = event.getSource();
    for (Map.Entry<URL,JavaFileFilterImplementation> entry : entries) {
        if (entry.getValue().equals(source)) {
            final URL root = entry.getKey();
            try {
                verify(root);
            } catch (IOException ioe) {
                Exceptions.printStackTrace(ioe);
            } catch (URISyntaxException use) {
                Exceptions.printStackTrace(use);
            } finally {
                IndexingManager.getDefault().refreshIndex(root, null, true);
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:JavaFileFilterListener.java

示例5: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e) {
    if (e.getSource() == probSlider) {
        prob = probSlider.getValue() / 10.0;

        ShiftedGeometricDistribution dist = new ShiftedGeometricDistribution(prob);

        double[][] p = new double[11][2];
        double[][] q = new double[11][2];
        for (int i = 0; i < p.length; i++) {
            p[i][0] = i;
            p[i][1] = dist.p(p[i][0]);
            q[i][0] = i;
            q[i][1] = dist.cdf(p[i][0]);
        }

        pdf.clear();
        pdf.add(new BarPlot(p));

        cdf.clear();
        cdf.staircase(q, Color.BLACK);

        double[] data = new double[500];
        for (int i = 0; i < data.length; i++) {
            data[i] = dist.rand();
        }

        histogram.clear();
        histogram.histogram(data, 10, Color.BLUE);
    }
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:32,代码来源:ShiftedGeometricDistributionDemo.java

示例6: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e) {
    if (enabled) {
        TextDetail td = (TextDetail) e.getSource();
        int origMatchesSelected = selectedMatchesCount;
        selectedMatchesCount += td.isSelected() ? 1 : -1;
        changeSupport.firePropertyChange(PROP_MATCHES_SELECTED,
                origMatchesSelected, selectedMatchesCount);
        if (selected && selectedMatchesCount == 0) {
            setSelected(false);
        } else if (!selected && selectedMatchesCount > 0) {
            setSelected(true);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:MatchingObject.java

示例7: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的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

示例8: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
public void stateChanged(ChangeEvent e) {
    if (e.getSource() == saveToProjectRadio) {
        updateValidity();
    } else if (e.getSource() == saveToFileRadio) {
        saveToFileField.setEnabled(saveToFileRadio.isSelected());
        saveToFileButton.setEnabled(saveToFileRadio.isSelected());
        updateValidity();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:SnapshotCustomizer.java

示例9: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent ce) {
	if (this.enabledChangeListener==true) {
		Object ceTrigger = ce.getSource();
		if (ceTrigger instanceof JSpinner) {
			this.saveTimeModelToSimulationSetup();	
		}	
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:10,代码来源:TimeModelContinuousConfiguration.java

示例10: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(final ChangeEvent e) {
	if (!(e.getSource() instanceof JSlider)) {
		return;
	}
	final JSlider sizeSlider = (JSlider) e.getSource();
	this.changeTreeProportions(sizeSlider.getValue());
}
 
开发者ID:ZabuzaW,项目名称:TreeFlood,代码行数:9,代码来源:LocalStorageExplorationGUIController.java

示例11: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e) {
    if (e.getSource() == sigmaSlider) {
        sigma = sigmaSlider.getValue() / 10.0;
        if (sigma == 0) sigma = 0.01;

        GaussianDistribution dist = new GaussianDistribution(0, sigma);

        double[][] p = new double[200][2];
        double[][] q = new double[200][2];
        for (int i = 0; i < p.length; i++) {
            p[i][0] = (i - 100) / 10.0;
            p[i][1] = dist.p(p[i][0]);
            q[i][0] = (i - 100) / 10.0;
            q[i][1] = dist.cdf(p[i][0]);
        }

        pdf.clear();
        pdf.line(p, Line.Style.SOLID, Color.BLUE);

        cdf.clear();
        cdf.line(q, Line.Style.SOLID, Color.BLUE);

        double[] data = new double[500];
        for (int i = 0; i < data.length; i++) {
            data[i] = dist.rand();
        }

        histogram.clear();
        histogram.histogram(data, 20, Color.BLUE);

        qqplot.clear();
        qqplot.add(new QQPlot(data, dist));
        canvas.repaint();
    }
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:37,代码来源:GaussianDistributionDemo.java

示例12: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e) {
    SingleSelectionModel model = (SingleSelectionModel) e.getSource();
    if (model.getSelectedIndex() == 0) {
        currentControls = buttons;
    } else if (model.getSelectedIndex() == 1) {
        currentControls = radiobuttons;
    } else if (model.getSelectedIndex() == 2) {
        currentControls = checkboxes;
    } else {
        currentControls = togglebuttons;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:ToggleButtonDemo.java

示例13: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e) {
    if (jTabbedPane == e.getSource()) {
        if (jTabbedPane.getSelectedComponent() == jSplitPane1) {
            updateCurrentDifference(null);
        } else {
            setDifferenceIndex(-1);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:EditableDiffView.java

示例14: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e) {
    if (e.getSource() == probSlider) {
        prob = probSlider.getValue() / 10.0;

        BernoulliDistribution dist = new BernoulliDistribution(prob);

        double[][] p = new double[2][2];
        double[][] q = new double[2][2];
        for (int i = 0; i < p.length; i++) {
            p[i][0] = i;
            p[i][1] = dist.p(p[i][0]);
            q[i][0] = i;
            q[i][1] = dist.cdf(p[i][0]);
        }

        pdf.clear();
        pdf.add(new BarPlot(p));

        cdf.clear();
        cdf.staircase(q, Color.BLACK);

        double[] data = new double[500];
        for (int i = 0; i < data.length; i++) {
            data[i] = dist.rand();
        }

        histogram.clear();
        histogram.histogram(data, 2, Color.BLUE);
    }
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:32,代码来源:BernoulliDistributionDemo.java

示例15: stateChanged

import javax.swing.event.ChangeEvent; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e) {
    //  Keep the scrolling of the row table in sync with main table
    JViewport viewport = (JViewport) e.getSource();
    JScrollPane scrollPane = (JScrollPane) viewport.getParent();
    scrollPane.getVerticalScrollBar().setValue(viewport.getViewPosition().y);
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:8,代码来源:Table.java


注:本文中的javax.swing.event.ChangeEvent.getSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。