@Override public void mouseWheelMoved(MouseWheelEvent e) { jResultScroll.dispatchEvent(e); } });
private void dnNavigate(KeyEvent evt) { int bottomPosition = scrollPane.getVerticalScrollBar().getValue(); scrollPane.dispatchEvent(evt); if((scrollPane.getViewport().getHeight() > pnlPage.getHeight() || scrollPane.getVerticalScrollBar().getValue() == bottomPosition) && pageIndex < jasperPrint.getPages().size() - 1) { setPageIndex(pageIndex + 1); if(scrollPane.isEnabled()) scrollPane.getVerticalScrollBar().setValue(0); } }
/** * Process Comment Mouse Wheel Moved * * @return true when the scroll event was processed by this method */ public boolean processCommentMouseWheelMoved(MouseWheelEvent e) { if (Lizzie.config.showComment && commentRect.contains(e.getX(), e.getY())) { scrollPane.dispatchEvent(e); createCommentImage(true, commentRect.width, commentRect.height); getGraphics() .drawImage( cachedCommentImage, commentRect.x, commentRect.y, commentRect.width, commentRect.height, null); return true; } else { return false; } }
private void upNavigate(KeyEvent evt) { if((scrollPane.getViewport().getHeight() > pnlPage.getHeight() || scrollPane.getVerticalScrollBar().getValue() == 0) && pageIndex > 0) { setPageIndex(pageIndex - 1); if(scrollPane.isEnabled()) scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum()); } else { scrollPane.dispatchEvent(evt); } }
@Override public void mouseWheelMoved(MouseWheelEvent e) { if (scrollPane.getVerticalScrollBar().isShowing()) { if (e.getSource() != scrollPane) { e.setSource(scrollPane); scrollPane.dispatchEvent(e); } } else { scrollPane.getParent().dispatchEvent(e); } } };
protected void upNavigate(KeyEvent evt) { if((scrollPane.getViewport().getHeight() > pnlPage.getHeight() || scrollPane.getVerticalScrollBar().getValue() == 0) && viewerContext.getPageIndex() > 0) { viewerContext.setPageIndex(viewerContext.getPageIndex() - 1); if(scrollPane.isEnabled()) scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum()); } else { scrollPane.dispatchEvent(evt); } }
protected void dnNavigate(KeyEvent evt) { int bottomPosition = scrollPane.getVerticalScrollBar().getValue(); scrollPane.dispatchEvent(evt); if((scrollPane.getViewport().getHeight() > pnlPage.getHeight() || scrollPane.getVerticalScrollBar().getValue() == bottomPosition) && viewerContext.getPageIndex() < viewerContext.getPageCount() - 1) { viewerContext.setPageIndex(viewerContext.getPageIndex() + 1); if(scrollPane.isEnabled()) scrollPane.getVerticalScrollBar().setValue(0); } }
@Override public void mouseWheelMoved(MouseWheelEvent e) { JScrollPane parent = getParentScrollPane(); if (parent != null) { /* * Only dispatch if we have reached top/bottom on previous * scroll */ if (e.getWheelRotation() < 0) { if (bar.getValue() == 0 && previousValue == 0) { parent.dispatchEvent(cloneEvent(e)); } } else { if (bar.getValue() == getMax() && previousValue == getMax()) { parent.dispatchEvent(cloneEvent(e)); } } previousValue = bar.getValue(); } /* * If parent scrollpane doesn't exist, remove this as a listener. We * have to defer this till now (vs doing it in constructor) because * in the constructor this item has no parent yet. */ else { VRTextScrollPane.this.removeMouseWheelListener(this); } }