Thanks Stefan, i have followed your suggestion but the problem is not
solved. Because I have the following exception:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException


This is my function in the  plug in:

  private void updateUIForAction(ActionEvent e) {

...

c.getLayerViewPanel
().getSelectionManager().getFeatureSelection().selectItems(layer,f,(Collection)layer.getFeatureCollectionWrapper());
try {
myZoom.execute(c);
} catch (Exception e) {}

where c is a reference to context (c = context;) and f is a Feature.

bye
Diego

On Jan 31, 2008 7:24 PM, Stefan Steiniger <[EMAIL PROTECTED]> wrote:

> Hei,
>
> you can use:
>
> private ZoomToSelectedItemsPlugIn myZoom = new
>                        ZoomToSelectedItemsPlugIn();
> myZoom.execute(context);
>
> (where context is the PluginContext given in the Plugin execute() method)
>
> but you need first to clean the current selection and add your object
> that you want to zoom to.
> such as:
> context.getLayerViewPanel
> ().getSelectionManager().getFeatureSelection().selectItems(actualLayer,
>
> features);
>
> with Collection features and Layer actualLayer
>
> hope that helps
> stefan
>
> Diego Tosato schrieb:
> > Hi, I'm working on a new plug in  for openJUMP v1.2 D on Eclipse 3.3.1.1
> > <http://3.3.1.1>. I' ve a problem: I want to zooming on a specific
> > feature. I've tried to use this function:
> >
> >     zoomToSelectedItemsPlugIn.zoom(
> >     FeatureUtil.toGeometries(features),
> >     taskFrame.getLayerViewPanel());
> >
> >
> > in a block try-catch but it doesn't work. In particular I've no
> > understood what is the object "taskFrame".
> > Maybe is it too simple draw a feature in a separated interface?
> > Can anyone give me an alternative solution?
> >
> > Diego
> >
> > --
> > ******************************************************************
> > Diego Tosato
> > Sito Personale: http://p0ll0.altervista.org/
> > ******************************************************************
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > jump-users mailing list
> > [email protected]
> > http://lists.refractions.net/mailman/listinfo/jump-users
>
> _______________________________________________
> jump-users mailing list
> [email protected]
> http://lists.refractions.net/mailman/listinfo/jump-users
>



-- 
******************************************************************
Diego Tosato
Sito Personale: http://p0ll0.altervista.org/
******************************************************************
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users

Reply via email to