@Override Insets getNativeInsets() { Insets insets = getInsets(); insets.bottom += hAdjustable.getBounds().height; insets.right += vAdjustable.getBounds().width; return insets; }
private void updateIncrements() { Dimension itemSize = getItemSize(); Dimension clientSize = getClient().getSize(); vAdjustable.setUnitIncrement(itemSize.height); vAdjustable.setBlockIncrement(clientSize.height); Graphics gr = getGraphics(); hAdjustable.setUnitIncrement(getMaxCharSize(gr).width); hAdjustable.setBlockIncrement(clientSize.width); gr.dispose(); }
public List(int rows, boolean multipleMode) throws HeadlessException { toolkit.lockAWT(); try { Toolkit.checkHeadless(); this.rows = ((rows != 0) ? rows : 4); this.multipleMode = multipleMode; scrollLocation = new Point(); hAdjustable = new ScrollPaneAdjustable(this, Adjustable.HORIZONTAL); vAdjustable = new ScrollPaneAdjustable(this, Adjustable.VERTICAL); scrollable = new ListScrollable(); stateController = new ListStateController(scrollable); state = new State(); addAWTMouseListener(stateController); addAWTMouseMotionListener(stateController); addAWTKeyListener(stateController); addAWTFocusListener(stateController); addAWTComponentListener(stateController); addAWTMouseWheelListener(stateController); hAdjustable.addAdjustmentListener(stateController); vAdjustable.addAdjustmentListener(stateController); } finally { toolkit.unlockAWT(); } }
public void setAdjustableBounds(Adjustable adj, Rectangle r) { ((ScrollPaneAdjustable) adj).setBounds(r); }
public void setAdjustableSizes(Adjustable adj, int vis, int min, int max) { ((ScrollPaneAdjustable) adj).setSizes(vis, min, max); }
@Override void prepaint(Graphics g) { toolkit.theme.drawList(g, state, false); vAdjustable.prepaint(g); hAdjustable.prepaint(g); }