Re: monitor mouse events but not capture them

2014-06-10 Thread Tom Eugelink
Placed a new version in GIT, tests are green as well. I'm quite pleased with the improvements. Going to take a peek at CornerMenu to see if it makes sense to refactor it also. Tom

Re: monitor mouse events but not capture them

2014-06-10 Thread Tom Eugelink
My internet provider has problems sending to GMail addresses. For me it worked to register to scene.getRoot(). I like registering to a node, because it allows to install different menu's to different nodes, but still do the most common approach of install a single menu to the top level pane.

Re: monitor mouse events but not capture them

2014-06-10 Thread Tomas Mikula
Somehow I didn't get your previous email that you are quoting now. Listening to MOUSE_MOVED events on the Scene seemed to work for me. Didn't it work for you? You may as well install the menu to a Scene instead of a Node. That will also simplify listening to scene's events, because you don't have

Re: monitor mouse events but not capture them

2014-06-10 Thread Tom Eugelink
Ah, attaching to Node is a good idea after all! Tom On 2014-6-10 17:44, Tom Eugelink wrote: Thanks for all the help, you've given me a lot of helpful tips. I already was working on a popup based version and I see you ran into the same problems as I did (initial popup had no width for the c

Re: monitor mouse events but not capture them

2014-06-10 Thread Tom Eugelink
Thanks for all the help, you've given me a lot of helpful tips. I already was working on a popup based version and I see you ran into the same problems as I did (initial popup had no width for the circularPane, etc), the difference is that I bind the menu to Stage, since I do not envision Circ

Re: monitor mouse events but not capture them

2014-06-10 Thread Tomas Mikula
Here it is, using a Popup: https://github.com/TomasMikula/jfxtras-labs/blob/8.0/src/main/java/jfxtras/labs/scene/menu/CirclePopupMenu2.java https://github.com/TomasMikula/jfxtras-labs/blob/8.0/src/main/java/jfxtras/labs/scene/menu/Sample2.java The nice thing about popup window is that it can exten

Re: monitor mouse events but not capture them

2014-06-10 Thread Tomas Mikula
Just because I wanted to make minimal changes to your code, which was already using StackPane. Yes, Popup would remove the need for a StackPane. On Tue, Jun 10, 2014 at 3:52 PM, Tom Eugelink wrote: > > You're way ahead of me. Why use stackpane and not popup as suggested? > Wouldn't Popup remove t

Re: monitor mouse events but not capture them

2014-06-10 Thread Tom Eugelink
You're way ahead of me. Why use stackpane and not popup as suggested? Wouldn't Popup remove the need for a stackpane? Tom On 2014-6-10 15:38, Tomas Mikula wrote: Since talk is cheap, I slightly reworked your code (not using PopupWindow) and it seems to work. CircularPopupMenu: https://gith

Re: monitor mouse events but not capture them

2014-06-10 Thread Tomas Mikula
Since talk is cheap, I slightly reworked your code (not using PopupWindow) and it seems to work. CircularPopupMenu: https://github.com/TomasMikula/jfxtras-labs/blob/8.0/src/main/java/jfxtras/labs/scene/menu/CirclePopupMenu1.java Sample: https://github.com/TomasMikula/jfxtras-labs/blob/8.0/src/mai

Re: monitor mouse events but not capture them

2014-06-10 Thread Tomas Mikula
What about using Popup, which is a subclass of PopupWindow? You just need to populate its content popup.getContent().addAll(Node...); and then show it at the right position, relative to any node popup.show(canvas, x, y); Tomas On Jun 10, 2014 8:49 AM, "Tom Eugelink" wrote: > > Looking

Re: monitor mouse events but not capture them

2014-06-09 Thread Tom Eugelink
Looking at PopupWindow; that is an abstract class and I'm not finding much examples on how to use it. Maybe extending PopupControl would be a better choice. Been looking at the ContextMenu source code (which is extending PopupControl), but it is somewhat mysterious how those MenuItems get ren

Re: monitor mouse events but not capture them

2014-06-09 Thread Tomas Mikula
Hi Tom, I am in favor of the menu being a PopupWindow, but alternatively, could your "canvas" be a Group instead of a Pane? The code would look like this: StackPane stack = new StackPane(); Group canvas = new Group(); canvas.setManaged(false); stack.setOnMousePressed(e -> {

Re: monitor mouse events but not capture them

2014-06-09 Thread Tom Eugelink
But a PopupWindow would be detached from the pane? Not sure if that is what I envision, but I'll give it a go and see what it looks like. Your event filter does work though for what I need now. Thanks! On 2014-6-9 10:41, Martin Sladecek wrote: Oh, I see. So it's not a PopupWindow at all. Eve

Re: monitor mouse events but not capture them

2014-06-09 Thread Martin Sladecek
Oh, I see. So it's not a PopupWindow at all. Events can pass only though parent-child hierarchy, so you can't catch an Event in your "circular menu" pane and then pass it to some other children of the parent StackPane. The menu pane would have to be parent of the controls in the StackPane. So a

Re: monitor mouse events but not capture them

2014-06-09 Thread Tom Eugelink
Or to see in in action with a single java -jar statement, download the samples from. http://jfxtras.org/ On 2014-6-9 10:13, Martin Sladecek wrote: OK, so to avoid further confusion, you have a PopupWindow with a Pane and you want to capture Events on the Pane and sent those events to the un

Re: monitor mouse events but not capture them

2014-06-09 Thread Tom Eugelink
No, I require a StackPane, to which a special "canvas" Pane is added. And on that Pane a circular shaped menu is placed. The separate pane prevents conflicting with other nodes that may be drawn, the stack pane makes sure the menu is on top. See the blog post about both corner menu and circle

Re: monitor mouse events but not capture them

2014-06-09 Thread Martin Sladecek
OK, so to avoid further confusion, you have a PopupWindow with a Pane and you want to capture Events on the Pane and sent those events to the underlying controls (in a parent window) if those events are not relevant to that popup? Thanks, -Martin On 06/09/2014 10:07 AM, Tom Eugelink wrote:

Re: monitor mouse events but not capture them

2014-06-09 Thread Tom Eugelink
Hm, maybe I chose bad words; I'm not using Canvas, but just a Pane. Since the Pane is only used to draw the menu on when it need to appear, I'm calling it the canvas pane, as in "what is painted on". On 2014-6-9 9:46, Martin Sladecek wrote: Just looked at the code and it seems Canvas does pi

Re: monitor mouse events but not capture them

2014-06-09 Thread Martin Sladecek
Just looked at the code and it seems Canvas does pick on bounds independently of the pickOnBounds value. There's currently no logic for picking only when over an opaque pixel ( worth filing a JIRA issue maybe?). This makes Canvas to consume everything as it's always picked instead of some contr

Re: monitor mouse events but not capture them

2014-06-08 Thread Tom Eugelink
Ye. It does not work on the canvas pane, I suspect because of the pickOnBounds, but it does work on the stackpane. Plus, I can register to the stack pane without claiming the onMouseClick/Press hook. Many thanks! Tom On 2014-6-9 8:29, Martin Sladecek wrote: Hi Tom, have you tried .add

Re: monitor mouse events but not capture them

2014-06-08 Thread Martin Sladecek
Hi Tom, have you tried .addEventFilter() method? It receives the Event before the controls underneath the canvas, in the capturing phase. If you don't consume the Event, it should pass down to the controls. For more on the topic, see http://docs.oracle.com/javafx/2/events/processing.htm or htt