Hi Diego,
Sounds like something is corrupt or you haven't initialized your
plugin properly. We can give more specific hints if you post more
code and include the entire exception trace.
regards,
Larry Becker
On Feb 4, 2008 7:28 AM, Diego Tosato <[EMAIL PROTECTED]> wrote:
> Ok, I've already looked into these ones but the solution is hard to find
> out. I've isolated the problem on the object: SelectionManager. It is always
> "null". In particular the command
>
> context.getLayerViewPanel().getSelectionManager()
>
> returns null every time (exception).
> I'm working on a solution but I don't know how to use a SelectionManager.
>
> Diego
>
>
>
>
>
> On Feb 1, 2008 3:01 PM, Stefan Steiniger <[EMAIL PROTECTED]> wrote:
> > mhm.. don't know what to do (i have no idea about graphic stuff and
> > threading).
> > but what you could do is to look into the code of one of these plugins
> > (especially the last one):
> >
> > com.vividsolutions.jump.workbench.ui.zoom.ZoomBarPlugIn
> > com.vividsolutions.jump.workbench.ui.zoom.ZoomNextPlugIn
> > com.vividsolutions.jump.workbench.ui.zoom.ZoomPreviousPlugIn
> > com.vividsolutions.jump.workbench.ui.zoom.ZoomToClickPlugIn
> > com.vividsolutions.jump.workbench.ui.zoom.ZoomToCoordinatePlugIn
> > com.vividsolutions.jump.workbench.ui.zoom.ZoomToFencePlugIn
> > com.vividsolutions.jump.workbench.ui.zoom.ZoomToFullExtentPlugIn
> > com.vividsolutions.jump.workbench.ui.zoom.ZoomToLayerPlugIn
> >
> > stefan
> >
> > Diego Tosato schrieb:
> >
> > > 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]
> >
> >
> >
> > > <mailto:[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>
> > > > <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]
> > > <mailto:[email protected]>
> >
> > > > http://lists.refractions.net/mailman/listinfo/jump-users
> > >
> > > _______________________________________________
> > > jump-users mailing list
> > > [email protected]
> > > <mailto:[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
> > _______________________________________________
> > 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
>
>
--
http://amusingprogrammer.blogspot.com/
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users