Tree Layout

Hi. I want to make a tree layout. How can i do that?
I tried to make it by implementing LayoutManager but i did not understand the method addLayoutComponent method
is this method invoked by container's add method? if so when i call add method of my panel this method is not invoked
when it is used?

See java.awt.Container class sources. It has a method
protected void addImpl(Component comp, Object constraints, int index)where the code is invoked
         if (layoutMgr != null) {
          if (layoutMgr instanceof LayoutManager2) {
              ((LayoutManager2)layoutMgr).addLayoutComponent(comp, constraints);
          } else if (constraints instanceof String) {
              layoutMgr.addLayoutComponent((String)constraints, comp);
         }

Similar Messages

  • Is it possible to create a menu structure within iWeb with a so called tree layout? iWeb only provides automatically a horizontal layout

    Is it possible to create a menu structure within iWeb with a so called tree layout? iWeb only provides automatically a horizontal layout

    Not in iWeb itself.
    You have to create these menus yourself. Start here :
         A List Apart: Articles: Suckerfish Dropdowns
    Also, see podcast episode 9 of
         CSS Tricks and Tips
    and then add them to a webpage with the HTML Snippet.
    Or add the menu to the webpage with a JavaScript.
    Here's a sample page :
         http://www.wyodor.net/mfi/roodhout/
         http://www.wyodor.net/mfi/spelling/
         http://www.wyodor.net/mfi/Maaskant/Some_Menus.html
    The how-to-do page are here and here.
    More sample pages on my Made for iPad with iWeb pages.
         http://www.wyodor.net/mfi/
    You may have to learn HTML, CSS, JavaScript, AJAX, DOM and how iWeb creates its pages.

  • How to print tree layout in Sun?

    We are in the process of switching from a Sun box to a Windows 2003 box. I need to know how to print the tree layout in Sun so I can properly map paths and directories.
    Thanks

    Hello.
    If you are looking for a command similar to "tree" in DOS/Windows: I do not know if there is an equivalent but I wrote a program to do this myself. The output is not very good yet.
    #include <stdio.h>
    #include <string.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <dirent.h>
    void printtree(char *dname,int lvl,dev_t dev)
        struct stat st;
        struct dirent *dnt;
        static char buf[500];
        DIR *d;
        int i,l,m;
        l=strlen(dname);
        if(!dev)
            stat(dname,&st);
            dev=st.st_dev;
        d=opendir(dname);
        if(!d) return;
        dname[ l ]='/';
        while((dnt=readdir(d))!=NULL)
            if(strcmp(dnt->d_name,".") && strcmp(dnt->d_name,".."))
            m=0;
            strcpy(dname+l+1,dnt->d_name);
            lstat(dname,&st);
            if(S_ISLNK(st.st_mode))
                stat(dname,&st);
                if(S_ISDIR(st.st_mode)) m=1;
            else if(S_ISDIR(st.st_mode)) m=2;
            if(m)
                for(i=0;i<lvl;i++) printf("|   ");
                printf("+ %s",dnt->d_name);
                if(m==1)
                    i=readlink(dname,buf,sizeof(buf)-1);
                    if(i<0) printf(" <unknown symlink>");
                    else
                        buf[ i ]=0;
                        printf(" <symlink to %s>\n",buf);
                else if(st.st_dev!=dev)
                    printf(" <mount point>\n");
                else
                    printf("\n");
                    printtree(dname,lvl+1,dev);
        closedir(d);
        dname[ l ]=0;
    main(int argc,char **argv)
        static char a[500];
        strcpy(a,(argc>1)?(argv[1]):".");
        printtree(a,0,0);
        return 0;
    }I hope this helps.
    Martin

  • Tree Layout  and a Where Clause

    I have built a uix application using Jdev (10.1.2) + Jheadstart (10.1.2). I followed Jheadstart for ADF developer’s guide (10.1.2) for creating a page with a recursive tree, tree layout style and it works well. Now I need to apply a where clause, programmatically, on the view I am using for generating the tree and the problem is that the where clause 'gets lost' on the child view before the page is displayed. How do I fix this?

    rbackmann wrote:
    And the page_id_1 is a field in the table (SORRY EXAMPLE BAD NAMING CONVENTIONS) that IS VARCHAR
    and houses a comma seperated list of page numbers ie 28,29, 30Okay, I was wrong about the field name :(
    Carefully examine the query, expecially the INSTR line. Get the values in both the column and the bind variable and make sure they are what you think they are.
    The example on the other post might have failed because you were equality comparing the column value to '28' when it might have been a csv with commas unless you changed it (something worth trying).
    On 4th look I may (or may not) have something. PAGE_ID_1 is a VARCHAR2, while the 28 you compared it to was a number. Its a long shot, but maybe SQL is trying to convert the csv field to a number, failing to raise an error message where you can find it, and failing for that reason. Try using '28' on the equality test.
    Edited by: riedelme on May 8, 2009 6:03 AM

  • Network UI - JNET - Generic Tree Layout - Collapse Node

    Hi,
    we are using a generic tree layout in network ui component to display organizational chart.
    The problem is that when a node in this organizational chart is collapsed there is empty space left which has been occupied by this node and its child nodes before.
    Is there a way to prevent this from happening, for example: during node collapse the chart reorganizes itself
    so that there is no unnecessary empty space?
    Regards,
    Ladislav

    Hi,
    Following link might be useful for you.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/lw/webdynpro/jnet_jgantt%20developer%20documentation/api/com/sap/jnet/package-summary.html#commands
    Regards
    Ayyapparaj

  • Average sum for a column in ALV tree layout

    Hi,
    I've trying to set an average sum for a column in an ALV tree report.  In the field catalog i set the DO_SUM field to 'X' and this will do a total sum, but I can't find out how in the code to do the average sum.
    Also to get round this I was going to just set a default display variant with the "average" sum option saved after i had manually selected the columns and set it to this.  Problem with this is that when i re-run it, the sum comes back as a total rather than an average.  I have tried setting display variants on the SAP example ALV tree programs and the same thing happens.
    Does anyone know how i can get round this?
    Cheers
    Matt.

    Hi,
    In addition to setting DO_SUM = 'X' you need to specify function in H_FTYPE field. It should be set to 'AVG' in your case.
    ls_fielcat-do_sum = 'X'.
    ls_fieldcat-h_ftype = 'AVG.

  • Item strudte in designing tree layout

    Hi All,
    I am creating a tree structure by using class "cl_gui_list_tree". For this I require node structure & item structure. For node i am using: data: node type treev_node.
    But regarding item i am not sure which structure to use to declare it.
    Plz help me in this...
    Thanks in advance,
    Vijay

    Use a table type of structure MTREEITM or MTREESNODE.
    Manoj

  • Editable Recursive Tree

    hi evreyone
    I need to create an editable tree based on (one table called Locations)
    this is the structure of this table
    LocationNo
    LocationName
    ParentLocationNo
    LocationNo and ParentLocationNo are Forign keys
    according to what I've red I should use a recursive tree (Self-Reference forign key)
    using a view that represent the tree (nodes & branches)
    how can I create this tree (with Details Steps) ?
    I am using
    Jdeveloper 11.1.1.2.0
    JHeadstart 11.1.1.2.29
    thanks

    hi
    According to chapter 5 "Creating Tree Layouts", 5.7.4 "Variation: Recursive Tree"
    I've created a Recursive Tree based on table call (Location)
    but the problem is how can I refresh the data ... I mean .. How can I See the new record that I've
    created in the same tree without moving in it (to make a refresh)
    thanks

  • Using TransformGestureEvents in Flash Builder

    Hi all,
    I  am trying to use the TransformGestureEvents to allow interaction inside  of a FLARE based application. I want to create a data visualisation app  with touch interaction.
    I have Flash Player 10.1, which  is needed for these classes, as i have already used them in a Flash CS5  test project, and i worked great!  But when i try to import the  transform gesture events, an error appears saying:
    1172: Defination flash.events:TransformGestureEvents could not be found.
    Has anyone got any idea how i can use TransformGestureEvents inside of Flash Builder?
    Any advice, is deeply appreciated!
    Thanks in advance

    Thanks for your reply!
    I am using flex 4.0 SDK and flash player 10.1.
    Since then i have tried to use the adobe air 2.5 SDK because I read somewhere that it included Touch events. I have tried to overlay the AIR SDK into my Flex 4.0 SDK folder and it doesn't seem to have worked. I am using a mac and the documentation out there to do this , isn't exactly straight forward and ive followed the instructions, but no success. Im really surprised that Adobe have not released a flex SDk with Touch events include, i mean it seem dumb not too!?!?
    Maybe if i gave you more of an insight into what i want to achieve, this could help.
    I want to use flash builder to create a search for a series of media API's (e.g Spotify/Last.FM or YouTube) the user would search for what they want and the results would be displayed in a Radial Tree Layout using the FLARE library to construct the visualisaton and I wanted to use Gestures to enable the user to navigate around the results, (ZOOMING, SELECTING, etc). I have thought about using OpenFrameworks to do this, but I would prefer to use FLASH.
    I am creating this project for my Final Degree!
    Any advice on this, would be great.

  • How to make recursive function for sitetree

    I have a table in the db which contains the page names. Each page has an ID, subpages have a parentID that is the same as the PageID and there is a sort order.
    What I would like to create is a site tree layout where I can add functionalities to add pages, modify order. In fact what I have in mind is something like this:
    SITE EXPLORER
    categories
    article
    edit category
    items
    order
    www<sitename>.
    [order]
    Maincat 1
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
    Maincat  2
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
    [order]
          subcat 1
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
          subcat 2
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
    Maincat 3
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
    [order]
          subcat 3
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
               subcat 3.1
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
          subcat 4
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
          subcat 5
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
    Maincat 4
    [+] [-][move]
    [+][list]
    [edit]
    [+] [change]
    So the column Site explorer has to be created dynamically. I don't know in advanced how deep the structure goes.
    Any good ideas??
    Bianca

    Recursion then is exactly what you need.
    I assume that your top level does not have any value in parentID, so that is where to start. I would do somethign like this.
    <cfquery nam="parents">
    WHERE parentid = ''
    </cfquery>
    <cfloop query="parents">
         <cfset buldLink(parent.text, parent.id) />
    </cfloop>
    <cffunction name="buildLink">
         <cfargument name="text" />
         <cfargument name="id" />
         <!--- Do whatever logic you need here to build the link --->
         <!--- You can output it here or return the value after the next part --->
         <!--- check for children --->
         <cfiquery name="children">
              WHERE parentid = #arguments.id# // Use cfqueryparam
         </cfquery>
         <cfif children.recordcount>
              <cfloop query="children">
                   <cfset buildLink(children.text, children.id) />
              </cfloop>
         </cfif>
    </cffunction>
    Message was edited by: 12Robots Oops accidentally posted before I was done.

  • Trying to re-create our 10g custom skin in 11g

    Hi Everyone:
    We had a detailed custom skin and also utilized customized velocity templates that created a specific look and feel to our application in 10g. We used a header.jspx & leftside.jspx that were in the region-metadata.xml file. The JHeadstart team assisted a previous employee with setting all of this up.
    We are trying to convert our applications over from 10g to 11g and think that enhancements such as the "tree" layout will replace needing a leftside.jspx page that listed the menu links along the left side instead of folders across the top. We have gone through the 11g Tutorial and read chapter 19 "Applying Custom Skins to Applications" of the "Web User Interface Developer's Guide for Oracle Application Development Framework". While working on a simple webpage to start with in our application, we registered the custom skin as specified in "Applying Custom Skins to Applications", but things look very different, and I'm trying to get a handle on how to re-apply the look and feel now that this section of our application has been converted to 11g and properly utilize the new features of 11g that weren't available in 10g. To start with, we had a custom Logo on our Application that I would like to show up on the Header of the Application in the same spot where the "Oracle JHeadstart Demo" title is displayed. I am trying to study the custom_labels.vm velocity template, but am not sure where to apply this. The logo is in the form of a .gif file.
    Can someone tell me how to put our custom logo .gif file in the Header where the Oracle JHeadstart Demo title is displayed and have it generated through JHeadstart?
    Starting there can hopefully open up ideas on how to apply the rest of our look and feel utilizing all of the new features of 11g, not just replicating things as they were done in 10g.
    Thanks very much in advance.
    Mary
    UofW

    Hi Steven:
    Great to hear from you, I was hoping you'd reply :)
    I followed your instructions, and also changed the header and footer size attributes (headerGlobalSize & footerGlobalSize) to accommodate our larger .gif Logo. So far, so good. I made these changes in the default layout velocity template - jhsPageTemplate.vm which generates the JhsPageTemplate.jspx page. Starting to work toward the look and feel our users want. However, I was hoping to use the tree layout. I want to institute these changes in the JhsTreeMenuPageTemplate.jspx, but I am unable to find the velocity template that generates the JhsTreeMenuPageTemplate.jspx.
    Could you please tell me where it is?
    Thanks again, and Merry Christmas to you and yours.
    Mary
    UofW

  • JNet onNodeDoubleClicked Event in WebDynpro

    Hello,
    I created a Network UI Element in Web Dynpro, which has a tree-layout with some nodes.
    For the onNodeDoubleClicked Event I registered a method. If now a node is double clicked, I want to display the name or the id of the clicked node for example in a textview. How to get the Name or the Id of the clicked node??
    Edited by: HSchilling on May 29, 2009 4:35 PM
    Edited by: HSchilling on Jun 4, 2009 2:12 PM

    I solved the Problem.
    I had to map the event parameters like described in this wiki:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/webDynproJava-UsingGanttandNetworkUI+Element

  • Hierarchical data in VizPacker

    Hi,
    I am creating an extension of tree layout for lumira. I have implemented d3 part of it, but i am facing issue while using same in vizpacker. I am uploading data from csv file. Inside my d3 code i am recieving csv data as array of json objects, i am using d3.nest() to create hierarchical data and this way i am able to draw my graph but with vizpacker, format of data is different.
    [{"Set 1":["Population over 60","India","2002"],"NumericMeasure":["7.01"]},{"Set 1":["Population under 15","India","2002"],"NumericMeasure":["33.42"]},{"Set 1":["Population over 60","India","2003"],"NumericMeasure":["7.08"]},{"Set 1":["Population under 15","India","2003"],"NumericMeasure":["33.03"]},{"Set 1":["Population over 60","India","2004"],"NumericMeasure":["7.15"]},{"Set 1":["Population under 15","India","2004"],"NumericMeasure":["32.62"]}]
    I want to nest elements first by country and then by Indicators followed by NumericMeasure like this
    {"country": "India","children": [{"Indicator": "population under 15","children": [{"year": "2002","numericMeasure": "30.1"},{"year": "2003","numericMeasure": "31.5"},{
    "year": 2004,"numericMeasure": "32.9"}]},{"Indicator": "population over 60","children": [{"year": "2002","numericMeasure": "7.1"},{"year": "2003","numericMeasure": "7.5"},{"year": 2004,"numericMeasure": "7.0"
    How should i do it? Thanks in advance!
    Regards,
    Ashish.

    Hey Ashish,
    I'm currently in an [R] headspace, so coming back to JS/VizPacker may require some additional time to go through your code with you.
    As an employee I would highly recommend that you revert internally, as there are some great resources for you (be sure to check out the JAM page; Jan should be able to guide you) - and then you can come back and post the solution to your question.
    This example in d3 is pretty straight-forward though:
    var data = [
      { "name" : "Level 2: A", "parent":"Top Level" },
      { "name" : "Top Level", "parent":"null" },
      { "name" : "Son of A", "parent":"Level 2: A" },
      { "name" : "Daughter of A", "parent":"Level 2: A" },
      { "name" : "Level 2: B", "parent":"Top Level" }
    // *********** Convert flat data into a nice tree ***************
    // create a name: node map
    var dataMap = data.reduce(function(map, node) {
    map[node.name] = node;
    return map;
    // create the tree array
    var treeData = [];
    data.forEach(function(node) {
    // add to parent
    var parent = dataMap[node.parent];
    if (parent) {
    // create child array if it doesn't exist
    (parent.children || (parent.children = []))
    // add node to child array
    .push(node);
    } else {
    // parent is null or missing
    treeData.push(node);
    // ************** Generate the tree diagram *****************
    var margin = {top: 20, right: 120, bottom: 20, left: 120},
    width = 960 - margin.right - margin.left,
    height = 500 - margin.top - margin.bottom;
    var i = 0;
    var tree = d3.layout.tree()
    .size([height, width]);
    var diagonal = d3.svg.diagonal()
    .projection(function(d) { return [d.y, d.x]; });
    var svg = d3.select("body").append("svg")
    .attr("width", width + margin.right + margin.left)
    .attr("height", height + margin.top + margin.bottom)
      .append("g")
    .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
    root = treeData[0];
    update(root);
    function update(source) {
      // Compute the new tree layout.
      var nodes = tree.nodes(root).reverse(),
    links = tree.links(nodes);
      // Normalize for fixed-depth.
      nodes.forEach(function(d) { d.y = d.depth * 180; });
      // Declare the nodes…
      var node = svg.selectAll("g.node")
    .data(nodes, function(d) { return d.id || (d.id = ++i); });
      // Enter the nodes.
      var nodeEnter = node.enter().append("g")
    .attr("class", "node")
    .attr("transform", function(d) {
      return "translate(" + d.y + "," + d.x + ")"; });
      nodeEnter.append("circle")
    .attr("r", 10)
    .style("fill", "#fff");
      nodeEnter.append("text")
    .attr("x", function(d) {
      return d.children || d._children ? -13 : 13; })
    .attr("dy", ".35em")
    .attr("text-anchor", function(d) {
      return d.children || d._children ? "end" : "start"; })
    .text(function(d) { return d.name; })
    .style("fill-opacity", 1);
      // Declare the links…
      var link = svg.selectAll("path.link")
    .data(links, function(d) { return d.target.id; });
      // Enter the links.
      link.enter().insert("path", "g")
    .attr("class", "link")
    .attr("d", diagonal);
    (see the full example here: D3.js tree diagram generated from 'flat' data)
    If you haven't done so already, I would highly recommend you go through Matt Lloyd's tutorials for the VizPacker (Part 1, Part 2, Part 3).
    What is the d3 example that you are looking at?
    Can you confirm that your method works externally in HTML - and that you're not getting your intended output from the Lumira side, please?
    //bijan

  • Dynamic selection of Interface subclasses

    Hi, wonder if anyone can help. I'm writing a package that provides various tree-related GUI features. I've defined an interface (TreeLayout) which specifies a single static method (layout) that specifies coordinates for the nodes in a tree structure. There are various standard implementations of this interface within the package (eg table layout, tree layout, radial layout etc), but I want other people to be able to create their own implementations which can then be selected at run time. These implementations need to be selectable in an object called TreeLayoutManager.
    Now obviously one way to do this would be to require the user to instantiate their class and pass this as an object into TreeLayoutManager, which would then cast it to TreeLayout and call the layout method. If you wanted to get fancier, you could pass the qualified name and have TreeLayoutManager instantiate the class instead. However, we don't really need to instantiate the class at all, since the only method is static. So I was wondering if there's some way to call the static method on a class without instantiating it, and without knowing the class name at compile time.
    thanks
    Mike

    Thanks for your responses.
    The method is static simply because it doesn't need to be otherwise - it's just a way of letting people add their own layout methods. All positional info is stored in a PositionedTree object, which is a sort of wrapper for the actual tree data. Of course there probably isn't much overhead in instantiating a class with one static method and no variables - it would just be cleaner, I suppose, if there was a way to avoid instantiating it.
    I think I'll probably go with the Class.forName and class.newInstance() approach. Will probably also have a mechanism to register the class with the LayoutManager (using a Hashtable), so users can pass a nickname string rather than the fully-qualified class each time.
    Thanks again for your responses.
    Cheers, Mike

  • Moved workstations get re-imported

    I'm running ZW 7SP1_IR1 on NW6.5SP. I auto-import all my workstations into
    one container, as my tree layout doesn't really let me put them anywhere
    thats geographically logical. I was leaving them all in one big flat OU and
    making groups. I decided to move them into sub-contexts, organized by
    geographical location.
    I was under the impression that when you moved a workstation object, it
    added an entry to the containers attributes that tells the workstation where
    to go when it looks for the object next (a pointer of sorts).
    I see a ton of them listed under the containers "Other" tab, but they don't
    seem to be doing their job. Objects that I have moved into another container
    are re-imported into the original location shortly after I move them (when
    workstation reboots or whatnot)
    Am I doing something wrong? Should I just be able to move the WS Object with
    the Zenworks plugins installed for C1?
    TIA.
    -Adam

    Hi,
    Adam Gabriel wrote:
    >
    > I'm running ZW 7SP1_IR1 on NW6.5SP. I auto-import all my workstations into
    > one container, as my tree layout doesn't really let me put them anywhere
    > thats geographically logical. I was leaving them all in one big flat OU and
    > making groups. I decided to move them into sub-contexts, organized by
    > geographical location.
    >
    > I was under the impression that when you moved a workstation object, it
    > added an entry to the containers attributes that tells the workstation where
    > to go when it looks for the object next (a pointer of sorts).
    Right. *If* you're using COnsoleOne with Zen snapins to do the move.
    > I see a ton of them listed under the containers "Other" tab, but they don't
    > seem to be doing their job. Objects that I have moved into another container
    > are re-imported into the original location shortly after I move them (when
    > workstation reboots or whatnot)
    Do the workstations and the server have the necessary rights to the new
    container?
    > Am I doing something wrong? Should I just be able to move the WS Object with
    > the Zenworks plugins installed for C1?
    That is correct.
    CU,
    Massimo Rosen
    Novell Product Support Forum Sysop
    No emails please!
    http://www.cfc-it.de

Maybe you are looking for