int value = scrollBar.getValue(); int maximum = scrollBar.getMaximum(); int visibleAmount = scrollBar.getVisibleAmount(); if(lastMaximum < maximum && lastMaximum - visibleAmount - value == 0) { value = scrollBar.getValue() + (maximum - lastMaximum); scrollBar.setVisibleAmount(visibleAmount); if(scrollBar.getValue() != value) { scrollBar.setValue(value);
public int getValue() { return bar.getValue(); } public int getVisibleAmount() {
public synchronized void adjustmentValueChanged(AdjustmentEvent e) { value = slider.getValue(); setText = true; notify(); }
public synchronized void adjustmentValueChanged(AdjustmentEvent e) { value = slider.getValue(); setText = true; notify(); }
public synchronized void adjustmentValueChanged(AdjustmentEvent e) { Object source = e.getSource(); if (source==minSlider) minSliderValue = minSlider.getValue(); else if (source==maxSlider) maxSliderValue = maxSlider.getValue(); else if (source==contrastSlider) contrastValue = contrastSlider.getValue(); else brightnessValue = brightnessSlider.getValue(); notify(); }
public synchronized void mouseWheelMoved(MouseWheelEvent e) { if (e.getSource()==minSlider || e.getSource()==minLabel) { minSlider.setValue(minSlider.getValue() + e.getWheelRotation()); minValue = minSlider.getValue(); } else { maxSlider.setValue(maxSlider.getValue() + e.getWheelRotation()); maxValue = maxSlider.getValue(); } notify(); }
/** Updates the ImagePlus's displayed plane to match the slider values. */ private void syncPlane() { for (int i=0; i<cSliders.length; i++) { cIndex[i] = cSliders[i].getValue() - 1; } int c = FormatTools.positionToRaster(cLengths, cIndex) + 1; int z = zScroll == null ? 1 : zScroll.getValue(); int t = tScroll == null ? 1 : tScroll.getValue(); setPosition(c, z, t); imp.setPosition(c, z, t); }
@Override public void adjustmentValueChanged(final AdjustmentEvent e) { blendColor.x = s1.getValue() / 255f; maskAttr.setTextureBlendColor(blendColor); } });
@Override public void adjustmentValueChanged(final AdjustmentEvent e) { blendColor.z = s3.getValue() / 255f; maskAttr.setTextureBlendColor(blendColor); } });
/** * Implements AdjustmentListener interface to automatically update the surface * plot when the slice slider in the stack window is dragged. * * @param e */ @Override public void adjustmentValueChanged(final AdjustmentEvent e) { surfacep.setSlice(((Scrollbar) e.getSource()).getValue()); }
synchronized void adjustHScroll() { if (iRowHeight==0) return; Dimension d = tc.getSize(); int w=0; for (int i=0; i<iColCount; i++) w+=iColWidth[i]; iGridWidth=w; sbHoriz.setValues(iX,d.width,0,iGridWidth); iX=sbHoriz.getValue(); }
@Override public void itemStateChanged(final ItemEvent e) { gd.setCursor(new Cursor(Cursor.WAIT_CURSOR)); rSlider.setEnabled(!cBox.getState()); gSlider.setEnabled(!cBox.getState()); bSlider.setEnabled(!cBox.getState()); colorListener.colorChanged(new Color3f(rSlider.getValue() / 255f, gSlider.getValue() / 255f, bSlider.getValue() / 255f)); gd.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } });
public static void update() { if (instance==null) return; instance.checkbox.setState(instance.isSplineFit()); int sliderWidth = instance.slider.getValue(); int lineWidth = Line.getWidth(); if (lineWidth!=sliderWidth && lineWidth<=200) { instance.slider.setValue(lineWidth); instance.tf.setText(""+lineWidth); } }
public static void update() { if (instance==null) return; instance.checkbox.setState(instance.isSplineFit()); int sliderWidth = instance.slider.getValue(); int lineWidth = Line.getWidth(); if (lineWidth!=sliderWidth && lineWidth<=200) { instance.slider.setValue(lineWidth); instance.tf.setText(""+lineWidth); } }