scrollBar.setValue(value);
/** * Creates a new {@code ScrollingAWTTerminal} with customizable settings. * @param deviceConfiguration How to configure the terminal virtual device * @param fontConfiguration What kind of fonts to use * @param colorConfiguration Which color schema to use for ANSI colors */ @SuppressWarnings({"SameParameterValue", "WeakerAccess"}) public ScrollingAWTTerminal( TerminalEmulatorDeviceConfiguration deviceConfiguration, SwingTerminalFontConfiguration fontConfiguration, TerminalEmulatorColorConfiguration colorConfiguration) { this.scrollBar = new Scrollbar(Scrollbar.VERTICAL); this.awtTerminal = new AWTTerminal( deviceConfiguration, fontConfiguration, colorConfiguration, new ScrollController()); setLayout(new BorderLayout()); add(awtTerminal, BorderLayout.CENTER); add(scrollBar, BorderLayout.EAST); this.scrollBar.setMinimum(0); this.scrollBar.setMaximum(20); this.scrollBar.setValue(0); this.scrollBar.setVisibleAmount(20); this.scrollBar.addAdjustmentListener(new ScrollbarListener()); this.scrollModelUpdateBySystem = false; }
void adjustMaxBri(int value) { maxBri = value; if (minBri>maxBri) { minBri = maxBri; minSlider3.setValue((int)minBri); } }
void adjustMaxHue(int value) { maxHue = value; if (minHue>maxHue) { minHue = maxHue; minSlider.setValue((int)minHue); } }
void adjustMaxSat(int value) { maxSat = value; if (minSat>maxSat) { minSat = maxSat; minSlider2.setValue((int)minSat); } }
void adjustMinSat(int value) { minSat = value; if (maxSat<minSat) { maxSat = minSat; maxSlider2.setValue((int)maxSat); } }
void adjustMinHue(int value) { minHue = value; if (maxHue<minHue) { maxHue = minHue; maxSlider.setValue((int)maxHue); } }
void adjustMinBri(int value) { minBri = value; if (maxBri<minBri) { maxBri = minBri; maxSlider3.setValue((int)maxBri); } }
void adjustMaxBri(int value) { maxBri = value; if (minBri>maxBri) { minBri = maxBri; minSlider3.setValue((int)minBri); } }
/** Updates the slider values to match the ImagePlus's displayed plane. */ private void syncSliders() { cIndex = FormatTools.rasterToPosition(cLengths, imp.getChannel() - 1); for (int i=0; i<cSliders.length; i++) { cSliders[i].setValue(cIndex[i] + 1); } if (zScroll != null) zScroll.setValue(imp.getSlice()); if (tScroll != null) tScroll.setValue(imp.getFrame()); }
private void setWidth(int width) { if (gd==null) return; Vector numericFields = gd.getNumericFields(); TextField widthField = (TextField)numericFields.elementAt(0); widthField.setText(""+width); Vector sliders = gd.getSliders(); Scrollbar sb = (Scrollbar)sliders.elementAt(0); sb.setValue(width); }
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(); }
public void mouseWheelMoved(MouseWheelEvent event) { synchronized(this) { int rot = event.getWheelRotation(); sbVert.setValue(sbVert.getValue()+rot); iY=iRowHeight*sbVert.getValue(); tc.repaint(); } }
public synchronized void textValueChanged(TextEvent e) { int width = (int)Tools.parseDouble(tf.getText(), -1); //IJ.log(""+width); if (width==-1) return; if (width<0) width=1; if (width!=Line.getWidth()) { slider.setValue(width); value = width; notify(); } } void setup() {
void setWidth(float width) { Vector numericFields = gd.getNumericFields(); TextField widthField = (TextField)numericFields.elementAt(0); widthField.setText(IJ.d2s(width,1)); Vector sliders = gd.getSliders(); Scrollbar sb = (Scrollbar)sliders.elementAt(0); sb.setValue((int)(width+0.5f)); }
public void scrollToTop() { sbVert.setValue(0); iY = 0; for (int i=0; i<iColCount; i++) tc.calcAutoWidth(i); adjustHScroll(); tc.repaint(); }
private void scroll(int inc) { synchronized(this) { sbVert.setValue(sbVert.getValue()+inc); iY=iRowHeight*sbVert.getValue(); tc.repaint(); } }
public synchronized void adjustmentValueChanged(AdjustmentEvent e) { imp.setSlice(e.getValue()); sliceSelector.setValue(e.getValue()); // This seems to corrupt the scrollbar position. //super.adjustmentValueChanged(e); updateRois(); }
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); } }