/** * 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; }
java.awt.Scrollbar scrollbar = new java.awt.Scrollbar( java.awt.Scrollbar.HORIZONTAL, 20, 0, 0, 100 );
Scrollbar scrollbar = new Scrollbar(Scrollbar.VERTICAL, 0, 1, 0, 255);
RangedIntegerFieldEditor(RangedIntegerField field, int lo, int hi, int v) { super() ; this.field = field ; BorderLayout bl = new BorderLayout() ; setLayout(bl) ; // Add the text: text = new TextField("0") ; add ("North", text) ; // Add the slider: slider = new Scrollbar(Scrollbar.HORIZONTAL, 0, 100, lo, hi) ; add ("South", slider) ; } }
/** * Create a ScrolledPanel. *@param offsetCanvas the OffsetCanvas that will be scrolled within the created panel. **/ public ScrolledPanel(OffsetCanvas offsetCanvas) { super(); dragFix_ = new DragFix(this); offsetCanvas_ = offsetCanvas; spacing = 0; constraints.insets.top = constraints.insets.bottom = 0; label_ = addLabel("", 0, -1, 1.0, 0.0, 1, 0); addComponent(offsetCanvas_, 1, 0, 1.0, 1.0, 3, 0); vscroll_ = new Scrollbar(Scrollbar.VERTICAL); addComponent(vscroll_, 0, 0, 0.0, 1.0, 2, 0); hscroll_ = new Scrollbar(Scrollbar.HORIZONTAL); addComponent(hscroll_, 1, -1, 1.0, 0.0, 1, 0); finish(); }
public ScrollbarWithLabel(StackWindow stackWindow, int value, int visible, int minimum, int maximum, char label) { super(new BorderLayout(2, 0)); this.stackWindow = stackWindow; bar = new Scrollbar(Scrollbar.HORIZONTAL, value, visible, minimum, maximum); icon = new Icon(label); add(icon, BorderLayout.WEST); add(bar, BorderLayout.CENTER); bar.addAdjustmentListener(this); addKeyListener(IJ.getInstance()); }
protected static Scrollbar makeDummySlider() { Scrollbar scrollbar = new Scrollbar(Scrollbar.HORIZONTAL, 1, 1, 1, 2); scrollbar.setFocusable(false); scrollbar.setUnitIncrement(1); scrollbar.setBlockIncrement(1); scrollbar.setEnabled(false); return scrollbar; }
protected static Scrollbar makeDummySlider() { Scrollbar scrollbar = new Scrollbar(Scrollbar.HORIZONTAL, 1, 1, 1, 2); scrollbar.setFocusable(false); scrollbar.setUnitIncrement(1); scrollbar.setBlockIncrement(1); scrollbar.setEnabled(false); return scrollbar; }
public StackWindow(ImagePlus imp, ImageCanvas ic) { super(imp, ic); addScrollbars(imp); addMouseWheelListener(this); if (sliceSelector==null && this.getClass().getName().indexOf("Image5D")!=-1) sliceSelector = new Scrollbar(); // prevents Image5D from crashing pack(); ic = imp.getCanvas(); if (ic!=null) ic.setMaxBounds(); show(); int previousSlice = imp.getCurrentSlice(); if (previousSlice>1 && previousSlice<=imp.getStackSize()) imp.setSlice(previousSlice); else imp.setSlice(1); thread = new Thread(this, "zSelector"); thread.start(); }
public ScrollbarWithLabel(StackWindow stackWindow, int value, int visible, int minimum, int maximum, char label) { super(new BorderLayout(2, 0)); this.stackWindow = stackWindow; bar = new Scrollbar(Scrollbar.HORIZONTAL, value, visible, minimum, maximum); icon = new Icon(label); add(icon, BorderLayout.WEST); add(bar, BorderLayout.CENTER); bar.addAdjustmentListener(this); addKeyListener(IJ.getInstance()); }
public ScrollbarWithLabel(final int orientation, final int value, final int visible, final int minimum, final int maximum, final String label) { super(new BorderLayout(2, 0)); this.orientation = orientation; bar = new Scrollbar(orientation, value, visible, minimum, maximum); if (label != null) { this.label = new Label(label); } else { this.label = new Label(""); } if (orientation == Scrollbar.HORIZONTAL) add(this.label, BorderLayout.WEST); else if (orientation == Scrollbar.VERTICAL) add(this.label, BorderLayout.NORTH); else throw new IllegalArgumentException("invalid orientation"); add(bar, BorderLayout.CENTER); bar.addAdjustmentListener(this); }
public StackWindow(ImagePlus imp, ImageCanvas ic) { super(imp, ic); addScrollbars(imp); addMouseWheelListener(this); if (sliceSelector==null && this.getClass().getName().indexOf("Image5D")!=-1) sliceSelector = new Scrollbar(); // prevents Image5D from crashing pack(); ic = imp.getCanvas(); if (ic!=null) ic.setMaxBounds(); show(); int previousSlice = imp.getCurrentSlice(); if (previousSlice>1 && previousSlice<=imp.getStackSize()) imp.setSlice(previousSlice); else imp.setSlice(1); thread = new Thread(this, "zSelector"); thread.start(); }
protected void initFrames() throws RemoteAccessException { Panel fbrowser = new Panel(new BorderLayout()); Scrollbar sv = new Scrollbar(Scrollbar.VERTICAL); Scrollbar sh = new Scrollbar(Scrollbar.HORIZONTAL); FrameTreeListener ftl = new FrameTreeListener(this); fb = new FrameBrowser(ftl, root_rrw); fb.setVerticalScrollbar(sv); fb.setHorizontalScrollbar(sh); fbrowser.add("Center", fb); fbrowser.add("East", sv); fbrowser.add("South", sh); BorderPanel border = new BorderPanel(BorderPanel.LOWERED); border.setLayout(new BorderLayout()); border.add(fbrowser); widget.add("South", border); }
@Override public void set(final WidgetModel model) { super.set(model); final Number min = model.getMin(); final Number max = model.getMax(); final Number stepSize = model.getStepSize(); scrollBar = new Scrollbar(Adjustable.HORIZONTAL, min.intValue(), 1, min.intValue(), max.intValue() + 1); scrollBar.setUnitIncrement(stepSize.intValue()); scrollBar.addAdjustmentListener(this); getComponent().add(scrollBar, BorderLayout.CENTER); textField = new TextField(6); textField.addTextListener(this); getComponent().add(textField, BorderLayout.EAST); refreshWidget(); }
/** Constructs a new TextPanel. */ public TextPanel() { tc = new TextCanvas(this); setLayout(new BorderLayout()); add("Center",tc); sbHoriz=new Scrollbar(Scrollbar.HORIZONTAL); sbHoriz.addAdjustmentListener(this); sbHoriz.setFocusable(false); // prevents scroll bar from blinking on Windows add("South", sbHoriz); sbVert=new Scrollbar(Scrollbar.VERTICAL); sbVert.addAdjustmentListener(this); sbVert.setFocusable(false); ImageJ ij = IJ.getInstance(); if (ij!=null) { sbHoriz.addKeyListener(ij); sbVert.addKeyListener(ij); } add("East", sbVert); addPopupMenu(); }
private void addExtraScrollbar( double defaultMaxValue ) { label = new Label(""); add(label); updateLabel( defaultMaxValue ); maxValueScrollbar = new Scrollbar( Scrollbar.HORIZONTAL, (int)defaultMaxValue, 1, 1, 350 ); maxValueScrollbar.addAdjustmentListener( new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { manuallyChangedAlready = true; int newValue = e.getValue(); maxChanged( newValue ); } } ); add(maxValueScrollbar); pack(); }
/** Constructs a new TextPanel. */ public TextPanel() { tc = new TextCanvas(this); setLayout(new BorderLayout()); add("Center",tc); sbHoriz=new Scrollbar(Scrollbar.HORIZONTAL); sbHoriz.addAdjustmentListener(this); sbHoriz.setFocusable(false); // prevents scroll bar from blinking on Windows add("South", sbHoriz); sbVert=new Scrollbar(Scrollbar.VERTICAL); sbVert.addAdjustmentListener(this); sbVert.setFocusable(false); ImageJ ij = IJ.getInstance(); if (ij!=null) { sbHoriz.addKeyListener(ij); sbVert.addKeyListener(ij); } add("East", sbVert); addPopupMenu(); }
slider = new Scrollbar(Scrollbar.HORIZONTAL, Line.getWidth(), 1, 1, sliderRange+1); slider.setFocusable(false); // prevents blinking on Windows
slider = new Scrollbar(Scrollbar.HORIZONTAL, Line.getWidth(), 1, 1, sliderRange+1); slider.setFocusable(false); // prevents blinking on Windows
/** * 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; }