|
From: Edwin C. <com...@gm...> - 2009-03-22 12:09:35
|
Hi Farrukh,
MapOptions extends OptionsBase, which intentionally hides the setAttribute
methods for non-children (see the Javadoc on OptionsBase). The idea behind
this is that XxxOptions objects should only have setters for options that
can actually be set on them. Also the setAttribute methods clutter the code
suggestions by the IDE for the available setters (another option to prevent
code suggestion clutter would be to have a IMapOptions interface with
limited setters and let that be extended by a MapOptions class that extends
Options).
If it makes sense to support setting the Z-Index I would argue that there
should be a public setZIndex method, but if others feel that it makes more
sense to expose the setAttribute methods than we should consider making all
classes that extend OptionsBase extend Options instead (as in GWT-OL 0.2).
Greetings,
Edwin
2009/3/21 Farrukh Najmi <fa...@we...>
>
> I could not use the mapOptions.setAttribute calls as they were protected
> not public.
> Is there a good reason for not making them public or is it just an
> oversight?
>
> Attached is a suggested patch to make the methods public. Please let me
> know if it makes sense to commit it.
> Thanks.
>
> Curtis Jensen wrote:
>
>> zIndexes are how CSS defines what div blocks appear on top of overlapping
>> div blocks. It's the normal concept of 3D space coordinates, where the z
>> axis is perpendicular to the screen. The highest zIndex will be on top.
>> I'm not expert either, this is the basics of what I know.
>>
>> It's isn't difficult to change the default zIndexes of OpenLayers (but is
>> was difficult for me figure it out). It is very likely that someone else
>> knows a better way. In my case, I was actually trying to make the map go
>> lower in the z ordering. You may want yours to go higher. I used FireBug
>> (Firefox plugin) to find the zIndex of the objects that were conflicting
>> with my map. It took me a little while to find where OpenLayers was setting
>> it's z indexes. They have a set of base indexes, and then build from there.
>> If you over write the defaults, you can modify the z ordering of OpenLayers
>> objects.
>>
>> This is the code I used:
>>
>> // OpenLayers default Z bases are 1000, 250, 750, 2000
>> private native JSObject getLowerMapZBase() /*-{
>> return { BaseLayer: -1000, Overlay: -750, Popup: -500, Control: 0 };
>> }-*/;
>>
>> MapOptions mapOptions = new MapOptions();
>> mapOptions.setAttribute("Z_INDEX_BASE", getLowerMapZBase());
>>
>>
>>
>>
>
> --
> Regards,
> Farrukh
>
> Web: http://www.wellfleetsoftware.com
>
>
>
> Index: src/main/java/com/eg/gwt/openLayers/client/util/OptionsBase.java
> ===================================================================
> RCS file:
> /cvsroot/gwt-openlayers/gwt-openlayers/src/main/java/com/eg/gwt/openLayers/client/util/OptionsBase.java,v
> retrieving revision 1.1
> diff -u -r1.1 OptionsBase.java
> --- src/main/java/com/eg/gwt/openLayers/client/util/OptionsBase.java 27
> Feb 2009 08:33:08 -0000 1.1
> +++ src/main/java/com/eg/gwt/openLayers/client/util/OptionsBase.java 21
> Mar 2009 19:36:53 -0000
> @@ -43,83 +43,83 @@
> //super((JSObject) JSObject.createObject()); //should work
> }
>
> - protected void setAttribute(String attr, boolean value)
> + public void setAttribute(String attr, boolean value)
> {
> ElementHelper.setAttribute(getJSObject(), attr, value);
> }
>
> - protected void setAttribute(String attr, int value)
> + public void setAttribute(String attr, int value)
> {
> ElementHelper.setAttribute(getJSObject(), attr, value);
> }
>
> - protected void setAttribute(String attr, int[] value)
> + public void setAttribute(String attr, int[] value)
> {
> setAttribute(attr, new JIntArray(value).getJSObject());
> }
>
> - protected void setAttribute(String attr, double value)
> + public void setAttribute(String attr, double value)
> {
> ElementHelper.setAttribute(getJSObject(), attr, value);
> }
>
> - protected void setAttribute(String attr, String value)
> + public void setAttribute(String attr, String value)
> {
> ElementHelper.setAttribute(getJSObject(), attr, value);
> }
>
> - protected void setAttribute(String attr, Element value)
> + public void setAttribute(String attr, Element value)
> {
> ElementHelper.setAttribute(getJSObject(), attr, value);
> }
>
> - protected void setAttribute(String attr, JSObject value)
> + public void setAttribute(String attr, JSObject value)
> {
> ElementHelper.setAttribute(getJSObject(), attr, value);
> }
>
> - protected void setAttribute(String attr, JObjectArray value)
> + public void setAttribute(String attr, JObjectArray value)
> {
> ElementHelper.setAttribute(getJSObject(), attr,
> value.getJSObject());
> }
>
> - protected String getAttribute(String attr)
> + public String getAttribute(String attr)
> {
> return ElementHelper.getAttribute(getJSObject(), attr);
> }
>
> - protected boolean getAttributeAsBoolean(String attr)
> + public boolean getAttributeAsBoolean(String attr)
> {
> return ElementHelper.getAttributeAsBoolean(getJSObject(),
> attr);
> }
>
> - protected double getAttributeAsDouble(String attr)
> + public double getAttributeAsDouble(String attr)
> {
> return ElementHelper.getAttributeAsDouble(getJSObject(),
> attr);
> }
>
> - protected Element getAttributeAsElement(String attr)
> + public Element getAttributeAsElement(String attr)
> {
> return ElementHelper.getAttributeAsElement(getJSObject(),
> attr);
> }
>
> - protected JSObject getAttributeAsJSObject(String attr)
> + public JSObject getAttributeAsJSObject(String attr)
> {
> return ElementHelper.getAttributeAsJSObject(getJSObject(),
> attr);
> }
>
> - protected int getAttributeAsInt(String attr)
> + public int getAttributeAsInt(String attr)
> {
> return ElementHelper.getAttributeAsInt(getJSObject(), attr);
> }
>
> //TODO Perhaps move these back to helper methods
> - protected int[] getAttributeAsIntArray(String attr)
> + public int[] getAttributeAsIntArray(String attr)
> {
> return
> JIntArray.narrowToJIntArray(getAttributeAsJSObject(attr)).toArray();
> }
>
> - protected String[] getAttributes()
> + public String[] getAttributes()
> {
> JSObject attributes =
> ElementHelper.getAttributes(getJSObject());
>
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Gwt-openlayers-devl mailing list
> Gwt...@li...
> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-devl
>
>
|