Java Code Examples for javax.swing.JSlider#getValueIsAdjusting()

The following examples show how to use javax.swing.JSlider#getValueIsAdjusting() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FilterPanel.java    From FoxTelem with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Listen for changes from the slider
 */
@Override
public void stateChanged(ChangeEvent e) {
	JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
    	
    	if (source == freqSlider) {
    		int freq = (int)source.getValue();
    		Config.filterFrequency = freq;
    		Config.save();
    	} else {
    		int len = (int)source.getValue();
    		Config.filterLength = len;
    		Config.save();
    	}
    }
}
 
Example 2
Source File: KwikiPDFToolBar.java    From ET_Redux with Apache License 2.0 6 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    JSlider slider = ((JSlider) e.getSource());

    if (slider.getValueIsAdjusting()) {
        wasChanging = true;
    }

    if (!slider.getValueIsAdjusting() && wasChanging) {
        updateSlidersStatus(slider);

        probabilityChartOptions.put(slider.getName(), Integer.toString(slider.getValue()));

        performFilteringPerSliders(false);

        // oct 2016
        try {
            ((TabbedReportViews) reportTableTabbedPane).refreshTabs();
        } catch (Exception noTabs) {
        }

        wasChanging = false;
    }
}
 
Example 3
Source File: Calendar.java    From jason with GNU Lesser General Public License v3.0 5 votes vote down vote up
@INTERNAL_OPERATION
void updateDay(ChangeEvent ev) {
    JSlider source = (JSlider) ev.getSource();
    if (!source.getValueIsAdjusting()) {
        try {
            ObsProperty prop = getObsProperty("today");
            prop.updateValue(days[(int) s.getValue()]);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }
}
 
Example 4
Source File: TripoliSessionRawDataView.java    From ET_Redux with Apache License 2.0 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider) e.getSource();
    if (!source.getValueIsAdjusting()) {
        int value = ((JSlider) source).getValue();
        dataModelHeight = value;
        if (!isZoomSlidersIndependent()) {
            theOtherSlider.setValue(value);
        }
        ((AbstractRawDataView) sampleSessionDataView).refreshPanel(true, false);
        sessionAnalysisWorkflowManager.revalidateScrollPane();
    }
}
 
Example 5
Source File: TripoliSessionRawDataView.java    From ET_Redux with Apache License 2.0 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider) e.getSource();
    if (!source.getValueIsAdjusting()) {
        int value = source.getValue();
        if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.SESSION)) {
            sessionModelWidth = value;
            SAVED_SessionModelWidth = value;
        } else {
            dataModelWidth = value;
            if (tripoliSession.getFractionationTechnique().compareTo(FractionationTechniquesEnum.INTERCEPT) == 0) {
                if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.OVERLAY)) {
                    SAVED_InterceptOverlayModelWidth = value;
                } else {
                    SAVED_InterceptNormalModelWidth = value;
                }
            } else if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.OVERLAY)) {
                SAVED_DownholeOverlayModelWidth = value;
            } else {
                SAVED_DownholeNormalModelWidth = value;
            }
        }
        if (!isZoomSlidersIndependent()) {
            theOtherSlider.setValue(value);
        }
        ((AbstractRawDataView) sampleSessionDataView).refreshPanel(true, false);
        sessionAnalysisWorkflowManager.revalidateScrollPane();
    }
}
 
Example 6
Source File: SimulateControlPanel.java    From VanetSim with GNU General Public License v3.0 5 votes vote down vote up
/**
 * An implemented <code>ChangeListener</code> for the zooming slider which performs the necessary actions.
 * 
 * @param e a <code>ChangeEvent</code>
 */	
public void stateChanged(ChangeEvent e) {		
	JSlider source = (JSlider)e.getSource();
	if (!source.getValueIsAdjusting()) {	// only perform action when mouse button is released!
		int value = source.getValue();
		double scale = Math.exp(value/50.0)/1000;
		if(dontReRenderZoom_) dontReRenderZoom_ = false;
		else{
			Renderer.getInstance().setMapZoom(scale);
			ReRenderManager.getInstance().doReRender();
		}
	}
}