scrollModelUpdateBySystem = true; int value = scrollBar.getValue(); int maximum = scrollBar.getMaximum(); int visibleAmount = scrollBar.getVisibleAmount(); if(scrollBar.getMaximum() != maximum) { scrollBar.setMaximum(maximum);
public int getMaximum() { return bar.getMaximum(); } public int getMinimum() {
@Override public int getMaximum() { return bar.getMaximum(); }
public int getMaximum() { return bar.getMaximum(); } public int getMinimum() {
/** * Scroll to any given location. *@param x horizontal offset to scroll to *@param y vertical offset to scroll to **/ public void scrollTo(double x, double y) { if(x < 0.0) x = 0.0; if(y < 0.0) y = 0.0; if(x > (double)hscroll_.getMaximum()) x = (double)hscroll_.getMaximum(); if(y > (double)vscroll_.getMaximum()) y = (double)vscroll_.getMaximum(); xoffset_ = x; yoffset_ = y; hscroll_.setValue((int)x); vscroll_.setValue((int)y); offsetCanvas_.setOffsets(x, y, true); }
public void center() { hscroll_.setValue(hscroll_.getMaximum() / 2); vscroll_.setValue(vscroll_.getMaximum() / 2); configure(); // post an event indicating a scroll getParent().postEvent(new Event((Object)this, OFFSET, (Object)this)); } }
@Override public void run() { while (isVisible()) { int ms = 200; if (anim) { int c = imp.getChannel(); int z = imp.getSlice(); int t = imp.getFrame() + 1; int sizeT = tSlider.getMaximum() - 1; if (t > sizeT) t = 1; imp.setPosition(c, z, t); syncSliders(); int fps = ((Number) fpsSpin.getValue()).intValue(); ms = 1000 / fps; } try { Thread.sleep(ms); } catch (InterruptedException exc) { } } } }.start();
@Override public void run() { while (isVisible()) { int ms = 200; if (anim) { int c = imp.getChannel(); int z = imp.getSlice(); int t = imp.getFrame() + 1; int sizeT = tSlider.getMaximum() - 1; if (t > sizeT) t = 1; imp.setPosition(c, z, t); syncSliders(); int fps = ((Number) fpsSpin.getValue()).intValue(); ms = 1000 / fps; } try { Thread.sleep(ms); } catch (InterruptedException exc) { } } } }.start();
scrollModelUpdateBySystem = true; int value = scrollBar.getValue(); int maximum = scrollBar.getMaximum(); int visibleAmount = scrollBar.getVisibleAmount(); if(scrollBar.getMaximum() != maximum) { scrollBar.setMaximum(maximum);
GUI( final ImagePlus imp ) { window = imp.getWindow(); canvas = imp.getCanvas(); scrollBar = ( Scrollbar )( ( Panel )window.getComponent( 1 ) ).getComponent( 1 ); scrollBarValue = scrollBar.getValue(); scrollBarVisible = scrollBar.getVisibleAmount(); scrollBarMin = scrollBar.getMinimum(); scrollBarMax = scrollBar.getMaximum(); ij = IJ.getInstance(); }
GUI( final ImagePlus imp ) { window = imp.getWindow(); canvas = imp.getCanvas(); scrollBar = ( Scrollbar )( ( Panel )window.getComponent( 1 ) ).getComponent( 1 ); scrollBarValue = scrollBar.getValue(); scrollBarVisible = scrollBar.getVisibleAmount(); scrollBarMin = scrollBar.getMinimum(); scrollBarMax = scrollBar.getMaximum(); ij = IJ.getInstance(); }
@Override void postInitSwingComponent() { super.postInitSwingComponent(); Scrollbar sb = getAWTComponent(); setValues(sb.getValue(), sb.getVisibleAmount(), sb.getMinimum(), sb.getMaximum()); setLineIncrement(sb.getUnitIncrement()); setPageIncrement(sb.getBlockIncrement()); }