Problem with mouse input Manager with the mouse button

Hello

I'm trying different things to determine weather conditions, I'm going to use JavaFX for one of my projects. Here's one of my problems. I had a scene with only a circle inside. I want to run an event that would be returned when I press the left button of the mouse outside of the circle, then enter the circle with the mouse and the button is held down. However, it seems that the mouse gesture events are blocked when you press a button.

Does anyone have a solution to my problem?

Thank you.

Hello

You're right, the "MouseMove" and "mouse entered" events seem to no longer be fired when a drag is in progress. A little annoying, but perhaps also by design.

Drag mouse events on the other hand get programming at this point so you can use them for what you want. It seems THAT JFX suppose the node where the drag started is the one who cares for the event if you don't get the events drag on the circle directly. So the simple way only I can see for this is follow slide it the mouse on the "outer" and then detect what child was wriggling on manually. Something like this:

final FlowPane rootNode = new FlowPane();
rootNode.setOnMouseDragged(new EventHandler()
{
    public void handle(MouseEvent mouseEvent)
    {
        System.out.println("Mouse dragged on root pane to " + mouseEvent.getX() + ", " + mouseEvent.getY());
        for (Node child : rootNode.getChildren())
        {
            if (child.getBoundsInParent().contains(mouseEvent.getX(), mouseEvent.getY()))
            {
                System.out.println("Mouse is now over: " + child);
            }
        }
    }
});

Circle circle = new Circle(50);
rootNode.getChildren().add(circle);

Is not ideal, but it should work.

Default you can also play with the stuff of Drag and Drop: http://download.oracle.com/javafx/2.0/drag_drop/jfxpub-drag_drop.htm

In what you can do what you ask, but you will need to do a little more work to play nice with the larger world of DND. Start with something like this but:

final FlowPane rootNode = new FlowPane();
rootNode.setOnDragDetected(new EventHandler()
{
    public void handle(MouseEvent mouseEvent)
    {
        System.out.println("Drag started on root node");
        Dragboard db = rootNode.startDragAndDrop(TransferMode.ANY);
        ClipboardContent content = new ClipboardContent();
        content.putString("Test");
        db.setContent(content);
        mouseEvent.consume();
    }
});

Circle circle = new Circle(50);
circle.setOnDragEntered(new EventHandler()
{
    public void handle(DragEvent dragEvent)
    {
        System.out.println("Drag entered on circle");
    }
});
rootNode.getChildren().add(circle);

There may be other ways too, but that's what I found.

Hope that helps,
zonski

Tags: Java

