For IntelliJ IDEA and
Android Studio


public int getOrientation() { return bar.getOrientation(); } public int getUnitIncrement() {
public int map() { return(((Scrollbar)getSource()).getOrientation()); }}));}
@Override public void paint(Graphics g) { Scrollbar target = (Scrollbar) _target; Dimension sz = target.getSize(); int scrollRange = target.getMaximum() - target.getMinimum(); int scrollValue = target.getValue() - target.getMinimum(); int thumbAmount = target.getVisibleAmount(); g.setColor(target.getBackground()); FakePeerUtils.drawScrollbar(g, 0, 0, sz.width, sz.height, target.getOrientation(), target.isEnabled(), true, scrollValue, thumbAmount, scrollRange); }
public void selectLine(int index) { //int ys = panel.getFontMetrics(getFont()).getHeight() + 2; //int y = ys * (index + 1) + 2; // absolute y coordinate //int totalHeight = ys * panel.getLineCount(); Scrollbar ss = null; Component[] components = panel.getComponents(); for (int i=0; i<components.length; i++) { if (components[i] instanceof Scrollbar) { Scrollbar s = (Scrollbar) components[i]; if (s.getOrientation() == Scrollbar.VERTICAL) { ss = s; } } } //int height = panel.getHeight(); // convert absolute y value to scrollbar and relative y coordinates int min = ss.getMinimum(); int scrollValue = min + index; ss.setValue(scrollValue); panel.adjustmentValueChanged(null); }
@Override public Dimension getMinimumSize() { Scrollbar target =(Scrollbar) _target; return target.getOrientation() == Scrollbar.HORIZONTAL ? new Dimension(3 * FakePeerUtils.SCROLL_W, FakePeerUtils.SCROLL_H) : new Dimension(FakePeerUtils.SCROLL_W, 3 * FakePeerUtils.SCROLL_H); } }
public int getOrientation() { return bar.getOrientation(); } public int getUnitIncrement() {
public int getOrientation() { return bar.getOrientation(); } public int getUnitIncrement() {