protected final int[] getScroll() { // scroll bar int[] scroll = MyScrollBar.makeVertScroll( (getWidth() - scrollerWidth), bar.getHeight(), scrollerWidth, getContentHeight() + 1, getContentHeight(), getFullSize()); if (null != scroll) { scroll[MyScrollBar.SCROLL_TOP_VALUE] = getTopOffset(); } return scroll; }
protected void paint(GraphicsEx g) { beforePaint(); int bottom = getHeight(); boolean onlySoftBar = (bottom <= g.getClipY()); if (!onlySoftBar) { int captionHeight = bar.getHeight(); paintContent(g, captionHeight, getWidth(), getHeight() - captionHeight); g.setClip(0, captionHeight, getWidth(), getHeight()); g.drawPopup(this, captionHeight); bar.paint(g, this, getWidth()); } if (isSoftBarShown()) { softBar.paint(g, this, getHeight()); } }
protected final void stylusPressed(TouchState state) { if (getHeight() < state.y) { state.region = softBar; return; } if (state.y < bar.getHeight()) { state.region = bar; return; } touchUsed = true; int item = getItemByCoord(state.y); if (0 <= item) { currItem = -1; state.prevTopY = getTopOffset(); touchItemPressed(item, state.x, state.y); state.isSecondTap = true; } }
protected final int getItemByCoord(int y) { int size = getSize(); // is pointing on data area int itemY1 = bar.getHeight() - get_TopOffset(); if (y < itemY1) { for (int i = get_Top(); 0 <= i; --i) { if (itemY1 <= y) { return i; } itemY1 -= getItemHeight(i); } } else { for (int i = get_Top(); i < size; ++i) { itemY1 += getItemHeight(i); if (y < itemY1) { return i; } } } return -1; }
// returns height of draw area in pixels public final int getContentHeight() { return getHeight() - bar.getHeight() - 1; }
protected final int getClientHeight() { return getHeight() - bar.getHeight(); }