Scene Graph traversal. Getting all the children of a node recursively

Hi,
Requirement: To resize all the controls of a scene (including controls that contain text like label, button) as per the scene size
Approach: To implement the above requirement (see code snippet below), I added Listeners for width and height properties of a Scene and whenever the scene size changes, I get all the children of the root node of the scene and invoked the setScaleX() and setScaleY() for the children.
Problem: In my design, labels and buttons are wrapped inside VBox, HBox etc. Method getChildrenUnmodifiable() returns only the first level of children and hence my HBox and VBox are getting scaled as per the scene size but not the children of VBox and HBox. Is there a built-in function to get all the children of a node recursively ? Or what is the best way to resize text as the scene size changes ?
Scene mainScene = new Scene(borderPane, PERMANENT_WIDTH,
                PERMANENT_HEIGHT, Color.HONEYDEW);
rootNode = mainScene.getRoot();
        mainScene.widthProperty().addListener(new ChangeListener() {
            @Override
            public void changed(ObservableValue observable, Object oldValue,
                    Object newValue) {
                Double widthScalingFactor = ((Double) newValue) / PERMANENT_WIDTH;
                 ObservableList<Node> children = rootNode.getChildrenUnmodifiable();
                for (Node child : children) {
                    child.setScaleX(widthScalingFactor);
        mainScene.heightProperty().addListener(new ChangeListener() {
            @Override
            public void changed(ObservableValue observable, Object oldValue,
                    Object newValue) {
                Double heightScalingFactor = ((Double) newValue) / PERMANENT_HEIGHT;
                ObservableList<Node> children = rootNode.getChildrenUnmodifiable();
                for (Node child : children) {
                    child.setScaleY(heightScalingFactor);
        });Thanks.

Added the following code to get all the children recursively. now the scaling is applied to all nodes of a scene.
    private static void getChildren(Parent parentNode) {
        if (parentNode.getChildrenUnmodifiable().size() != 0) {
            ObservableList<Node> tempChildren = parentNode
                    .getChildrenUnmodifiable();
            allChildren.addAll(tempChildren);
            for (Node n : tempChildren)
                getChildren((Parent) n);
        } else
            allChildren.add(parentNode);
    }

Similar Messages

  • Can I get all the ipads in school (18) to access the same itunes playlist?

    Can I get all the ipads in school (18) to access the same itunes playlist? We want to use the ipads to create movies but need music, we want to legally download music and let the children have access to the same playlist, can we do this and how? preferably without downloading the same track 18 times?

    we would ideally use Icloud, my home account has 1 iphone and two ipods that share the same user and playlists etc, ideally I would want to create this but over the 18 ipads in school, I do however use the usb to update them so If i can do it via a sync on Icloud that would be better?

  • Not Getting all the icons in the Toolbar while using using ALV with OOPS

    Hello,
    But I am not able to get all the Keys in the toolbar for which i have called the method from class  cl_salv_functions_list, by using the following logic.
    Though i am getting all except Word Processing, ABC Analysis, Save layout, Information, Get Layout.
    FORM ALV_DISPLAY .
      data: lr_functions type ref to cl_salv_functions_list,    "toolbar
            lr_columns type ref to cl_salv_columns,
            LI_COLUMNS TYPE REF TO CL_SALV_COLUMNS_TABLE,    "columns instance
            LI_COL TYPE REF TO CL_SALV_COLUMN_TABLE,        "column instance
            LR_EVENTS TYPE REF TO CL_SALV_EVENTS_TABLE,
            GR_EVENTS TYPE REF TO LCL_HANDLE_EVENTS.
      TRY.                                               "method for ALV display
          CALL METHOD CL_SALV_TABLE=>FACTORY
            EXPORTINg
              LIST_DISPLAY = IF_SALV_C_BOOL_SAP=>FALSE
            IMPORTING
              R_SALV_TABLE = li_alv
            CHANGING
              T_TABLE      = it_po_final.
        CATCH CX_SALV_MSG .
          message e001(00) with text-011.
      ENDTRY.
    *calling methods for toolbar
      lr_functions = li_alv->get_functions( ).
      lr_functions->set_default( abap_true ).
      lr_functions->set_print_preview( abap_true ).
      lr_functions->set_view_excel( abap_true ).
      lr_functions->SET_EXPORT_WORDPROCESSOR( abap_true ).
      lr_functions->set_export_localfile( abap_true ).
      lr_functions->SET_EXPORT_MAIL( abap_true ).
      lr_functions->SET_EXPORT_SEND( abap_true ).
      lr_functions->SET_ABC_ANALYSIS( abap_true ).
      lr_functions->SET_GRAPHICS( abap_true )
      lr_functions->SET_LAYOUT_SAVE( abap_true ).
      lr_functions->SET_DETAIL( abap_true ).
      lr_functions->SET_LAYOUT_MAINTAIN( abap_true )
    *... set the columns technical
      lr_columns = li_alv->get_columns( ).
      lr_columns->set_optimize( abap_true ).
    **get ALV columns
      CALL METHOD LI_ALV->GET_COLUMNS  "get all columns
        RECEIVING
          VALUE = LI_COLUMNS.
      IF LI_COLUMNS IS NOT INITIAL.
    *Get EBELN column
        TRY.
            LI_COL ?= LI_COLUMNS->GET_COLUMN( 'EBELN' ). "get EBELN columns to insert hotspot
          CATCH CX_SALV_NOT_FOUND.
          MESSAGE i001(00) with text-012.
        ENDTRY.
    * Set the HotSpot for ebeln Column
        TRY.
            CALL METHOD LI_COL->SET_CELL_TYPE "set cell type hotspot
              EXPORTING
                VALUE = IF_SALV_C_CELL_TYPE=>HOTSPOT.
          CATCH CX_SALV_DATA_ERROR .
          MESSAGE i001(00) with text-012.
        ENDTRY.
      ENDIF.
    *Register events
    *Event handler method for ALV
    ***handle hotspot click
      LR_EVENTS = LI_ALV->GET_EVENT( ). "get event
      CREATE OBJECT GR_EVENTS.
      SET HANDLER GR_EVENTS->ON_LINE_CLICK FOR LR_EVENTS. "register event handler method
      IF li_alv IS BOUND.        "calling display method for ALV
        li_alv->display( ).
      ENDIF.
    ENDFORM.                    " ALV_DISPLAY

    Hi Neha,
    If you didn't get the answer then follow this one. Yeah and sorry, i checked and found that really you were not getting every icons. I am giving here a sample program.
    REPORT  zdc_factory_alv_test
    TYPES: BEGIN OF ty_vbak,
               vbeln TYPE vbak-vbeln,
               erdat TYPE erdat,
               auart TYPE auart,
               kunnr TYPE kunnr,
            END OF ty_vbak.
    DATA: gt_vbak        TYPE STANDARD TABLE OF ty_vbak,
           gs_vbak        LIKE LINE OF gt_vbak,
           gr_salv         TYPE REF TO cl_salv_table,
           gr_container   TYPE REF TO cl_gui_docking_container.
    START-OF-SELECTION.
       CALL SCREEN '3000'.
    *&      Module  STATUS_3000  OUTPUT
    *       text
    MODULE status_3000 OUTPUT.
       SET PF-STATUS '3000'.
       SET TITLEBAR 'FACTORY'.
    ENDMODULE.                 " STATUS_3000  OUTPUT
    *&      Module  ALV_OUTPUT  OUTPUT
    *       text
    MODULE alv_output OUTPUT.
       PERFORM get_data.
       PERFORM create_container.
       PERFORM display_alv.
    ENDMODULE.                 " ALV_OUTPUT  OUTPUT
    *&      Form  GET_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_data .
       SELECT vbeln erdat auart kunnr
          INTO  TABLE gt_vbak
          FROM  vbak
          UP TO 20 ROWS.
    ENDFORM.                    " GET_DATA
    *&      Form  CREATE_CONTAINER
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM create_container .
       IF gr_container IS NOT BOUND.
         IF cl_salv_table=>is_offline( ) EQ if_salv_c_bool_sap=>false.
           CREATE OBJECT gr_container
             EXPORTING
               side      = cl_gui_docking_container=>dock_at_top
               extension = 2000
             EXCEPTIONS
               others    = 1.
         ENDIF.
       ENDIF.
    ENDFORM.                    " CREATE_CONTAINER
    *&      Form  DISPLAY_ALV
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_alv .
       DATA : lr_columns     TYPE REF TO cl_salv_columns_table.
       DATA : lr_functions   TYPE REF TO  cl_salv_functions_list,
              lr_layout      TYPE REF TO cl_salv_layout,
              ls_layout_key  TYPE salv_s_layout_key.
       TRY.
           CALL METHOD cl_salv_table=>factory
             EXPORTING
               r_container  = gr_container
             IMPORTING
               r_salv_table = gr_salv
             CHANGING
               t_table      = gt_vbak.
         CATCH cx_salv_msg .
       ENDTRY.
       lr_functions = gr_salv->get_functions( ).
       lr_functions->set_all( abap_true ).
       lr_columns = gr_salv->get_columns( ).
       lr_columns->set_optimize( 'X' ).
       lr_layout = gr_salv->get_layout( ).
       ls_layout_key-report = sy-repid.
       lr_layout->set_key( ls_layout_key ).
       lr_layout->set_save_restriction( ).
       gr_salv->display( ).
    ENDFORM.                    " DISPLAY_ALV
    Note:- Double click on screen name '3000' and it will ask you option of creating screen.
    There i have created one module..
    After clicking 3000 under output module create MODULE alv_output.
    That will look like...
    PROCESS BEFORE OUTPUT.
       MODULE status_3000.
       MODULE alv_output.
    PROCESS AFTER INPUT.
    * MODULE USER_COMMAND_3000.
    This is the sample result..
    Still if you have any problem, then feel free to ask..
    Regards
    Dhananjay

  • Not getting all the attributes value from Trusted Recon in eventhandler

    Hi,
    I am not getting the values of all the attributes in hashmap from Trusted recon in eventhandler.
    Following is the hashmap value I am getting :
    Parameter Hashmap value is {re_key=1869, Email=[email protected], Role=Full-Time, act_key=22, User Login=TUser43, Xellerate Type=End-User, Last Name=User43, First Name=Test}
    Please let me know how to get all the attributes value in eventhandler. I need to take some decisions based on these attributes.
    Thanks

    You should be getting all the values in the recon event.
    To get the current user states for all the records in the bulk event use this:
    Identity[] currentUserStates = (Identity[]) eventDataHashMap.get("CURRENT_USER");
    Now when you are looping through your bulkParametersp[], you can use the same get from the currentUserStates:
    Identity currentUser = null;
    currentUser = currentUserStates[counter];
    Now if the attribute is not in your hashmap, you can use:
    currentUserState.getAttributes().get(attribute)
    -Kevini

  • Not getting all the notifications to the Mobile Device

    Hi All,
    We are not able to get all the notifications that are assigned to the mobile device. Only part of the notifications are downloading to mobile device. I can see using MAM30_011_GETLIST there are 195 notifications assigned to that device. Out of 195, I can able to see only 97 notifications on the device.
    I debugged and found that whenever I am creating a notifications using some functional locations either from the backend or using mobile device that never get downloaded to mobile device.
    Please through some light on this issue I would be grateful to you.We are using Server Driven Functionality.
    MAM version is MAM30 SR05.
    Regards,
    Scott.

    Hi,
    The reason is very simple here. Some of the notifications are referring to technical objects(equipment/functional location) which are actaully not present on the middleware. So when a user request for data from the client to the  middleware, because there is a reference from notification to technical objects, middleware will only send those notifications whose all references are actually present on the middleware.
    So the way to check if all the technical objects are present in the middleware or not, you can do the following:
    1. First check the no. of entries for both equipment and functional location in the middleware.
    2. Then later go to the backend, as yours is server driven, then i would say go to variant of technical objects, execute the variant and make a note of the no. of entries it gives.
    3. Verify if both middleware and backend gives same no. of entries.
    If no, then try to correct the replication and then do a sync from the client.
    If yes,  then what I see is, even though you have all technical objects selected as a part of variant, there are still some notifications with technical objects which are not a part of technical objects selection in the above variant.
    So, try to change the variant for technical objects to get more no. of technical objects which covers all the technical objects that might be a part of your notifications.
    Hope this solves your problem.
    Thanks & Best Regards,
    Siva.

  • Get all the values from a multiple select in a multipart form

    Hi there!
    I am using a form with enctype="multipart/form-data" in order to upload files from the form.
    I have read this page: http://commons.apache.org/fileupload/using.html and everything works well for my form.
    The only problem is that I can't get all the values from a "multiple select" html object. I get only one value.
    Using servlets I have used this method:
    public java.lang.String[] getParameterValues(java.lang.String name) But now I have enctype="multipart/form-data" in my form and I can't use this way...
    Is there a way to get all the values of a multi-valued parameter?
    Thanks a lot!
    Stefano

    Hi
    I have got solution for this problem so, I am listing here logic
    assume tag name of html
    <select name="moption" multiple="multiple">
    iterate it in as
    String moption="";
    boolean cnt=true;
    while(itr.hasNext())
    FileItem fi=(FileItem)itr.next();
    if(fi.isFormField())
    if(fi.getFieldName().equals("moption"))
    if(cnt==true)
    moption=fi.getString();
    cnt=false;
    else
    moption=moption+","+fi.getString();
    If wants more help then mail me your problem
    at [email protected]
    Thanks!
    Anand Shankar
    Edited by: AnandShankar on 6 Nov, 2009 12:54 PM

  • How to get all the values in the Select-option.

    Hi,
    I got the select-option field so_week, for eg. If I give 200923 to 200926 (year and week)  in the selection screen and then I need to pass this value (200923) to the FM 'ZWEEK_GET_FIRST_DAY' to get the first day of the week.
    My question is how can i get all the values from the select option, (i.e) i need to get 200923, 200924,200925, 200926.
    Regards,
    Anbu.

    Hello,
    I will prefer Max's solution. But just for the sake of this req.
    i need to get 200923, 200924,200925, 200926
    i am proposing my soln:
    DATA: V_WEEK TYPE RSCALWEEK.
    SELECT-OPTIONS: S_WEEK FOR V_WEEK NO-EXTENSION OBLIGATORY.
    AT SELECTION-SCREEN.
      DATA:
      V_COUNT TYPE I,
      V_ADD   TYPE I,
      RT_WEEK TYPE RANGE OF RSCALWEEK,
      RS_WEEK LIKE LINE OF RT_WEEK.
      V_COUNT = ( S_WEEK-HIGH - S_WEEK-LOW ) + 1.
      DO V_COUNT TIMES.
        RS_WEEK-SIGN = 'I'.
        RS_WEEK-OPTION = 'EQ'.
        RS_WEEK-LOW = S_WEEK-LOW + V_ADD.
        APPEND RS_WEEK TO RT_WEEK. "RT_WEEK--> Will contain the week values
        CLEAR RS_WEEK.
        V_ADD = V_ADD + 1.
      ENDDO.
    @Max: I was stupid enough not to think of your solution. Need to leave office
    Cheers,
    Suhas

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

  • Getting all the values from a JList

    Hi,
    I want to get all the values from a JList and store it into an array. Any method is available to perform this task? Pls help me out with this task.

    Use getModel() on the list to get the ListModel and then call getSize() and getElementAt(int) to loop over the elements
    HTH
    Mike

  • How to get all the values in one column of a JTable

    How to get all the values in one column of a JTable as a Collection of String.
    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.

    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.

  • Get all the field's value of addressbook entry using c++ api

    How can i get all the field values of address book entry in groupwise using c++ api.

    You should be able to do that via the Token API. There is an AddressBookGetEntry method. You could createsome sort of AddressbookEntry class that fetches (via iteration over the defined ABFields) all the innformation.

  • Get All the values of a List Row in one call?

    I am using workflow 2013 from SharePoint Designer for SharePoint online
    I need to get all the values of a row in a list. Is there a way to do this in one call from SharePoint farm to the Workflow Manager?
    Thanks
    Farida

    Hi,
    According to your post, my understanding is that you wanted to get the values of a item in a list using the SharePoint Designer.
    We can use the “Call HTTP Web Service” action to achieve it.
    I had create a sample workflow to get the first row of a list as below, you can have a look at it.
    Note: I had a custom column called “CSing”.
    Result:
    For more information:http://sergeluca.wordpress.com/2013/04/09/calling-the-sharepoint-2013-rest-api-from-a-sharepoint-designer-workflow/
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Get all the rows of the table

    Hi,
         In my example I want to get all the rows of the table. The table has 20 rows. The visibleRowCount is set to 7 and firstVisibleRow is set to 3.
         I have created the table as
         var oTable = new sap.ui.table.Table({
               id: "oTable",
               title: "My Table",
               visibleRowCount: 7,
               firstVisibleRow: 3,
               selectionMode: sap.ui.table.SelectionMode.Single
         I tried to get the rows of the table using the below code
         var table = sap.ui.getCore().byId("oTable");
         var rows = table.getRows();     //     Returns only 7 rows     
        How to get all the rows of the table when the table is populated with a odata service  ?       

    Hi Vishal,
    The table only put in the html file the rows that you define in visiblerowcount (rows control). The method getRows, get this controls, and you only have 7. The table control render automacatically the data in thats rows when you scroll on it.
    If that you want is to retrieve the data of the rows, you need catch it from the model:
    oTable.getModel().getData();
    Regards,

  • How to get all the values from a HashMap? thanks

    hi
    can anyone tell me how to get all the keys and their values contained in a HashMap? thanks

    thanks to u all for ur response, i gues if i need to get both keys and values, i need to use keySet() to get a set of keys first and then using each key to get value. is there any other faster way to get both of them (key and value)? thanks again

  • How to get all the values of a variable with F4 with checkboxes to select

    Dear Experts,
    After Executing a query by giving let 3 values(Out of 10 Values) to a variable.
    To give 2 more input values to the same variable(i.e.,total I wanted to give 5 inputs this time ),after refreshing the query,for that variable if I click F4, I am seeing the historical values(i.e.,3) and remaining 7 values also But with out any Check Boxes besides them to select the 2 inputs.
    In the same F4 Screen, If I click all values(an Icon at The bottom),then also Im seeing but no check Box.
    I hve tried by deleting the Delete Personalization also,but no use.
    Please tell me How to get all the values with F4 with check boxes to select ,whatever I want??
    Thanks in advance

    Take a look at the InfoObject and go to the Business Explorer tab. If the 'Query Def. Filter Value Selection' is set to 'Only Values in InfoProvider', you're only going to get the values in F4 that exist in the InfoProvider, not everything in the Master Data. This would need to be changed to the value of 'Values in Master Data Table' if you want it to show everything possible when F4 is chosen.
    Likewise, you're going to need to look at the query and go to the Advanced tab for the InfoObject. Make sure that the radio button for 'Values in Master Data Table' is selected. If not, then you should change that selection.

Maybe you are looking for

  • Schema validation errors.

    CREATE TABLE XML_BatchDelivery of XMLType XMLSCHEMA "http://www.activcard.com/xml/ns/acms/batch/1.2.xsd" ELEMENT "BatchDelivery"; Insert into XML_BatchDelivery values(xmltype(v_xmltext)); Yields: ORA-19007: Schema and element do not match The schema

  • Why does my Nook not show up in Adobe Digital Edition when opened?

    The nook is connected to the PC.

  • Making a swf wait until the rest of the HTML page is ready?

    I have a site with a common SWF embedded at the top of each page, and then regurlar graphic/text HTML content below it. I was anticipating that the SWF might have a bit of a delay for it to load, and that the rest of the page would be appearing prett

  • My data comes up blank in PDF bank statements and employer W2s (ASP)

    When I try to download bank statements (actually, today it's my W2 form from ADP's craptastic "Payroll Work Center") an ASP file is downloaded to my desktop. It opens up in Prieview, but aside from the form itself, the data fields are blank. I've tri

  • Error:CALL_FUNCTION_RECEIVE_ERROR

    Hi All, Provide inputs. I searched An error occurred when executing a Remote Function Call this thread. Though useful but didnt really solve the problem. Checked for CPI-C error. But Basis guy comes again and says its an abap error. Below attached th