[udig-devel] Modal tool deactivation
Damjan Šavko
damjan.savd at gmail.com
Thu Jul 20 05:48:38 PDT 2006
I think I'm missing what you are trying to tell me. As I see the
ViewPortModel does not have any methods to access the buttons on the
toolbar.
What I want to do is programatically disable a modal tool (turn it off). I
tried with
ApplicationGIS.getToolManager().getTool( toolID,
categoryID).setEnabled(false)
but that only works with ActionTools and not with modals.
I'm searching for something like:
...getModalActionsToolbar.setSelected(0) or
getModalActionsToolbar.undoSelection() (select the previous selected modal
tool)
Damjan
On 7/20/06, Jody Garnett <jgarnett at refractions.net> wrote:
>
> Damjan Šavko wrote:
> > Hello, I'm making a modal tool to select certain features on the map.
> > But certain types of data must be in the current map to use this tool.
> > So I check if the conditions are valid using the function
> > setActive(active) (which is run where the button is pressed) and that
> > works fine. But if the conditions aren't true I would like to
> > deactivate the button programatically so that the user wouldn't have
> > to deactivate the button manually. Is there a way I could do that?
> You could grab the bounds from the viewport model and do a query to see
> if your "data" was in view ... but please do so on a thread is invoked
> in response to viewport events - and updates the button's state with a
> runable in the display thread.
>
> Cheers,
> Jody
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/udig-devel/attachments/20060720/5bd779df/attachment.html
More information about the udig-devel
mailing list