本文整理了Java中java.awt.Window.addMouseListener()
方法的一些代码示例,展示了Window.addMouseListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.addMouseListener()
方法的具体详情如下:
包路径:java.awt.Window
类名称:Window
方法名:addMouseListener
暂无
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf
/**
* Installs the necessary listeners on the parent window, if there is one.
* This takes the parent so that cleanup can be done from
* <tt>removeNotify</tt>, at which point the parent hasn't been reset yet.
*
* @param parent The parent of the <tt>JRootPane</tt>.
*/
private void installWindowListeners(Component parent) {
window = parent instanceof Window ?
(Window) parent :
SwingUtilities.getWindowAncestor(parent);
if (window != null) {
if (mouseInputListener == null) {
mouseInputListener = createWindowMouseInputListener();
}
window.addMouseListener(mouseInputListener);
window.addMouseMotionListener(mouseInputListener);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf
/**
* Installs the necessary Listeners on the parent <code>Window</code>, if
* there is one.
* <p>
* This takes the parent so that cleanup can be done from <code>removeNotify</code>,
* at which point the parent hasn't been reset yet.
*
* @param parent The parent of the JRootPane
*/
private void installWindowListeners(JRootPane root, Component parent) {
if (parent instanceof java.awt.Window) {
window = (java.awt.Window)parent;
} else {
window = SwingUtilities.getWindowAncestor(parent);
}
if (window != null) {
if (mouseInputListener == null) {
mouseInputListener = createWindowMouseInputListener(root);
}
window.addMouseListener(mouseInputListener);
window.addMouseMotionListener(mouseInputListener);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
/**
* Installs the necessary Listeners on the parent <code>Window</code>, if
* there is one.
* <p>
* This takes the parent so that cleanup can be done from
* <code>removeNotify</code>, at which point the parent hasn't been reset
* yet.
*
* @param parent The parent of the JRootPane
*/
private void installWindowListeners(JRootPane root, Component parent)
{
if (parent instanceof Window)
{
window = (Window) parent;
}
else
{
window = SwingUtilities.getWindowAncestor(parent);
}
if (window != null)
{
if (mouseInputListener == null)
{
mouseInputListener = createWindowMouseInputListener(root);
}
window.addMouseListener(mouseInputListener);
window.addMouseMotionListener(mouseInputListener);
}
}
代码示例来源:origin: com.jtattoo/JTattoo
mouseInputListener = createWindowMouseInputListener(root);
window.addMouseListener(mouseInputListener);
window.addMouseMotionListener(mouseInputListener);
代码示例来源:origin: khuxtable/seaglass
/**
* Installs the necessary Listeners on the parent <code>Window</code>, if
* there is one.
*
* <p>This takes the parent so that cleanup can be done from <code>
* removeNotify</code>, at which point the parent hasn't been reset yet.</p>
*
* @param root the JRootPane.
* @param parent The parent of the JRootPane
*/
private void installWindowListeners(JRootPane root, Component parent) {
if (parent instanceof Window) {
window = (Window) parent;
} else {
window = SwingUtilities.getWindowAncestor(parent);
}
if (window != null) {
if (mouseInputListener == null) {
mouseInputListener = createWindowMouseInputListener(root);
}
window.addMouseListener(mouseInputListener);
window.addMouseMotionListener(mouseInputListener);
if (windowListener == null) {
windowListener = createFocusListener();
window.addWindowListener(windowListener);
}
}
}
代码示例来源:origin: de.sciss/prefuse-core
public void ancestorAdded(AncestorEvent event) {
if ( showing ) { return; }
Window ttip = SwingUtilities.getWindowAncestor(getParent());
if ( ttip == null || !ttip.isVisible() ) {
return;
}
//ttip.addMouseListener(this);
ttip.getLocation(point);
ttip.setVisible(false);
getParent().remove(JCustomTooltip.this);
JComponent c = getComponent();
c.setToolTipText(null);
c.removeMouseMotionListener(ToolTipManager.sharedInstance());
popup = PopupFactory.getSharedInstance().getPopup(
c, JCustomTooltip.this, point.x, point.y);
Window w = SwingUtilities.getWindowAncestor(JCustomTooltip.this);
w.addMouseListener(this);
w.setFocusableWindowState(true);
popup.show();
showing = true;
}
代码示例来源:origin: com.threerings/nenya
root.addMouseListener(listener);
root.addMouseMotionListener(listener);
代码示例来源:origin: threerings/nenya
root.addMouseListener(listener);
root.addMouseMotionListener(listener);
代码示例来源:origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun
window.addMouseListener(this);
} else {
window = null;
代码示例来源:origin: org.java.net.substance/substance
.createWindowMouseInputListener(root);
this.window.addMouseListener(this.substanceMouseInputListener);
this.window
.addMouseMotionListener(this.substanceMouseInputListener);
代码示例来源:origin: com.github.insubstantial/substance
.createWindowMouseInputListener(root);
this.window.addMouseListener(this.substanceMouseInputListener);
this.window
.addMouseMotionListener(this.substanceMouseInputListener);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-dlight-visualizers
cellTipWindow.addMouseListener(this);
} else {
cellTipWindow = null;
代码示例来源:origin: abbot/abbot
window.addMouseListener(ma);
Robot robot = new Robot();
robot.click(window, x, y, mask);
window.addMouseListener(ma);
Robot robot = new Robot();
robot.click(window, x, y, mask);
代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui
cellTipWindow.addMouseListener(this);
cellTipWindow.addMouseWheelListener(this);
} else {
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
protected void initWindowListeners() {
descriptor.setIdOnTitleBar();
// Remove listeners
window.getWindow().removeMouseMotionListener(resizeMouseInputHandler);
window.getWindow().removeMouseListener(resizeMouseInputHandler);
titleBarTabs.removeEventDispatcherlListener(moveMouseInputHandler);
titleBar.removeMouseMotionListener(moveMouseInputHandler);
titleBar.removeMouseListener(moveMouseInputHandler);
// Add listeners
window.getWindow().addMouseMotionListener(resizeMouseInputHandler);
window.getWindow().addMouseListener(resizeMouseInputHandler);
titleBarTabs.addEventDispatcherlListener(moveMouseInputHandler);
titleBar.addMouseMotionListener(moveMouseInputHandler);
titleBar.addMouseListener(moveMouseInputHandler);
settedListener = true;
}
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
moveMouseInputHandler = new FloatingMoveMouseInputHandler(window.getWindow());
window.getWindow().addMouseMotionListener(resizeMouseInputHandler);
window.getWindow().addMouseListener(resizeMouseInputHandler);
window.getWindow().addComponentListener(windowComponentAdapter);
moveMouseInputHandler = new FloatingMoveMouseInputHandler(window.getWindow());
window.getWindow().addMouseMotionListener(resizeMouseInputHandler);
window.getWindow().addMouseListener(resizeMouseInputHandler);
window.getWindow().addComponentListener(new WindowComponentAdapter());
内容来源于网络,如有侵权,请联系作者删除!