Similar Questions

  • Problems with the sound button and the wireless button

    I have a computer laptop dv6-2155dx, and he has a problem with the sound, the button bar button and the wireless button, all of them continue to work, I do not know if I made a mistake and let them turn off or there is another way to get available.

    I need some advice.

    Hello

    Do a hard reset:

    1 disconnect all devices and remove all USB devices and multimedia cards.

    2 disconnect the power adapter, remove the battery and then press in and hold the button for at least 1 minute.

    3 reconnect the power adapter (do not connect the battery), press the power button

    Verification is your problem is resolved or not.

  • Problems with the 'start' button and the size of the video in the program monitor

    I was on TSF phone Adobe Help for about 3 1/2 hours today.  The problem is that the video in the program monitor doesn't fit - even when I checked it to 'fit '.  I have a mac - totally up top date, and film imported from my canon 7 d, I turned to 1280 x 720.  When I created a new project with the same, the image in the program monitor is too big.  When I create a new project in 1280 X 1080 image is too small - even when I click on 'adjust '.  Also, sometimes the play button doesn't work everything simply.  Help, they managed to get rid of my twice - preferences to no help at all, "clean up" my hard drive and the problems still continue.  They then tell me in order for me to go to the second layer, I want to buy a contract.  Can someone help me! Lose my mind! Thank you.

    What's happened is that you have created a sequence with the wrong settings.  Right-click has created a sequence with the correct settings.

    Adobe-forums http://blogs.adobe.com/kevinmonahan/2013/09/11/Marking-Posts-As-correct-or-helpful-on-the-/

  • Problem with the Touchpad buttons

    I have HP DV6 2140ET. Since yesterday, the touch pad buttons close screan on ' Mute / open sound "," Open/close wireless"and set his level don't work anymore. Tried to find the right driver bu coulndt grow. I would be very happy if you can help me solve this problem.

    Hello

    Perform a hard reset
    1 disconnect all devices and remove all USB devices and multimedia cards.
    2 disconnect the power adapter, remove the battery and then press in and hold the button for at least 1 minute.
    3 reconnect the power adapter (do not connect the battery), press the power button and check the buttons again.

  • I have a problem with the dynamic buttons on AC3.

    I downloaded a flash with a pre-made navigation model and all the buttons are in English. I am really struggling to do the buttons display Cyrillic text. Whenever I write in Cyrillic text, buttons are empty. Here is the code:

    var menu_label:Array = new Array ("Something",

    'Something',

    'Something',

    'Something',

    'Something');

    var total: Number = menu_label.length;

    var i: Number = 0;

    var: page number;

    var main_menu:MovieClip = new MovieClip();

    stage.addChild (main_menu);

    for (i = 0; i < total; i ++)

    {

    btn var = new flashmo_button();

    btn.name = "btn" + i;

    btn.x = fm_button.x + i * (fm_button.width + 5);

    btn.y = fm_button.y;

    btn.buttonMode = true;

    btn.item_no = i;

    btn.flashmo_click_area.addEventListener (Event.ENTER_FRAME, btn_enter);

    var each_substring:Array = menu_label [i].split("|");

    btn.flashmo_button_label.fm_label.text = each_substring [0];

    btn.item_url = each_substring [1];

    main_menu.addChild (btn);

    }

    Any ideas how to solve this problem? Thanks in advance!

    PS: I am a complete newbie

    Try to join the police in the textfields.  If you select the textfield object in the button, theProperties Panel should have a button available called Embed.  Click on that and rthen select the characters that you expect, you'll need (the less the better in terms of file size)

  • In Itunes and adobe reader all the latest versions have problems with the Info button.

    in Itunes no show buttons or the info for them, everything els is here, so the info botton if you move the cursor, if you can't find where they might be. Drive has the same problem but only in printing windo. Using Vista sp2 on a toshiba.

    Hi J Jewell,

    1. are you able to use other applications correctly?

    2. were you able to use iTunes & Adobe Reader correctly previously?

    3. don't you make changes on your computer before this problem?

    If you face this question only in iTunes & Adobe Reader, I recommend you to uninstall the applications of the program & features. Subsequently, reinstall them & check if the problem persists.

    To download Adobe Reader, please refer to this link: http://get.adobe.com/reader/

    To download iTunes, refer to this link: http://www.apple.com/confirm/itunes/thankyou.html

    Hope the helps of information.
    Please post back and we do know.

  • Problems with the "back" button

    My browser is Chrome and in these last days I could not use the arrow to the left, although it appears highlighted. I use my computer for business and often want to go back to a page without reviewing the information.

    What is happening across all the web sites I visit and I keep having to go back to the home page to access the info. Its taking ages and is very frustrating - ideas?

    Yes, that's correct.

    I not push Firefox, but if you install it, you can have all of your bookmarks moved to him, too.  Then you can uninstall Chrome without losing their.  When you reinstall Chrome you can again move your bookmarks back at it.

    I suggest making a list of your passwords just to be safe.

  • I have problems with the radio buttons and prompting to show/hide fields.

    For example, the code below works but the for loop when entering 1 choice remains between the TI-57-119 mask fields all fields in my document. any help would be apreciated. choice 2 works fine.

    function updateFormField()

    {

    var v = this.getField("Group50").value;

    If (v == 'Choice1') {}

    for (var i = 57; 57 < = i < = 119; i ++);

    this.getField (this.getNthFieldName (i)) .display = display.hidden;

    }

    }

    else if (v == "Lendemain2")

    {

    this.getField("Text58").display = display.hidden;

    this.getField("Dropdown66").display = display.visible;

    this.getField("Text67").display = display.visible;

    }

    }

    updateFormField();

    There are chances that you can rename the fields so that they are more easily treated when you use a script? For example, if you have added a prefix such as "g1". (meaning group1) so that the domain names were like:

    G1.text57, g1.dropdown58, g1.text59, etc., the declaration if code could be simplified a little:

    If (v == 'Choice1') {}

    this.getField("g1").display = display.hidden;

    }

    } else if (v == "Lendemain2") {}

    this.getField ("g1. Text58") .display = display.hidden;

    this.getField ("g1. Dropdown66") .display = display.visible;

    this.getField ("g1. Text67") .display = display.visible;

    }

    This is called hierarchical domain naming, and it is easy to control large groups of fields. If you don't do it consistently name fields so that they are easier to reference in a loop, (e.g., text57, text58, text59,..., text110), then you will need to use a single statement for each field that you want to control, complicating the code and makes it more difficult to maintain.

  • I have a problem with the return of the browser.

    Whenever I open a tab (from the starting page), or a bookmark, I can't use the back button to return to the start page of origin. I have to open a new window and then close the previous page. This happens every time and. Any suggestions?

    I see you are using McAfee, the McAfee Site Advisor extension? The McAfee Site Advisor add-in because of problems with the back button, uninstall or disable should solve the problem.

  • Problem with the controls volume/internet on my laptop HP HDX 16

    Hey,.

    I have a laptop of HP HDX 16, around the age of 8 months. I keep having problems with the touch buttons that controls volume, bass/treble and the internet. The buttons randomly disappear by themselves, turn on and off Alternatively my volume/bass/treble from top to bottom and my internet.

    I have updated the drivers for the buttons to quick launch without result. I've also just updated my computer to Windows 7, so my Bios is brand new (the problem started before I updated to 7).

    As you can imagine, get my internet randomly stops and for the black volume screen blocking what I was doing and hang my computer is getting pretty annoying. Any help on this would be surprising.

    Thank you
    Printertron

    I also have the same problem. HDX 16, around the age of 3 months.

    I found to do all sorts of updates the driver, uninstall, System Restore (no), and does not help.

    I'm still on Vista, but when I get my kit to upgrade to Windows 7, I had planned to see if it resolved the problem.

    Technical support HP told me that if a recovery does not resolve the problem, it must be delivered to them, and the band of totality quicklaunch may have to be modified.

    I intend to make the recovery during the holiday season.

    Based on the fact that you got your computer 8 months ago, I assume that you have not used an upgrade kit. Which means, I would recommend doing a recovery before calling the technical support because they will just have to insist that you do anyway.

    An interim solution, when the volume control locks your screen is at the end of the process called "SmartMenu.exe". It will reload the next time that you start your computer.

  • Problems with the mouse scrolling

    I have a Microsoft Wireless Mobile Mouse 1000 that I use on my laptop Dell Inspiron N5110 with Windows 7 Ultimate 64 - bit installed on it.

    Recently, the mouse wheel is crazy I've put it down it scrolls to the top, scroll down, done both or nothing. and this only happens when scrolling down, there is no problem of scrolling upward.

    I changed the USB port - in which I put the receiver - the only one directly attached to the motherboard. That gave me minutes of scrolling perfect without problem, but after having tried other ports he went crazy again.

    I tried to uninstall the driver from Device Manager and then put it back, but to no avail (I did for several ports)

    I should note that the problem itself is fluctuating, which sometimes means that the wheel is crazier than others and I tried the mouse on another laptop and the problem does not occur.

    Thanks in advance.

    Original title: Wireless Mouse 1000 - wheel had crazy

    Hello

    You did changes to the computer before this problem?

    I wish that you read the following article and follow the suggestions in the article.

    The problems with the mouse button or scroll the parameters
    http://support.Microsoft.com/kb/303091/en-us
     
    Hope this helps, if the problem persists with Windows updates, please get back to us. We are here to help you.

  • Satellite A660 - 07P problem with the pointer of the mouse using the touchpad

    I just bought my A660 07P last Thursday, September 15, 10 and I noticed that I had problems with the mouse pointer using the touchpad.

    From time to time, the cursor/pointer is locked and seems something like a button up and down.
    I assume it's because it's on a mode of waiting, but in this case as every 5 minutes.
    When it is locked, it will also change the zoom percentage when the touchpad is struck. It is very not when I'm in the middle of something and I can not move the pointer. In addition, the start is very slow.

    BTW, I have not installed any programs or applications. I'm still testing until Friday, otherwise I'll go back to where I bought it.

    Hi mate

    This isn't touchpad problem.
    I guess as support for computer laptop MULTI-TOUCH PAD
    There are a few additional features supported by touchpad, and I think that you have enabled this while using the touchpad

    The touchpad supports the features:
    _ChiralMotion_
    You can scroll vertically and horizontally

    _Pinch Zoom_
    This feature provides functionality like the scroll wheel zooming

    _Rotating (chiral spin) _
    This provides gestures to rotate the photos and other objects

    _Momentum_
    This feature provides a smooth, fast trackball as the movement of the mouse. A quick finger on the touchpad surface can move the sliders in the entire screen.

  • I started having problems with the wireless mouse and the carpet of my laptop - Lenovo ThinkPad T420 mouse.

    Original title: right click on the mouse itself activating

    I borrowed a USB to a person at work and I started having problems with the wireless mouse and the carpet of my laptop - Lenovo ThinkPad T420 mouse. The left click of two devices works normally, however, sometimes she does not respond to clicks and it takes a few seconds to work. The left button was constantly starts to turn on, as if he was stuck. After that I hit Alt + Tab and modify windows it stops for a few moments and starts at a later date. I havo not found a specific condition or a combination of keys that may trigger the fault.

    I read a few posts on discussion forums, but all say that it could be a hardware problem, which I think is not, because both devices have the same problem and I'm sure it all started with the insertion of the borrowed memory stick. I scanned the readers to help Symantec's EndPoint Protection and installed Microsoft Security Essentials and performed a full scan, but found nothing. I even restored the system, but the problem remains.

    Should I get a different antivirus? How can I find the cause so I can find a better targeted solution?

    Try to install the drivers from this link and check.

    http://support.Lenovo.com/en_US/research/hints-or-tips/detail.page?&LegacyDocID=MIGR-77167

  • Moving the tabs with the left button of the mouse no longer works! Help please!

    Well, since today, when I try to move/rearrange my tabs on the tab bar, the 'move' tab to copy! So instead of moving, I add another tab with the same Web page. Also I can't add tab for the bookmarks bar or by dragging with the left button of the mouse on it.

    I even tried restarting my computer, my firefox nightly and even rebooted in safe mode. Oh and I have the latest update. If someone has an idea?

    Well after that the next update on every night, the problem has been fixed.

  • Why when I click with the left button of the mouse on the unique tool, you open the window with the other instruments?

    When I click with the left button of the mouse on the unique tool, open the window with the other instruments


    Mohito Hi, this morning, I solved the problem by trying to support. I realized that the problem was in mice, because the click rate is at its highest level, and then click the instruments was like if he did 2. I will now set the minimum speed of the clicks.

    Thank you

  • When I click with the right button of the mouse on videos from facebook it shows no options for me to copy the link and etc.

    When I click with the right button of the mouse on videos from facebook it shows no options for me to copy the link and etc. It only shows the parameters for the flash player. How can I fix?

    You can find the URL of the thumbnail by following these steps:
    In the context menu, choose {inspect element}.
    Now, you can see the URL in the source down (perhaps you click the small arrow to the left of the line of seledted firstly to show).

Maybe you are looking for