Hi Michael,
TreeItems use up a lot of HTML "boxes", so drawing thousands of them
equates to drawing tens of thousands of HTML boxes. That takes time in
javascipt.
I did this test program some time ago to see what the difference was
between Tree and FastTree - you might be able to use this to your own
practical limit.
regards
gregor
public class Scratch implements EntryPoint {
private VerticalPanel box = new VerticalPanel();
private ScrollPanel scroller = new ScrollPanel();
private Tree tree = makeTree();
//private FastTree tree = makeFastTree();
public void onModuleLoad() {
scroller.add(tree);
box.add(scroller);
box.setWidth("100%");
scroller.setWidth("100%");
// set border styles to show what's happening
Element treeElem = tree.getElement();
DOM.setStyleAttribute(treeElem,"border","2px solid blue");
Element boxElem = box.getElement();
DOM.setStyleAttribute(boxElem,"border","2px solid red");
Element scrElem = scroller.getElement();
DOM.setStyleAttribute(scrElem,"border","2px solid green");
Window.enableScrolling(false);
Window.setMargin("10px");
RootPanel.get().add(box);
DeferredCommand.addCommand(new Command() {
public void execute() {
onWindowResized(Window.getClientWidth(),
Window.getClientHeight());
}
});
onWindowResized(Window.getClientWidth(),
Window.getClientHeight());
}
private static Tree makeTree() {
Tree tree = new Tree() {
// fix for incorrect scrolling when selected item
// is out of view
public void setFocus(boolean inFocus) {};
};
for (int i=0; i<30; i++) {
TreeItem lev1 = new TreeItem("Level 1: " + (i + 1));
tree.addItem(lev1);
for (int j=0; j<3; j++) {
TreeItem lev2 = new TreeItem("Level 2: " + (j + 1));
lev1.addItem(lev2);
for (int k=0; k<3; k++) {
TreeItem lev3 = new TreeItem("Level 3: " + (k +
1));
lev2.addItem(lev3);
}
}
}
return tree;
}
/*
private static FastTree makeFastTree() {
FastTree.addDefaultCSS();
FastTree tree = new FastTree() {
// fix for incorrect scrolling when selected item
// is out of view
public void setFocus(boolean inFocus) {};
};
for (int i=0; i<30; i++) {
FastTreeItem lev1 = new FastTreeItem("Level 1: " + (i +
1));
tree.addItem(lev1);
for (int j=0; j<30; j++) {
FastTreeItem lev2 = new FastTreeItem("Level 2: " + (j
+ 1));
lev1.addItem(lev2);
for (int k=0; k<30; k++) {
FastTreeItem lev3 = new FastTreeItem("Level 3: " +
(k + 1));
lev2.addItem(lev3);
}
}
}
return tree;
}
*/
public void onWindowResized(int width, int height) {
int scrHieght = height - box.getAbsoluteTop() - 12;
if (scrHieght < 1) {
scrHieght = 1;
}
scroller.setHeight("" + scrHieght);
}
}
}
On Nov 11, 4:03 pm, "Michael Vogt" <[EMAIL PROTECTED]> wrote:
> Hi.
>
> Answer forwarding to the group.
>
> What I should have mentioned is, that the transport of the data over
> the wire is no problem, since this is an internal application.
>
> Greetings,
> Michael Vogt
>
> ---------- Forwarded message ----------
> From: trist <[EMAIL PROTECTED]>
> Date: Tue, Nov 11, 2008 at 15:59
> Subject: Re: Tree performance
> To: Michael Vogt <[EMAIL PROTECTED]>
>
> http://google-web-toolkit-incubator.googlecode.com/svn/trunk/demo/Fas...
>
> On 11 Lis, 15:53, "Michael Vogt" <[EMAIL PROTECTED]> wrote:
> > Hello all.
>
> > The question I need to find an answer to is, what is the practical
> > limit of number of items in a leaf of a tree element. Does somebody
> > have experience with this? Is the tree already too slow to use with
> > hundred items, or are thousand items usable?
>
> > Is there a tree available, that allows paging the items in a tree element?
>
> > Thanks a lot,
> > Michael Vogt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---