mouseevent

Mouse event in Java

♀尐吖头ヾ 提交于 2019-12-11 02:35:31
问题 I am trying to move a JComponent say a label over a table.I am tracking this event using MouseMotionListener's mouseDragged method.This method perfectly helps me in tracking the item.Is there a way to track the mouse release after dragging is complete(.ie the dropping event). tktLabel1.addMouseMotionListener(new MouseMotionListener() { public void mouseDragged(MouseEvent arg0) { tktLabel1.setBounds(tktLabel1.getX() + arg0.getX(), tktLabel1.getY() + arg0.getY(), width, height); } public void

What method should I call on my NSCell

纵然是瞬间 提交于 2019-12-11 02:21:31
问题 I am writing a custom NSControl with custom NSCells. It is a control, so it has to respond to the mouse. I created an NSTrackingArea over my control, implemented -mouseEntered: , -mouseExited: and -mouseMoved: . (And I will have to implement -mouseUp/Down: , but I have no idea what to do in there, so for now I haven't overridden those methods yet.) In these methods I successfully determine on which cell the mouse currently is. Now I have two questions: Is this a good approach for tracking the

Why click function triggers twice for custom component in Angular 2

自作多情 提交于 2019-12-11 02:19:11
问题 My custom component click function is triggered twice - both custom component's event and sample level event are triggered. Here's my Plunker: https://plnkr.co/edit/wp2iWh7OStdPm5uXsWbP?p=preview 回答1: Because you have bound it twice on the child component and on the parent component. The mouseEvent propagates from the child component to the parent component by default. You can stop propagation of event to parent component. Template: <div (click)="divClick($event)">Custom Div Clcik here!</div>

How to control camera both with keyboard and mouse - three.js

岁酱吖の 提交于 2019-12-11 01:26:58
问题 I have a 3D enviroment in WEB GL with three.js and I used to use orbitcontrols.js (http://codepen.io/nireno/pen/cAoGI like this project) to move the point of view. Now I saw a nice way to move inside the enviroment with W A S D keys (http://stemkoski.github.io/Three.js/Chase-Camera.html) like in an FPS (but not with pointerlocking etc) also using orbitcontrols.js . The problem is that when I impelmentes the last functionality, I lost the first functionality with the mouse (I removed the

apply parent's hover to jquery ui autocomplete child

六月ゝ 毕业季﹏ 提交于 2019-12-11 01:15:09
问题 I'm in a similar situation a my other problem prevent datepicker from triggering parent mouseleave, but that solution doesn't seem to apply to jQuery UI autocomplete. How can the hover also apply to autocomplete children? In other words, if one mouseenter s on an autocomplete suggestion, #hoverMe should stay open. Also, suggestion/code on how to handle select ing a selection that's outside of #hoverMe while keeping #hoverMe shown until one mouseenter s back in would be great! http://jsfiddle

Distinguish between single and double click with matplotlib

一个人想着一个人 提交于 2019-12-11 01:03:05
问题 I'm trying to catch single clicks and double clicks on my figure. As stated in another answer, the event contains event.dblclick which is False or True, at least in Version 1.4.2, so double clicks can be got. The only problem is that it's not easy to distinguish between a single click and a double click because when double-clicking the event gets fired twice. The first time it's with event.dblclick=False and the second time it's with event.dblclick=True . Is there any solution to this? I saw

How is the order of event listeners in javascript determined?

六月ゝ 毕业季﹏ 提交于 2019-12-11 00:58:00
问题 Suppose there is a div which contains a link ( a href) and there are three event listeners - on-click- 1) for the entire page, 2) on div 3) a tag. If the user clicks on the a tag, how are the listeners triggered? What is the order of them being registered? 回答1: Essentially, it depends. There are 2 phases for events, Capturing (happens first), which goes document down, and Bubbling which goes element up. JS can do both, which is why when creating a custom Event listened you have the third

How would you solve this opengl necessity (in c) involving knowing in which square in a boardgame did the user click?

佐手、 提交于 2019-12-11 00:06:06
问题 So I have this board, to play a boardgame... The problem is, how do I know in which square did the user click on? I know the x and y coordinates, but how do I automate it, without the need to hunt down the specific locations of each square. (Also the size of the board is variable...so it can have lots of squares, or very few, but the board has always the same height and width, that is, the same number of squares running from left to right as the number of squares running from top to bottom).

Creating a layer of gradient within an SVG path dynamically

血红的双手。 提交于 2019-12-10 23:59:42
问题 I am creating a dynamic path using my SVG. I now wish to add gradient to my path but I am stuck. The way I am trying, my gradient is coming along the path as shown in image 2 while I require it to be the kind in image 1. Current My gradient and stroke definitions are as follows : <defs> <linearGradient id = "grad1" spreadMethod="reflect"> <stop offset="0%" style="stop-color: lightcoral;" /> <stop offset="50%" style="stop-color: #ffffff;" /> <stop offset="100%" style="stop-color: lightcoral;"

Flash receives mouse events under an HTML element when opacity set

為{幸葍}努か 提交于 2019-12-10 23:39:53
问题 I have an HTML document with a Flash object and an absolutely positioned HTML element above it. If I set the HTML element's opacity CSS property to any value less than 1, the Flash object (that is actually covered) receives mouse events. This problem cannot be reproduced with pure HTML elements. Furthermore, Flash only receives hover events, so I cannot click below the layer. I put a demonstration of the problem online. I get this behavior in Firefox 3.6, Safari 4.0 and Chrome 5.0 in both Mac