本文整理了Java中javax.swing.JScrollPane.dispatchEvent()
方法的一些代码示例,展示了JScrollPane.dispatchEvent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.dispatchEvent()
方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:dispatchEvent
暂无
代码示例来源:origin: GoldenGnu/jeveassets
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
jResultScroll.dispatchEvent(e);
}
});
代码示例来源:origin: jasperreports/jasperreports
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);
}
}
代码示例来源:origin: featurecat/lizzie
/**
* 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;
}
}
代码示例来源:origin: jasperreports/jasperreports
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);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-team-commons
@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);
}
}
};
代码示例来源:origin: jasperreports/jasperreports
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);
}
}
代码示例来源:origin: jasperreports/jasperreports
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);
}
}
代码示例来源:origin: eu.mihosoft.vrl/vrl
@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);
}
}
内容来源于网络,如有侵权,请联系作者删除!