use of javax.swing.BoundedRangeModel in project jvm-tools by aragozin.
the class HeapProgress method progress.
private static void progress(final long value, final long endOffset, final long startOffset) {
BoundedRangeModel model = (BoundedRangeModel) progressThreadLocal.get();
if (model != null) {
long val = PROGRESS_MAX * (value - startOffset) / (endOffset - startOffset);
setValue(model, (int) val);
}
}
use of javax.swing.BoundedRangeModel in project JMRI by JMRI.
the class DecVarSlider method stateChanged.
@Override
public void stateChanged(ChangeEvent e) {
// called for new values of a slider - set the variable value as needed
// e.getSource() points to the JSlider object - find it in the list
JSlider j = (JSlider) e.getSource();
BoundedRangeModel r = j.getModel();
_var.setIntValue(r.getValue());
_var.setState(AbstractValue.EDITED);
}
use of javax.swing.BoundedRangeModel in project JMRI by JMRI.
the class IndexedPairVarSlider method stateChanged.
@Override
public void stateChanged(ChangeEvent e) {
// called for new values of a slider - set the variable value as needed
// e.getSource() points to the JSlider object - find it in the list
JSlider j = (JSlider) e.getSource();
BoundedRangeModel r = j.getModel();
_iVar.setIntValue(r.getValue());
_iVar.setState(AbstractValue.EDITED);
}
use of javax.swing.BoundedRangeModel in project jvm-tools by aragozin.
the class HeapProgress method progressFinish.
static void progressFinish() {
BoundedRangeModel model = (BoundedRangeModel) progressThreadLocal.get();
if (model != null) {
setValue(model, PROGRESS_MAX);
progressThreadLocal.remove();
}
}
use of javax.swing.BoundedRangeModel in project jvm-tools by aragozin.
the class HeapProgress method getProgress.
public static BoundedRangeModel getProgress() {
BoundedRangeModel model = (BoundedRangeModel) progressThreadLocal.get();
if (model == null) {
model = new DefaultBoundedRangeModel(0, 0, 0, PROGRESS_MAX);
progressThreadLocal.set(model);
}
return model;
}
Aggregations