open a view in scripting

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

open a view in scripting

Andrea Antonello
Hi, I am trying to find a way to create and open a view in a script,
something like:

  newview = currentProject().createView("Example view")
  newview.setProjection(getCRS(epsg))
  newview.addLayer(background)
  newview.addLayer(shape)
  currentProject().openView(newview)

But the project has not openView method and also the view has no open method.
I looked at the java classes, but could not find the right method.

Thanks,
Andrea

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: open a view in scripting

Andrea Antonello
PS: the java way is:

            IView viewWindow = (IView) viewManager.getMainWindow(view);
            applicationManager.getUIManager().addWindow(viewWindow,
GridBagConstraints.CENTER);

but is there a more friendly scripting way?




On Sat, Nov 12, 2016 at 12:28 PM, andrea antonello
<[hidden email]> wrote:

> Hi, I am trying to find a way to create and open a view in a script,
> something like:
>
>   newview = currentProject().createView("Example view")
>   newview.setProjection(getCRS(epsg))
>   newview.addLayer(background)
>   newview.addLayer(shape)
>   currentProject().openView(newview)
>
> But the project has not openView method and also the view has no open method.
> I looked at the java classes, but could not find the right method.
>
> Thanks,
> Andrea

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: open a view in scripting

Óscar Martínez

If you want to open it we created:

    view = gvsig.currentProject().createView("new view")
    view.showWindow(False) #or view.showWindow(), by default is False

where False is with a small window, and True if you want it maximize.

i see there is a method addWindow(IWindow p, int align) , but we use just addWindow(IWindow p)..

I will add for the new version of gvsig the option to create it with align, something like:

view.showWindow(maximize=False, align=value)

Best regards,
Óscar

El 12/11/16 a las 12:37, andrea antonello escribió:
PS: the java way is:

            IView viewWindow = (IView) viewManager.getMainWindow(view);
            applicationManager.getUIManager().addWindow(viewWindow,
GridBagConstraints.CENTER);

but is there a more friendly scripting way?




On Sat, Nov 12, 2016 at 12:28 PM, andrea antonello
[hidden email] wrote:
Hi, I am trying to find a way to create and open a view in a script,
something like:

  newview = currentProject().createView("Example view")
  newview.setProjection(getCRS(epsg))
  newview.addLayer(background)
  newview.addLayer(shape)
  currentProject().openView(newview)

But the project has not openView method and also the view has no open method.
I looked at the java classes, but could not find the right method.

Thanks,
Andrea
_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel


_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: open a view in scripting

Andrea Antonello
Hi Oscar,
works great, thanks!

On Sat, Nov 12, 2016 at 2:31 PM, Óscar Martínez <[hidden email]> wrote:

> If you want to open it we created:
>
>     view = gvsig.currentProject().createView("new view")
>     view.showWindow(False) #or view.showWindow(), by default is False
>
> where False is with a small window, and True if you want it maximize.
>
> i see there is a method addWindow(IWindow p, int align) , but we use just
> addWindow(IWindow p)..
>
> I will add for the new version of gvsig the option to create it with align,
> something like:
>
> view.showWindow(maximize=False, align=value)
>
> Best regards,
> Óscar
>
> El 12/11/16 a las 12:37, andrea antonello escribió:
>
> PS: the java way is:
>
>             IView viewWindow = (IView) viewManager.getMainWindow(view);
>             applicationManager.getUIManager().addWindow(viewWindow,
> GridBagConstraints.CENTER);
>
> but is there a more friendly scripting way?
>
>
>
>
> On Sat, Nov 12, 2016 at 12:28 PM, andrea antonello
> <[hidden email]> wrote:
>
> Hi, I am trying to find a way to create and open a view in a script,
> something like:
>
>   newview = currentProject().createView("Example view")
>   newview.setProjection(getCRS(epsg))
>   newview.addLayer(background)
>   newview.addLayer(shape)
>   currentProject().openView(newview)
>
> But the project has not openView method and also the view has no open
> method.
> I looked at the java classes, but could not find the right method.
>
> Thanks,
> Andrea
>
> _______________________________________________
> gvSIG-desktop-devel mailing list
> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>
>
>
> _______________________________________________
> gvSIG-desktop-devel mailing list
> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel