Re: [gwt-contrib] Re: DockLayoutPanel and Maps
I just wanted to note that a recent change to trunk should fix problems with using the layout panel in trunk, and we'll be including it in the next release. On Fri, Nov 20, 2009 at 12:37 AM, jd wrote: > Just wanted to update this example by noting that with the recent > changes this workaround no longer works. This is because the calls to > layout() are now delayed and scheduled after the current code > executes. I had to do this to get the map to layout correctly: > > >root.animate(0, new AnimationCallback() >{ >public void onLayout(Layer layer, double progress) >{ >} > >public void onAnimationComplete() >{ >map.checkResizeAndCenter(); >} >}); > > > John > > > On Oct 6, 2:09 am, Joel Webber wrote: > > Thanks for letting me know about this. I'll follow up on that thread. > > > > > > -- > http://groups.google.com/group/Google-Web-Toolkit-Contributors > -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: DockLayoutPanel and Maps
Just wanted to update this example by noting that with the recent changes this workaround no longer works. This is because the calls to layout() are now delayed and scheduled after the current code executes. I had to do this to get the map to layout correctly: root.animate(0, new AnimationCallback() { public void onLayout(Layer layer, double progress) { } public void onAnimationComplete() { map.checkResizeAndCenter(); } }); John On Oct 6, 2:09 am, Joel Webber wrote: > Thanks for letting me know about this. I'll follow up on that thread. > > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: DockLayoutPanel small improvement
Thanks for the patch. I disagree with adding the setCenter method, I think the override of add() is the right thing to do. Making the method more forgiving also seems wrong, with the potential to hide the user's mistakes. I agree that the must-add-center-last thing is annoying, but Joel will need to say whether this is the right fix for it. http://gwt-code-reviews.appspot.com/77809 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel change size north panel
No, but that's a good idea. I'll make a point to add such a method. On Mon, Oct 12, 2009 at 12:25 PM, aris wrote: > > Hello > I added a control “c1” using addNorth(c1, 20), is it possible to > change the size of that panel from code? > (I'm using latest version from SVN) > > Thanks > > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
Thanks for letting me know about this. I'll follow up on that thread. On Sun, Oct 4, 2009 at 3:43 AM, jd wrote: > > I found an issue using DockLayoutPanel with YUI grids. > > Just double posting here as Joel is listening... > > > http://groups.google.com/group/google-web-toolkit/browse_thread/thread/56eae8aff7502287 > > On Sep 29, 8:52 pm, Joel Webber wrote: > > That makes sense. RequiresResize was created for precisely this kind of > > scenario, where a widget simply can't work properly without knowing when > it > > has been resized. It doesn't actually cause the widget to be any *more* > broken > > if you fail to call onResize(), but it serves as a hint to the developer > > that this is required, and will cause panels that implement > ProvidesResize > > to automatically call onResize() for their children that require it. > > > > > > > > On Tue, Sep 29, 2009 at 6:49 AM, Eric Ayers wrote: > > > > > I'll look into implementing RequiresResize, I created an issue: > > > > > http://code.google.com/p/gwt-google-apis/issues/detail?id=308 > > > > > The problem with the map not refreshing properly and having to call > > > checkResizeAndCenter() immediately after creating it has been around a > > > long time and there is a FAQ up for it. I hope this works. Having a > > > way to automatically compensate would take some pain out of creating > > > maps applications! > > > > > On Sep 29, 12:29 am, Joel Webber wrote: > > > > Having MapWidget implement RequiresResize would seem to be the right > > > > approach. I can see how the maps code would need to be informed when > it > > > is > > > > resized, as it needs to create the appropriate number of tiles on > each > > > axis. > > > > Does this sound reasonable to you, Eric? > > > > > > On Mon, Sep 28, 2009 at 9:18 PM, jd wrote: > > > > > > > Yeah sorry I was not sure if this was more of a development topic > or > > > > > typical user problem. > > > > > > > I tried your suggestion of map.checkResizeAndCenter() and it works > > > > > perfectly. It also seems a better solution than my original > > > > > SimplePanel place holder. > > > > > > > It seems that the Google map object initializes its size as soon as > it > > > > > is added to the document. Perhaps MapWidget could also implement > > > > > RequiresResize? > > > > > > > So now a working example is: > > > > > > >public void onModuleLoad() > > > > >{ > > > > >DockLayoutPanel p = new DockLayoutPanel(Unit.PX); > > > > >p.addNorth(new HTML("north"), 100); > > > > >p.addSouth(new HTML("south"), 100); > > > > >p.addEast(new HTML("east"), 100); > > > > >p.addWest(new HTML("west"), 100); > > > > > > >MapWidget map = new > MapWidget(LatLng.newInstance(-41.1, > > > > > 174.8), 5); > > > > >p.add(map); > > > > > > >p.layout(); > > > > > > >RootLayoutPanel rp = RootLayoutPanel.get(); > > > > >rp.add(p); > > > > > > > rp.layout(); > > > > > > >map.checkResizeAndCenter(); > > > > >} > > > > > > > John > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
I found an issue using DockLayoutPanel with YUI grids. Just double posting here as Joel is listening... http://groups.google.com/group/google-web-toolkit/browse_thread/thread/56eae8aff7502287 On Sep 29, 8:52 pm, Joel Webber wrote: > That makes sense. RequiresResize was created for precisely this kind of > scenario, where a widget simply can't work properly without knowing when it > has been resized. It doesn't actually cause the widget to be any *more* broken > if you fail to call onResize(), but it serves as a hint to the developer > that this is required, and will cause panels that implement ProvidesResize > to automatically call onResize() for their children that require it. > > > > On Tue, Sep 29, 2009 at 6:49 AM, Eric Ayers wrote: > > > I'll look into implementing RequiresResize, I created an issue: > > > http://code.google.com/p/gwt-google-apis/issues/detail?id=308 > > > The problem with the map not refreshing properly and having to call > > checkResizeAndCenter() immediately after creating it has been around a > > long time and there is a FAQ up for it. I hope this works. Having a > > way to automatically compensate would take some pain out of creating > > maps applications! > > > On Sep 29, 12:29 am, Joel Webber wrote: > > > Having MapWidget implement RequiresResize would seem to be the right > > > approach. I can see how the maps code would need to be informed when it > > is > > > resized, as it needs to create the appropriate number of tiles on each > > axis. > > > Does this sound reasonable to you, Eric? > > > > On Mon, Sep 28, 2009 at 9:18 PM, jd wrote: > > > > > Yeah sorry I was not sure if this was more of a development topic or > > > > typical user problem. > > > > > I tried your suggestion of map.checkResizeAndCenter() and it works > > > > perfectly. It also seems a better solution than my original > > > > SimplePanel place holder. > > > > > It seems that the Google map object initializes its size as soon as it > > > > is added to the document. Perhaps MapWidget could also implement > > > > RequiresResize? > > > > > So now a working example is: > > > > > public void onModuleLoad() > > > > { > > > > DockLayoutPanel p = new DockLayoutPanel(Unit.PX); > > > > p.addNorth(new HTML("north"), 100); > > > > p.addSouth(new HTML("south"), 100); > > > > p.addEast(new HTML("east"), 100); > > > > p.addWest(new HTML("west"), 100); > > > > > MapWidget map = new MapWidget(LatLng.newInstance(-41.1, > > > > 174.8), 5); > > > > p.add(map); > > > > > p.layout(); > > > > > RootLayoutPanel rp = RootLayoutPanel.get(); > > > > rp.add(p); > > > > > rp.layout(); > > > > > map.checkResizeAndCenter(); > > > > } > > > > > John --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
That makes sense. RequiresResize was created for precisely this kind of scenario, where a widget simply can't work properly without knowing when it has been resized. It doesn't actually cause the widget to be any *more* broken if you fail to call onResize(), but it serves as a hint to the developer that this is required, and will cause panels that implement ProvidesResize to automatically call onResize() for their children that require it. On Tue, Sep 29, 2009 at 6:49 AM, Eric Ayers wrote: > > I'll look into implementing RequiresResize, I created an issue: > > http://code.google.com/p/gwt-google-apis/issues/detail?id=308 > > The problem with the map not refreshing properly and having to call > checkResizeAndCenter() immediately after creating it has been around a > long time and there is a FAQ up for it. I hope this works. Having a > way to automatically compensate would take some pain out of creating > maps applications! > > > On Sep 29, 12:29 am, Joel Webber wrote: > > Having MapWidget implement RequiresResize would seem to be the right > > approach. I can see how the maps code would need to be informed when it > is > > resized, as it needs to create the appropriate number of tiles on each > axis. > > Does this sound reasonable to you, Eric? > > > > > > > > On Mon, Sep 28, 2009 at 9:18 PM, jd wrote: > > > > > Yeah sorry I was not sure if this was more of a development topic or > > > typical user problem. > > > > > I tried your suggestion of map.checkResizeAndCenter() and it works > > > perfectly. It also seems a better solution than my original > > > SimplePanel place holder. > > > > > It seems that the Google map object initializes its size as soon as it > > > is added to the document. Perhaps MapWidget could also implement > > > RequiresResize? > > > > > So now a working example is: > > > > >public void onModuleLoad() > > >{ > > >DockLayoutPanel p = new DockLayoutPanel(Unit.PX); > > >p.addNorth(new HTML("north"), 100); > > >p.addSouth(new HTML("south"), 100); > > >p.addEast(new HTML("east"), 100); > > >p.addWest(new HTML("west"), 100); > > > > >MapWidget map = new MapWidget(LatLng.newInstance(-41.1, > > > 174.8), 5); > > >p.add(map); > > > > >p.layout(); > > > > >RootLayoutPanel rp = RootLayoutPanel.get(); > > >rp.add(p); > > > > > rp.layout(); > > > > >map.checkResizeAndCenter(); > > >} > > > > > John > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
I'll look into implementing RequiresResize, I created an issue: http://code.google.com/p/gwt-google-apis/issues/detail?id=308 The problem with the map not refreshing properly and having to call checkResizeAndCenter() immediately after creating it has been around a long time and there is a FAQ up for it. I hope this works. Having a way to automatically compensate would take some pain out of creating maps applications! On Sep 29, 12:29 am, Joel Webber wrote: > Having MapWidget implement RequiresResize would seem to be the right > approach. I can see how the maps code would need to be informed when it is > resized, as it needs to create the appropriate number of tiles on each axis. > Does this sound reasonable to you, Eric? > > > > On Mon, Sep 28, 2009 at 9:18 PM, jd wrote: > > > Yeah sorry I was not sure if this was more of a development topic or > > typical user problem. > > > I tried your suggestion of map.checkResizeAndCenter() and it works > > perfectly. It also seems a better solution than my original > > SimplePanel place holder. > > > It seems that the Google map object initializes its size as soon as it > > is added to the document. Perhaps MapWidget could also implement > > RequiresResize? > > > So now a working example is: > > > public void onModuleLoad() > > { > > DockLayoutPanel p = new DockLayoutPanel(Unit.PX); > > p.addNorth(new HTML("north"), 100); > > p.addSouth(new HTML("south"), 100); > > p.addEast(new HTML("east"), 100); > > p.addWest(new HTML("west"), 100); > > > MapWidget map = new MapWidget(LatLng.newInstance(-41.1, > > 174.8), 5); > > p.add(map); > > > p.layout(); > > > RootLayoutPanel rp = RootLayoutPanel.get(); > > rp.add(p); > > > rp.layout(); > > > map.checkResizeAndCenter(); > > } > > > John --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
Having MapWidget implement RequiresResize would seem to be the right approach. I can see how the maps code would need to be informed when it is resized, as it needs to create the appropriate number of tiles on each axis. Does this sound reasonable to you, Eric? On Mon, Sep 28, 2009 at 9:18 PM, jd wrote: > > Yeah sorry I was not sure if this was more of a development topic or > typical user problem. > > I tried your suggestion of map.checkResizeAndCenter() and it works > perfectly. It also seems a better solution than my original > SimplePanel place holder. > > It seems that the Google map object initializes its size as soon as it > is added to the document. Perhaps MapWidget could also implement > RequiresResize? > > So now a working example is: > >public void onModuleLoad() >{ >DockLayoutPanel p = new DockLayoutPanel(Unit.PX); >p.addNorth(new HTML("north"), 100); >p.addSouth(new HTML("south"), 100); >p.addEast(new HTML("east"), 100); >p.addWest(new HTML("west"), 100); > >MapWidget map = new MapWidget(LatLng.newInstance(-41.1, > 174.8), 5); >p.add(map); > >p.layout(); > >RootLayoutPanel rp = RootLayoutPanel.get(); >rp.add(p); > > rp.layout(); > >map.checkResizeAndCenter(); >} > > John > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
Yeah sorry I was not sure if this was more of a development topic or typical user problem. I tried your suggestion of map.checkResizeAndCenter() and it works perfectly. It also seems a better solution than my original SimplePanel place holder. It seems that the Google map object initializes its size as soon as it is added to the document. Perhaps MapWidget could also implement RequiresResize? So now a working example is: public void onModuleLoad() { DockLayoutPanel p = new DockLayoutPanel(Unit.PX); p.addNorth(new HTML("north"), 100); p.addSouth(new HTML("south"), 100); p.addEast(new HTML("east"), 100); p.addWest(new HTML("west"), 100); MapWidget map = new MapWidget(LatLng.newInstance(-41.1, 174.8), 5); p.add(map); p.layout(); RootLayoutPanel rp = RootLayoutPanel.get(); rp.add(p); rp.layout(); map.checkResizeAndCenter(); } John --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
Actually, can I at least ask for a cross-posting here? I would very much like to know if there are common cases that get broken by the new layout system, and this seems like a pretty important one. I don't actually know much about how maps tends to initialize itself, but I'll keep an eye on this thread -- any more information on precisely what's going on would be helpful. Thanks. On Mon, Sep 28, 2009 at 7:14 AM, Eric Ayers wrote: > Also, this discussion would be more appropriate for the gwt-google-apis > group. GWT contributors is for the developers of the Google Web Toolkit core > product. > > > On Mon, Sep 28, 2009 at 10:13 AM, Eric Ayers wrote: > >> Have you tried the method map.checkResizeAndCenter()? >> >> >> On Mon, Sep 28, 2009 at 9:42 AM, jd wrote: >> >>> >>> Actually I think that was a red herring - setting the parentElem style >>> just forced a re-render and changing the map size had the same effect. >>> >>> I think the problem is due to the map trying to initialize itself >>> before layout() is called. If I add a holder panel like this: >>> >>>SimplePanel holder = new SimplePanel(); >>>p.add(holder); >>> >>> and then add the map after layout() like: >>> >>>p.layout(); >>> >>>MapWidget map = new MapWidget(LatLng.newInstance(50, 50), >>> 8); >>>map.setWidth("100%"); >>>map.setHeight("100%"); >>> holder.add(map); >>> >>> it works. >>> >>> I have one question about threading in the browser - I have used YUI >>> LayoutManager which is very similar to DockLayoutPanel. >>> >>> http://developer.yahoo.com/yui/examples/layout/nested_layout.html >>> >>> If you want to nest layouts or use a map inside a layout you need to >>> register a listener for an onrender event. When I asked why, Dave >>> Glass said that although the JS is single threaded, the DOM elements >>> will not be created by serially so you must wait until the event fires >>> before you can safely layout nested items that depend on the parent >>> layout. >>> >>> Could this be a problem here also? >>> >>> Thanks, >>> >>> John >>> >>> On Sep 28, 7:06 pm, jd wrote: >>> > I have found the issue and am not sure how to fix it using the current >>> > API. After setting 100% height and width on both the DockLayoutPanel >>> > and RootLayoutPanel the map still reported a span of 0 and did not >>> > render correctly. In Safari's Inspector I could see that the only >>> > element without 100% height and width was the generated "layout >>> > parent" element but after changing this in using the inspector it >>> > worked. >>> > >>> > So I think I need to be able to access the Layout.parentElem to modify >>> > its style. >>> > >>> >>> >> >> >> -- >> Eric Z. Ayers >> Google Web Toolkit, Atlanta, GA USA >> > > > > -- > Eric Z. Ayers > Google Web Toolkit, Atlanta, GA USA > > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
Also, this discussion would be more appropriate for the gwt-google-apis group. GWT contributors is for the developers of the Google Web Toolkit core product. On Mon, Sep 28, 2009 at 10:13 AM, Eric Ayers wrote: > Have you tried the method map.checkResizeAndCenter()? > > > On Mon, Sep 28, 2009 at 9:42 AM, jd wrote: > >> >> Actually I think that was a red herring - setting the parentElem style >> just forced a re-render and changing the map size had the same effect. >> >> I think the problem is due to the map trying to initialize itself >> before layout() is called. If I add a holder panel like this: >> >>SimplePanel holder = new SimplePanel(); >>p.add(holder); >> >> and then add the map after layout() like: >> >>p.layout(); >> >>MapWidget map = new MapWidget(LatLng.newInstance(50, 50), >> 8); >>map.setWidth("100%"); >>map.setHeight("100%"); >> holder.add(map); >> >> it works. >> >> I have one question about threading in the browser - I have used YUI >> LayoutManager which is very similar to DockLayoutPanel. >> >> http://developer.yahoo.com/yui/examples/layout/nested_layout.html >> >> If you want to nest layouts or use a map inside a layout you need to >> register a listener for an onrender event. When I asked why, Dave >> Glass said that although the JS is single threaded, the DOM elements >> will not be created by serially so you must wait until the event fires >> before you can safely layout nested items that depend on the parent >> layout. >> >> Could this be a problem here also? >> >> Thanks, >> >> John >> >> On Sep 28, 7:06 pm, jd wrote: >> > I have found the issue and am not sure how to fix it using the current >> > API. After setting 100% height and width on both the DockLayoutPanel >> > and RootLayoutPanel the map still reported a span of 0 and did not >> > render correctly. In Safari's Inspector I could see that the only >> > element without 100% height and width was the generated "layout >> > parent" element but after changing this in using the inspector it >> > worked. >> > >> > So I think I need to be able to access the Layout.parentElem to modify >> > its style. >> > >> >> >> > > > -- > Eric Z. Ayers > Google Web Toolkit, Atlanta, GA USA > -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
Have you tried the method map.checkResizeAndCenter()? On Mon, Sep 28, 2009 at 9:42 AM, jd wrote: > > Actually I think that was a red herring - setting the parentElem style > just forced a re-render and changing the map size had the same effect. > > I think the problem is due to the map trying to initialize itself > before layout() is called. If I add a holder panel like this: > >SimplePanel holder = new SimplePanel(); >p.add(holder); > > and then add the map after layout() like: > >p.layout(); > >MapWidget map = new MapWidget(LatLng.newInstance(50, 50), > 8); >map.setWidth("100%"); >map.setHeight("100%"); > holder.add(map); > > it works. > > I have one question about threading in the browser - I have used YUI > LayoutManager which is very similar to DockLayoutPanel. > > http://developer.yahoo.com/yui/examples/layout/nested_layout.html > > If you want to nest layouts or use a map inside a layout you need to > register a listener for an onrender event. When I asked why, Dave > Glass said that although the JS is single threaded, the DOM elements > will not be created by serially so you must wait until the event fires > before you can safely layout nested items that depend on the parent > layout. > > Could this be a problem here also? > > Thanks, > > John > > On Sep 28, 7:06 pm, jd wrote: > > I have found the issue and am not sure how to fix it using the current > > API. After setting 100% height and width on both the DockLayoutPanel > > and RootLayoutPanel the map still reported a span of 0 and did not > > render correctly. In Safari's Inspector I could see that the only > > element without 100% height and width was the generated "layout > > parent" element but after changing this in using the inspector it > > worked. > > > > So I think I need to be able to access the Layout.parentElem to modify > > its style. > > > > > -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
Actually I think that was a red herring - setting the parentElem style just forced a re-render and changing the map size had the same effect. I think the problem is due to the map trying to initialize itself before layout() is called. If I add a holder panel like this: SimplePanel holder = new SimplePanel(); p.add(holder); and then add the map after layout() like: p.layout(); MapWidget map = new MapWidget(LatLng.newInstance(50, 50), 8); map.setWidth("100%"); map.setHeight("100%"); holder.add(map); it works. I have one question about threading in the browser - I have used YUI LayoutManager which is very similar to DockLayoutPanel. http://developer.yahoo.com/yui/examples/layout/nested_layout.html If you want to nest layouts or use a map inside a layout you need to register a listener for an onrender event. When I asked why, Dave Glass said that although the JS is single threaded, the DOM elements will not be created by serially so you must wait until the event fires before you can safely layout nested items that depend on the parent layout. Could this be a problem here also? Thanks, John On Sep 28, 7:06 pm, jd wrote: > I have found the issue and am not sure how to fix it using the current > API. After setting 100% height and width on both the DockLayoutPanel > and RootLayoutPanel the map still reported a span of 0 and did not > render correctly. In Safari's Inspector I could see that the only > element without 100% height and width was the generated "layout > parent" element but after changing this in using the inspector it > worked. > > So I think I need to be able to access the Layout.parentElem to modify > its style. > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel and Maps
I have found the issue and am not sure how to fix it using the current API. After setting 100% height and width on both the DockLayoutPanel and RootLayoutPanel the map still reported a span of 0 and did not render correctly. In Safari's Inspector I could see that the only element without 100% height and width was the generated "layout parent" element but after changing this in using the inspector it worked. So I think I need to be able to access the Layout.parentElem to modify its style. On Sep 28, 5:43 pm, jd wrote: > Hi, > > I am trying to use the new DockLayoutPanel with a Google map in the > center panel which takes up what ever space remains. The map does not > render properly due to not being able to figure out its dimensions. I > have modified the sample below to demonstrate this by adding a map > with 100% height and width. > > public class DockLayoutPanelExample implements EntryPoint { > > public void onModuleLoad() { > // Attach five widgets to a DockLayoutPanel, one in each > direction. Lay > // them out in 'em' units. > > final MapWidget map = new MapWidget(LatLng.newInstance(50, 50), 8); > map.setWidth("100%"); > map.setHeight("100%"); > > map.addMapMoveEndHandler(new MapMoveEndHandler() > { > public void onMoveEnd(MapMoveEndEvent event) > { > Window.alert(map.getBounds().toString()); > } > }); > > DockLayoutPanel p = new DockLayoutPanel(Unit.EM); > p.addNorth(new HTML("north"), 2); > p.addSouth(new HTML("south"), 2); > p.addEast(new HTML("east"), 2); > p.addWest(new HTML("west"), 2); > p.add(map); > > // Note the explicit call to layout(). This is required for the > layout to > // take effect. > p.layout(); > > // Attach the LayoutPanel to the RootLayoutPanel. The latter will > listen for > // resize events on the window to ensure that its children are > informed of > // possible size changes. > RootLayoutPanel rp = RootLayoutPanel.get(); > rp.add(p); > > // The RootLayoutPanel also requires that its layout() method be > explicitly > // called for the initial layout to take effect. > rp.layout(); > } > > } > > I believe the map needs to be able to figure out its exact height and > width in pixels. > > Can anyone suggest an approach to get around this problem? > > Thanks, > > John --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
Great!! I've just started usin g GWT (jumping in at 2.0) and this sound perfect for our app. Thanks Joel. On Jul 27, 1:50 pm, Rob Heittman wrote: > Sounds perfect. Thanks, Joel! > > On Mon, Jul 27, 2009 at 8:07 AM, Joel Webber wrote: > > I completely understand your pain -- HTML layout is an absolute nightmare. > > I'm about to start the review thread for the core "Layout" class and > > supporting code (and post an initial design doc at the same time). It is a > > low-level class that works directly with elements, and is meant primarily to > > be used by higher-level widgets. It, along with the design doc, should give > > you an idea of how it all works, and if you like you can start using it > > directly. > > I plan on following up with individual widget reviews soon thereafter, and > > the Dock/Split widget will be among the first. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
Sounds perfect. Thanks, Joel! On Mon, Jul 27, 2009 at 8:07 AM, Joel Webber wrote: > I completely understand your pain -- HTML layout is an absolute nightmare. > I'm about to start the review thread for the core "Layout" class and > supporting code (and post an initial design doc at the same time). It is a > low-level class that works directly with elements, and is meant primarily to > be used by higher-level widgets. It, along with the design doc, should give > you an idea of how it all works, and if you like you can start using it > directly. > I plan on following up with individual widget reviews soon thereafter, and > the Dock/Split widget will be among the first. > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
I completely understand your pain -- HTML layout is an absolute nightmare. I'm about to start the review thread for the core "Layout" class and supporting code (and post an initial design doc at the same time). It is a low-level class that works directly with elements, and is meant primarily to be used by higher-level widgets. It, along with the design doc, should give you an idea of how it all works, and if you like you can start using it directly. I plan on following up with individual widget reviews soon thereafter, and the Dock/Split widget will be among the first. On Sun, Jul 26, 2009 at 5:20 PM, Rob Heittman wrote: > Hi Joel, > > A little cri de coeur ... whether as a branch, patchset, or note passed > under the desk, I would really love to have a look at your draft > DockLayoutPanel in the not too distant future. We've also had to reinvent > that wheel to meet some project time constraints, but I'd like to try to > converge with your approach so I can cut over to DockLayoutPanel someday > without too much fuss. > > Fortunately, my use case allows me to ignore IE, so my workload is not as > bad as yours :-) > > - R > > On Mon, Jun 29, 2009 at 8:21 AM, Joel Webber wrote: > >> That's fairly closely related to the approach I'm taking. It is worth >> noting, however, that this totally fails on IE6, because it won't handle the >> kinds of implicit constraints created by, e.g., { left:0; right:0; }. Just >> to make matters more difficult, it also can't handle { right:0; } >> properly (often off-by-one pixel). Part of the work I'm doing involves a lot >> of script hackery to account for this, without hamstringing the >> implementation on other browsers. > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group. To post to this group, send email to Google-Web-Toolkit-Contributors@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit-contributors+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit-Contributors?hl=en -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
Hi Joel, A little cri de coeur ... whether as a branch, patchset, or note passed under the desk, I would really love to have a look at your draft DockLayoutPanel in the not too distant future. We've also had to reinvent that wheel to meet some project time constraints, but I'd like to try to converge with your approach so I can cut over to DockLayoutPanel someday without too much fuss. Fortunately, my use case allows me to ignore IE, so my workload is not as bad as yours :-) - R On Mon, Jun 29, 2009 at 8:21 AM, Joel Webber wrote: > That's fairly closely related to the approach I'm taking. It is worth > noting, however, that this totally fails on IE6, because it won't handle the > kinds of implicit constraints created by, e.g., { left:0; right:0; }. Just > to make matters more difficult, it also can't handle { right:0; } > properly (often off-by-one pixel). Part of the work I'm doing involves a lot > of script hackery to account for this, without hamstringing the > implementation on other browsers. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
That's fairly closely related to the approach I'm taking. It is worth noting, however, that this totally fails on IE6, because it won't handle the kinds of implicit constraints created by, e.g., { left:0; right:0; }. Just to make matters more difficult, it also can't handle { right:0; } properly (often off-by-one pixel). Part of the work I'm doing involves a lot of script hackery to account for this, without hamstringing the implementation on other browsers. On Sat, Jun 27, 2009 at 6:56 AM, Cristiano wrote: > > I think it is reallay interesting: > I've been able to realize flexible and fluid layout before passing to > use GWT, by using CSS and a combination of properties "position: > absolute;" "top:xxx", "bottom;xxx", "width:xxx" etc. > and I liked this approach because it does not use tables! > > In gwt, I've tried to do the same by using AbsolutePanel but it was > not posible mainly because AbsolutePanel ony let you to set top and > left value, (and, if I remember correctly, only as integer value). > > I don't know if it could be of any help, but here I want to give you a > sample (in html) which I wrote while studing how to apply this kind of > CSS layouts in GWT (for sure it works on IE7, I don't know if it works > on IE6 but it was not important for me): > {{{ > > style="position:absolute;top:0;bottom:0;left:0;right:50%;"> > style="position:absolute;top:0;bottom:0;left:0;width:200px;"> > style="position:absolute;top:0;height:300px;left:0;right:0;">Left > Left Top > style="position:absolute;top:300px;bottom:0;left:0;right:0;">Left > Left Bottom > > style="position:absolute;top:0;bottom:0;left:200px;right:0;"> > style="position:absolute;top:0;height:200px;left:0;right:0;">Left > Right Top > > style="position:absolute;top:200px;bottom:0;left:0;right:0;"> > style="position:absolute;top:0;height:200px;left:0;right:0;"> > style="position:absolute;top:0;bottom:0;left:0;right:50%;">Left > Right Bottom Top Left > style="position:absolute;top:0;bottom:0;left:50%;right:0;">Left > Right Bottom Top Right > > style="position:absolute;top:200px;height:5px;left:0;right:0; cursor:s- > resize;"> > style="position:absolute;top:205px;bottom:0;left:0;right:0;">Left > Right Bottom Bottom > > > > > style="position:absolute;top:0;bottom:0;left:50%;right:0;"> > style="position:absolute;top:0;bottom:0;width:300px;right: > 0;">Right Left > style="position:absolute;top:0;bottom:0;left:0;right:300px;">Right > Right > > > }}} > > I would like to be able to reproduce such a layout in GWT. > > NB. Any news on UiBinder? > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
I think it is reallay interesting: I've been able to realize flexible and fluid layout before passing to use GWT, by using CSS and a combination of properties "position: absolute;" "top:xxx", "bottom;xxx", "width:xxx" etc. and I liked this approach because it does not use tables! In gwt, I've tried to do the same by using AbsolutePanel but it was not posible mainly because AbsolutePanel ony let you to set top and left value, (and, if I remember correctly, only as integer value). I don't know if it could be of any help, but here I want to give you a sample (in html) which I wrote while studing how to apply this kind of CSS layouts in GWT (for sure it works on IE7, I don't know if it works on IE6 but it was not important for me): {{{ Left Left Top Left Left Bottom Left Right Top Left Right Bottom Top Left Left Right Bottom Top Right Left Right Bottom Bottom Right Left Right Right }}} I would like to be able to reproduce such a layout in GWT. NB. Any news on UiBinder? --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
Right, the idea is to let the browser do 99% of the work, but walk the part of the widget hierarchy that "needs layout" whenever necessary (whenever any part of it changes size), to give those widgets that absolutely *must*, a chance to deal with the change. In the example you give, the map widget would almost definitely need this, and a few others would as well, but most won't, so it stays very fast most of the time. On Fri, Jun 26, 2009 at 6:33 AM, dflorey wrote: > > That sounds really great. I've spent many hours to get this done but > ended up with the WindowResizeListener approach. > Do you delegate the size to child panels in case of resize? I've had > trouble nesting stack panels and gwt-maps inside resizable panels (HSP/ > VSP). > > On Jun 15, 9:11 pm, Joel Webber wrote: > > Yes, and yes. I've got it working, though I'm still not 100% happy with > the > > API, as I mentioned earlier. Now I'm trying to actually back into a > design > > document :) > > As a small teaser, the basic approach is to take advantage of the simple > > constraint system (probably accidentally) created by CSS like this: > > > > .rule { > > position: absolute; > > left: 0; right: 0; > > top: 0; bottom: 0; > > > > } > > > > You can create various constraints by mixing pairs of values, like {left, > > right}, {left, width}, and {right, width}. You can also use any units you > > want, which is great for dealing with font-size changes and the like. > It's > > actually not too far from what you get from the mac's InterfaceBuilder. > > > > There's a bit more magic to make it deal properly with arbitrary margin, > > border, and padding, and IE6 support is really hard, but does finally > work. > > > > > > > > On Mon, Jun 15, 2009 at 3:02 PM, Ray Cromwell > wrote: > > > > > Joel, > > > Does this support arbitrary composition (dockpanels containing > > > dockpanels?) and does it work correctly with scrolling inside the > > > panels? > > > > > -Ray > > > > > On Mon, Jun 15, 2009 at 11:53 AM, Joel Webber wrote: > > > > I'm still not 100% done with the API design, and a few edge-cases, > but > > > will > > > > announce on the lists as soon as I have something ready for everyone > to > > > try > > > > out. It uses a similar approach to the code in > > > > Wave, but is rather more general, and supports IE6 (which Wave > doesn't). > > > > > > On Thu, Jun 11, 2009 at 5:41 PM, Bruce Johnson > wrote: > > > > > >> No, it's not checked in yet, but I think Joel might started a branch > to > > > >> land it before t long. > > > > > >> It isn't literally the same code as in Wave, but it's logically > > > >> equivalent. Joel can say a lot more about it than me. > > > > > >> On Thu, Jun 11, 2009 at 5:36 PM, dflorey > > > wrote: > > > > > >>> Is the DockLayoutPanel presented at Google IO already in svn? The > one > > > >>> that is being used by the wave client? > > > >>> I've not been able to find it... > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
That sounds really great. I've spent many hours to get this done but ended up with the WindowResizeListener approach. Do you delegate the size to child panels in case of resize? I've had trouble nesting stack panels and gwt-maps inside resizable panels (HSP/ VSP). On Jun 15, 9:11 pm, Joel Webber wrote: > Yes, and yes. I've got it working, though I'm still not 100% happy with the > API, as I mentioned earlier. Now I'm trying to actually back into a design > document :) > As a small teaser, the basic approach is to take advantage of the simple > constraint system (probably accidentally) created by CSS like this: > > .rule { > position: absolute; > left: 0; right: 0; > top: 0; bottom: 0; > > } > > You can create various constraints by mixing pairs of values, like {left, > right}, {left, width}, and {right, width}. You can also use any units you > want, which is great for dealing with font-size changes and the like. It's > actually not too far from what you get from the mac's InterfaceBuilder. > > There's a bit more magic to make it deal properly with arbitrary margin, > border, and padding, and IE6 support is really hard, but does finally work. > > > > On Mon, Jun 15, 2009 at 3:02 PM, Ray Cromwell wrote: > > > Joel, > > Does this support arbitrary composition (dockpanels containing > > dockpanels?) and does it work correctly with scrolling inside the > > panels? > > > -Ray > > > On Mon, Jun 15, 2009 at 11:53 AM, Joel Webber wrote: > > > I'm still not 100% done with the API design, and a few edge-cases, but > > will > > > announce on the lists as soon as I have something ready for everyone to > > try > > > out. It uses a similar approach to the code in > > > Wave, but is rather more general, and supports IE6 (which Wave doesn't). > > > > On Thu, Jun 11, 2009 at 5:41 PM, Bruce Johnson wrote: > > > >> No, it's not checked in yet, but I think Joel might started a branch to > > >> land it before t long. > > > >> It isn't literally the same code as in Wave, but it's logically > > >> equivalent. Joel can say a lot more about it than me. > > > >> On Thu, Jun 11, 2009 at 5:36 PM, dflorey > > wrote: > > > >>> Is the DockLayoutPanel presented at Google IO already in svn? The one > > >>> that is being used by the wave client? > > >>> I've not been able to find it... --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
Yes, and yes. I've got it working, though I'm still not 100% happy with the API, as I mentioned earlier. Now I'm trying to actually back into a design document :) As a small teaser, the basic approach is to take advantage of the simple constraint system (probably accidentally) created by CSS like this: .rule { position: absolute; left: 0; right: 0; top: 0; bottom: 0; } You can create various constraints by mixing pairs of values, like {left, right}, {left, width}, and {right, width}. You can also use any units you want, which is great for dealing with font-size changes and the like. It's actually not too far from what you get from the mac's InterfaceBuilder. There's a bit more magic to make it deal properly with arbitrary margin, border, and padding, and IE6 support is really hard, but does finally work. On Mon, Jun 15, 2009 at 3:02 PM, Ray Cromwell wrote: > > Joel, > Does this support arbitrary composition (dockpanels containing > dockpanels?) and does it work correctly with scrolling inside the > panels? > > -Ray > > On Mon, Jun 15, 2009 at 11:53 AM, Joel Webber wrote: > > I'm still not 100% done with the API design, and a few edge-cases, but > will > > announce on the lists as soon as I have something ready for everyone to > try > > out. It uses a similar approach to the code in > > Wave, but is rather more general, and supports IE6 (which Wave doesn't). > > > > On Thu, Jun 11, 2009 at 5:41 PM, Bruce Johnson wrote: > >> > >> No, it's not checked in yet, but I think Joel might started a branch to > >> land it before t long. > >> > >> It isn't literally the same code as in Wave, but it's logically > >> equivalent. Joel can say a lot more about it than me. > >> > >> On Thu, Jun 11, 2009 at 5:36 PM, dflorey > wrote: > >>> > >>> Is the DockLayoutPanel presented at Google IO already in svn? The one > >>> that is being used by the wave client? > >>> I've not been able to find it... > >>> > >> > >> > >> > > > > > > > > > > > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
Joel, Does this support arbitrary composition (dockpanels containing dockpanels?) and does it work correctly with scrolling inside the panels? -Ray On Mon, Jun 15, 2009 at 11:53 AM, Joel Webber wrote: > I'm still not 100% done with the API design, and a few edge-cases, but will > announce on the lists as soon as I have something ready for everyone to try > out. It uses a similar approach to the code in > Wave, but is rather more general, and supports IE6 (which Wave doesn't). > > On Thu, Jun 11, 2009 at 5:41 PM, Bruce Johnson wrote: >> >> No, it's not checked in yet, but I think Joel might started a branch to >> land it before t long. >> >> It isn't literally the same code as in Wave, but it's logically >> equivalent. Joel can say a lot more about it than me. >> >> On Thu, Jun 11, 2009 at 5:36 PM, dflorey wrote: >>> >>> Is the DockLayoutPanel presented at Google IO already in svn? The one >>> that is being used by the wave client? >>> I've not been able to find it... >>> >> >> >> > > > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
I'm still not 100% done with the API design, and a few edge-cases, but will announce on the lists as soon as I have something ready for everyone to try out. It uses a similar approach to the code in Wave, but is rather more general, and supports IE6 (which Wave doesn't). On Thu, Jun 11, 2009 at 5:41 PM, Bruce Johnson wrote: > No, it's not checked in yet, but I think Joel might started a branch to > land it before t long. > > It isn't literally the same code as in Wave, but it's logically equivalent. > Joel can say a lot more about it than me. > > > On Thu, Jun 11, 2009 at 5:36 PM, dflorey wrote: > >> >> Is the DockLayoutPanel presented at Google IO already in svn? The one >> that is being used by the wave client? >> I've not been able to find it... >> >> > > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: DockLayoutPanel
No, it's not checked in yet, but I think Joel might started a branch to land it before t long. It isn't literally the same code as in Wave, but it's logically equivalent. Joel can say a lot more about it than me. On Thu, Jun 11, 2009 at 5:36 PM, dflorey wrote: > > Is the DockLayoutPanel presented at Google IO already in svn? The one > that is being used by the wave client? > I've not been able to find it... > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---