Order of elements and events.

INTRO
Hi Oracle community.
A while ago I started a thread here on the forum where I had put three different subjects to be treated. The user jsmith guided me saying that I was supposed to separate things, dividing each subject in a separate thread. The original discussion is at the following link:
Interesting things, however, unknown? StackPane, animations and filters.
ABOUT
So in this discussion, I will be talking about input events and maybe about event filters. I created a JavaFX 8 (b123) application that checks the mouse click on certain nodes. Basically I have a panel of buttons. Behind this panel, I have a scroll pane with rectangles. The rectangles are contained within a Group, and the buttons are in a VBox. The Group is set as ScrollPane content. VBox and ScrollPane are within a StackPane, which becomes the root of scene graph. If we observe the nodes tree, we'll find the following scenario:
IMAGE
Here is my source code:
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ScrollPane;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class ScrollTest extends Application
    //                                                                                                       MAIN
    public static void main(String[] args)
        Application.launch(args);
    //                                                                                                 INSTÂNCIAS
    // CONTROLS
    private Rectangle[] rectangles;
    private ScrollPane scrollP;
    private Button[] buttons;
    // LAYOUTS
    private StackPane root;
    private Group group;
    private VBox vbox;
    //                                                                                                  INÍCIO FX
    @Override public void start(Stage estagio) throws Exception
        this.iniFX();
        this.confFX();
        this.adFX();
        this.evFX();
        Scene cenario = new Scene(this.root , 640, 480);
        estagio.setScene(cenario);
        estagio.setTitle("Programa JavaFX - RDS");
        estagio.show();
    /** Just instantiate JavaFX objects.*/
    protected void iniFX()
        // CONTROLS
        this.rectangles = new Rectangle[5];
        this.scrollP = new ScrollPane();
        this.buttons = new Button[6];
        // LAYOUTS
        this.root = new StackPane();
        this.group = new Group();
        this.vbox = new VBox();
    /** Just sets the JavaFX objects.*/
    protected void confFX()
        // CONTROLS
        for(int count = 0 ; count < this.rectangles.length ; count++)
            this.rectangles[count] = new Rectangle();
            this.rectangles[count].setWidth(Math.random() * 100 + 20);
            this.rectangles[count].setHeight(Math.random() * 100 + 20);
            this.rectangles[count].setFill(Color.rgb((int) (Math.random() * 255) , (int) (Math.random() * 255) , (int) (Math.random() * 255)));
            this.rectangles[count].setTranslateX(Math.random() * 600);
            this.rectangles[count].setTranslateY(Math.random() * 600);
            this.rectangles[count].setRotate(Math.random() * 360);
        for(int count = 0 ; count < this.buttons.length ; count++)
            this.buttons[count] = new Button("Button - " + count);
        // this.scrollP.setVbarPolicy(ScrollBarPolicy.ALWAYS);
        // this.scrollP.setHbarPolicy(ScrollBarPolicy.ALWAYS);
        this.scrollP.setPrefSize(400 , 400);
        // LAYOUTS
        this.vbox.setAlignment(Pos.CENTER);
        this.vbox.setSpacing(20);
        // This doesn't solve my problem.
        // this.vbox.setMouseTransparent(true);
    /** Just create the realtion between nodes, and the root.*/
    protected void adFX()
        for(int count = 0 ; count < this.rectangles.length ; count++)
            this.group.getChildren().add(this.rectangles[count]);
        for(int count = 0 ; count < this.buttons.length ; count++)
            this.vbox.getChildren().add(this.buttons[count]);
        this.scrollP.setContent(this.group);
        this.root.getChildren().add(this.scrollP);
        this.root.getChildren().add(this.vbox);
    /** Just add some events to some nodes for debugging.*/
    protected void evFX()
        this.vbox.setOnMousePressed(new EventHandler<MouseEvent>()
            @Override public void handle(MouseEvent e)
                System.out.println("Mouse pressed inside VBox.");
        this.scrollP.setOnMousePressed(new EventHandler<MouseEvent>()
            @Override public void handle(MouseEvent e)
                System.out.println("Mouse pressed inside ScrollPane.");
        if(this.rectangles.length > 0)
            this.rectangles[0].setOnMousePressed(new EventHandler<MouseEvent>()
                @Override public void handle(MouseEvent e)
                    System.out.println("Rectangle pressed.");
                    rectangles[0].setFill(Color.rgb((int) (Math.random() * 255) , (int) (Math.random() * 255) , (int) (Math.random() * 255)));
THE PROBLEM
I wish I could click the mouse on VBox buttons, but also in the scroll pane, and in it's internal contents (the rectangles). I tried changing the VBox mouseTransparent property to true, and modify mouseTransparent to false on each VBox button, but that did not work. I've been reading the JavaFX documentation talking about routing events, and found the following:
The route can be modified as event filters and event handlers along the route process the event. Also, if an event filter or event handler consumes the event at any point, some nodes on the initial route might not receive the event.
Could it be that VBox is filtering events so they do not reach ScrollPane? Or is this being done by StackPane in some other manner? Does anyone have any idea what I could do?
In any case, I thank you for your attention.

You might need to modify the event dispatch tree so that the events get beyond the VBox. I'm not saying this is the right thing to do, but something worth looking at.
root.setEventDispatcher(new EventDispatcher() {
@Override
public Event dispatchEvent(Event event, EventDispatchChain tail) {
tail.append(group.getEventDispatcher());
return tail.dispatchEvent(event);
There is some info on event processing at Handling JavaFX Events: Processing Events | JavaFX 2 Tutorials and Documentation

Similar Messages

  • Order between elements and subgroups

    Hi all,
    I'm building a Data Template to generate just an XML output (without using any RTF template) and I have a problem with the order among the elements and subgroups, both defined in a main group.
    This is my Data Template:
    <group name="FileHeader" source="Q1">
                        <group name="TotalExecutableAmount" source="Q1">
                             <element name="TotalAmount" value="AMOUNT_REM"/>
                        </group>
                        <element name="InvoiceCurrencyCode" value="CURRENCY_CODE"/>
    </group>
    and my final output:
    <FileHeader>
    <InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
    <TotalExecutableAmount>
    <TotalAmount>0</TotalAmount>
    </TotalExecutableAmount>
    </FileHeader>
    As you can see, it places the "InvoiceCurrencyCode" field before the subgroup "TotalExecutableAmount" although the subgroup is first in the Data Template.
    ¿Do you know any tag or property to force the Data Template to respect the original order?
    ¿Any other suggest?
    Thanks in advance,
    Carlos Herrero García

    Thanks Rainer. It's important because I need to validate the invoice's xml-structure against a Spanish Government system that fixes this order. Anyway, I agree you that it shouldn't have any importance.
    Carlos.

  • Overlapping elements and events

    Hello all
    I can't reproduce such scenario in Edge Animate: the large box has mouseover trigger, on mouseover the button appears - after click, the page opens. On box mouseout, the button disappears.
    Have a look: https://dl.dropboxusercontent.com/u/145862/adobe_forum/Untitled-3.html
    The problem is that when the mouse leaves grey area, mouseout event fires. If I put the layer with button below the large transparent box, button stays visible, but click event doesn't work.
    Source files: https://dl.dropboxusercontent.com/u/145862/adobe_forum/overlapping_buttons.zip
    Mac OS 10.7.5 Edge Animate CC 3.0 Thank you in advance! cg.

    Hello,
    It seems you want this: overlapping revised.zip - Box
    Built with Edge 1.5
    Tested on Yosemite and Safari 8.0.2

  • Report by Internal Order that includes cost element and order type

    Good Morning Gurus'
    Is there an SAP Standard Report that shows Internal order, cost element and order type?  I find many with order, but not order type.
    Thanks a million!!

    Hi,
    No, I don't think so. You can create a workaround by defining order group based on order type by intervals. Or, of course, develop your own report.
    Regards,
    Eli

  • WBS Element and Service No Link Table for Purchase Order document

    Hi Experts,
    We are Facing 1 Problem for finding link between
    WBS Element and Service No for corresponding Purchase Order document . Please Suggest me to find Related tables for Project system Module .
    Thanks and Regards
    BalaNarasimman.M

    Hi,
    The link will be in MM table, not PS table. Try EKKN.
    Regards

  • Cost Elements and Cost Centers in a service order

    Hello Finance Friends....
    I am inquiring about something that has been happening and I can not find the answer as to how.  I spoke with the finance consultant and he seems to think it is the valuation class being changed but the valuation class has not been changed at all....so here is my problem as I am at a lost...it is an intermittent problem....
    I have a service order for material to be repaired by the customer...lets say coming in for Ansi Calibration with repair.
    The technician will issue material to the service order for repair....if the technician does not end up using the material for repair he will reverse the goods issue and then the material goes back to stock...
    in my scenerio ....when the material is issued it is under GL account (cost elelment) 5XXXXXXX.  When the reversal was done it went to 6XXXXXXXX.  So when the DP90 transaction is done (billing request) it gives the error for cost center XXXX cost elelment 6XXXXXXX and can not complete the transaction DP90. The error is the Material combination for DP90....this works in others....these are just one offs that it is happening to and there seems to be no rhyme or reason to why it happens... I have tried reverse the transaction to put the material back to the service order and then manually reverse myself using the original GL account number it was issued on (5XXXXXX)...however when doing the DP90 it still reads the 6XXXXXXX cost element and cost center XXX.  Keep in mind that the valuation class or material type has not been changed.
    Where is the GL account and Cost center being derived from in the service order?  What can I check?
    Thanks in advance....

    Hi,
    Check in T030 table for OBYC assignments and TKA3A table for OKB9 settings.
    Also check account assignment tab of PO.
    Best Regards,
    Madhu

  • How to export an album and keep images in the same order in elements 11 mac

    I made an album of my trip to Australia (lots of pictures) and changed the order of the images (not the same as shooting order) and when I export the images in the album to a folder or memorystick, the images are copied to that place but I lost the album order of the images.
    How can I prevent that, without having to renumber al 500 images separatly?
    Gr Jos

    Thanks for the tip, Michel
    It worked like a charm…
    cheers Jos
    Op 28 okt. 2013, om 18:49 heeft MichelBParis <[email protected]> het volgende geschreven:
    Re: How to export an album and keep images in the same order in elements 11 mac
    created by MichelBParis in Photoshop Elements - View the full discussion
    JosU a écrit:
    I made an album of my trip to Australia (lots of pictures) and changed the order of the images (not the same as shooting order) and when I export the images in the album to a folder or memorystick, the images are copied to that place but I lost the album order of the images.
    How can I prevent that, without having to renumber al 500 images separatly?
    Gr Jos
    The order in album is only kept in the organizer database, so the only way not to lose that order is to rename files.
    If you are using the 'export' function, select your album in custom order, select all photos and in the dialog, choose to rename with a common base name.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5794538#5794538
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5794538#5794538
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5794538#5794538. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Elements at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Any Reports show PM Orders Number, GL Number, Cost Element and the amount?

    Hi Experts,
    Are there any reports that display the PM Orders Number, GL Number, Cost Element and the amount?
    currently i have to use IW32 and click the COSTS tab then click button REP.PLAN/ACT. to view these information.
    Please Advise
    Thank you
    Regards

    There is no single report to show all the data. You have to use different reports or develop custom report.

  • Order of focusLost and actionPerformed events in Swing on Red Hat

    Hi!
    I have quite complicated bug, which must be fixed as soon as possible. Currently I am drinking my fifth coffee and I cannot find anything about this bug on the net.
    The bug looks like that:
    I have pane with several JTextField on it and a Save Button.
    Each JTextField has FocusListener with focusLost method. On focusLost event the entered text is validated and moved to the model object.
    After pressing the Save Button model object is saved to DB. This work perfect on Windows but not on Red Hat ( I have not yet check on Solaris).
    I enter the text in text field and press the save button with mouse. Then I receive information that the actionPerformed is called and save model object without entered text. After saving the focusLost is invoked and move the entered text to the previous saved object.
    I have look into several books but I haven't find any information about order of events. Maybe if I took some more time, but project dead line is soon.
    This is not my application, I only maintain it. I cannot read the JTextField on actionPerformed due to validation of data.
    Have someone any experience with such problem?
    I will be very appreciated for any help.

    I haven't receive any reply yet, but maybe my workaround will help someone else.
    I have figured out, that if I implement actionPerformed as InvokeLater it will cause proper order of focusLost and actionPerformed.
    So it looks like:
    actionPerformed() {
      SwingInvoke.invokeLater(new Runnable() {
        createSaveThread()
        startSaveTread()
    }Have a nice day :)

  • Have ordered Photoshop Elements 12 and Premiere Elements 12 (for MAC, EN version). Order went through but finally order was cancelled as Adobe Store was unable to approve. Subsequently order was cancelled. did anybody experience the same issue and how to

    Have ordered Photoshop Elements 12 and Premiere Elements 12 (for MAC, EN version). Order went through but finally order was cancelled as Adobe Store was unable to approve. Subsequently order was cancelled. did anybody experience the same issue and how to proceed.

    Hi there
    Please check with your credit card issuer to see why payment is not being approved.  When this is resolved you should be able to place a new order.
    Thanks
    Bev

  • I bought Photoshop Elements and have order

    I bought Photoshop Elements and have Amazon order # and Adobe
    Serial # but when I try to open I get "Your trial has expired" message.

    First of all, are you sure it's a serial number? PSE serial numbers are 24 digits beginning with 1057. Anything else will be a redemption code:
    Redemption Code Help

  • Bought Elements and it appears I got only the part to edit photos and not movies. How do I get part 2 of my order?

    Bought Elements and it appears I got only the part to edit photos and not movies. How do I get part 2 of my order?

    Please post Photoshop Elements related queries over at
    http://forums.adobe.com/community/photoshop_elements

  • Evaluating FXG files - possible to access elements and add event handlers?

    I would like to read an existing FXG file into flash builder and then datamine the file for elements, and add event handlers to those elements.
    For instance, if I have two rectangles in an FXG file (not in the flash builder mxml) and then read it in, I'd like to search for every rectangle and add an event handler that detects a mouse click. If the FXG code changes to three rectangles, I don't want to change my mxml for flash builder.
    Is this possible?

    I'm seeing a pretty tragic death using the following, where theDiagram.fxg is in the assets directory. Does <Graphic> map to a SpriteVisualElement, or is the <Graphic> composed of SpriteVisualElements?
    import assets.theDiagram;
    private var fxgCls:Class = theDiagram as Class;
    private var fxgElement:SpriteVisualElement = new fxgCls() as SpriteVisualElement;
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::updateCallbacks()[E:\dev\4.x\frameworks\projec ts\framework\src\mx\core\UIComponent.as:7093]
    at mx.core::UIComponent/set nestLevel()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:3986]
    at spark.core::SpriteVisualElement/http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:\dev\4.x\frameworks\projects\s park\src\spark\core\SpriteVisualElement.as:2106]
    at spark.core::SpriteVisualElement/addChild()[E:\dev\4.x\frameworks\projects\spark\src\spark \core\SpriteVisualElement.as:2070]
    at assets::theDiagram_Text_16710627/createText()
    at assets::theDiagram_Text_16710627()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at mx.core::FlexSprite()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\FlexSprite.as: 61]
    at spark.core::SpriteVisualElement()[E:\dev\4.x\frameworks\projects\spark\src\spark\core\Spr iteVisualElement.as:87]
    at assets::theDiagram()[assets/theDiagram-generated.as:10]
    at SpecViewer()[SpecViewer.mxml:22]
    at _SpecViewer_mx_managers_SystemManager/create()
    at mx.managers.systemClasses::ChildManager/initializeTopLevelWindow()[E:\dev\4.x\frameworks\ projects\framework\src\mx\managers\systemClasses\ChildManager.as:304]
    at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\4.x\frameworks\projects\fram ework\src\mx\managers\SystemManager.as:2810]
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()[E:\dev\4.x\frameworks\projects\frame work\src\mx\managers\SystemManager.as:2637]
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()[E:\dev\4.x\framewo rks\projects\framework\src\mx\managers\SystemManager.as:2539]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/timerHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\p reloaders\Preloader.as:515]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

  • Am new to mac.  Just purchased downloaded adobe photoshop elements and in order to open it, it wants a serial number.  I downloaded it, so I don't have a redemtion number or a serial number.  Obviously I am missing something; however I really do want to t

    Am new to Mac.  Downloaded Adobe Photoshop Elements and am trying to open it but they want a redemption code and a serial number.  Since I downloaded it I don't have either of those but apparently I am missing something because I can't use it unless I enter that info and I don't know where to find it.  Can you please help me figure this out.  If I purchased the software I would have the serial number but as I said, I purchased and downloaded.  Marianne

    Photoshop Elements is not part of the Cloud, I will move this to that forum
    Photoshop Elements Forum http://forums.adobe.com/community/photoshop_elements
    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
    -and https://forums.adobe.com/thread/1572504
    Lost serial # http://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Select a topic, then click I STILL NEED HELP to activate Photoshop Elements Online chat
    -http://helpx.adobe.com/contact.html?product=photoshop-elements or
    http://helpx.adobe.com/photoshop-elements/kb/troubleshoot-installation-photoshop-elements- premiere.html

  • [Bug?] DSC - Clusters Different between 'Read Alarm.vi' and 'Alarm and Event Query.vi" but Contain 'Same' Data

    Howdy!
    Why are the clusters different coming out of the Read Alarm.vi and the Alarm and Event Query.vi when they have the exact same data?
    The only difference is the order of two last elements.
    I am leaning towards bug on this one, unless these clusters need to be distinct for some reason?
    Certified LabVIEW Architect * LabVIEW Champion

    Thanks for posting Ravens Fan
    I re-jiggered my API to reverse my datatypes then applied changes to my application code.
    It wasn't that painful to update. 
    My current understanding is that this bug affects one VI, so I decided it was easier to wrap that VI with the bugfix.
    Attached is my implementation if anyone wants it too.
    Cheers
    -JG
    [LV 2009]
    Certified LabVIEW Architect * LabVIEW Champion
    Attachments:
    Alarm & Event Query_bugfix.vi ‏30 KB
    Convert Alarm And Event Query Cluster.vi ‏21 KB

Maybe you are looking for