Good morning, thanks for the help that you have given to me. Now it works all correctly. I have two questions:
- How I can load my button in the toolbar to the start without add it like extension from the menù? I must modify the file workbench-properties.xml? - Is possible load a level and not to allow the elimination of these to the user? Like always thanks for the help Giovanni -----Messaggio originale----- Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Per conto di [EMAIL PROTECTED] Inviato: martedì 29 aprile 2008 8.16 A: [email protected] Oggetto: Resumen de Kosmo, Vol 24, Envío 38 Envie los mensajes para la lista Kosmo a [email protected] Para subscribirse o anular su subscripción a través de WEB http://lists.saig.es/mailman/listinfo/kosmo O por correo electrónico, enviando un mensaje con el texto "help" en el asunto (subject) o en el cuerpo a: [EMAIL PROTECTED] Puede contactar con el responsable de la lista escribiendo a: [EMAIL PROTECTED] Si responde a algún contenido de este mensaje, por favor, edite la linea del asunto (subject) para que el texto sea mas especifico que: "Re: Contents of Kosmo digest...". Ademas, por favor, incluya en la respuesta solo aquellas partes del mensaje a las que esta respondiendo. Asuntos del día: 1. Re: Error (Sergio Baños Calvo) 2. R: Resumen de Kosmo, Vol 24, Envío 37 (Giovanni Virdis) 3. Re: R: Resumen de Kosmo, Vol 24, Envío 37 (Extending the drawPolygon tool) (Sergio Baños Calvo) 4. Re: Kosmos y GPS Garmin (Francisco) 5. Re: sobre creacion de extensiones (Francisco) ---------------------------------------------------------------------- Message: 1 Date: Mon, 28 Apr 2008 12:03:43 +0200 From: Sergio Baños Calvo <[EMAIL PROTECTED]> Subject: Re: [Kosmo] Error To: Lista de Kosmo <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Good morning again, Giovanni. Look at the previous mail that I've send to you and change your code. Anyway, the error that you're taking it's caused because with the newInstance() method it's calling a parameterless constructor, and your class doesn't have any. Regards, Giovanni Virdis escribió: > > The error comes generated in the class PlugInManager in the method > > > > * private * * void * loadPlugInClasses( List plugInClasses ) * throws > * Exception { > > * for * ( Iterator i = plugInClasses.iterator(); i.hasNext(); ) { > > Class plugInClass = (Class) i.next(); > > PlugIn plugIn = (PlugIn) plugInClass.newInstance(); > > plugIn.initialize( * new * PlugInContext( context , * null > * , * null * , * null * , * null * )); > > } > > } > > > > The line that generates the error is that one evidenced > > > > My class > > > > * public * * class * DisegnaPoligonoPlugIn * extends * DrawPolygonTool > * implements * PlugIn > > > > * public * * class * DisegnaPoligonoExtension * extends * Extension > > > > Perhaps I would have to manage the button in an other way? > > > > > > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Kosmo mailing list > [email protected] > http://lists.saig.es/mailman/listinfo/kosmo > -- Sergio Baños Calvo Jefe de desarrollos Sistemas Abiertos de Información Geográfica, S.L. (SAIG S.L.) Tlfno. móvil: 685005960 Tlfno. fijo: (+34) 954788876 E-mail: [EMAIL PROTECTED] ------------------------------ Message: 2 Date: Mon, 28 Apr 2008 12:36:01 +0200 From: "Giovanni Virdis" <[EMAIL PROTECTED]> Subject: [Kosmo] R: Resumen de Kosmo, Vol 24, Envío 37 To: <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" I have created the following class: public class DisegnaPoligono extends DrawPolygonTool { /** Nome Plugin */ public final static String NAME = "Nuovo Poligono"; /** Icona Plugin */ public final static Icon ICON = IconLoader.icon("DrawPolygon.gif"); public String getName() { return NAME; } public Icon getIcon() { return ICON; } protected DisegnaPoligono(FeatureDrawingUtil featureDrawingUtil) { super(featureDrawingUtil); } public static CursorTool create( LayerNamePanelProxy layerNamePanelProxy ) { FeatureDrawingUtil featureDrawingUtil = new FeatureDrawingUtil(layerNamePanelProxy); return featureDrawingUtil.prepare(new DisegnaPoligono(featureDrawingUtil), true); } protected void gestureFinished() throws Exception { reportNothingToUndoYet(); String message =createEnableCheck(getWorkbench().getContext(),this).check(null); if(message != null) { getWorkbench().getFrame().warnUser(message); return; } if (!checkPolygon()) { return; } // Here an add edit transaction is created, you can get the drawed polygon with the method getPolygon() featureDrawingUtil.drawRing(getPolygon(),isRollingBackInvalidEdits(), this, getPanel()); // If you want to open a custom dialog or something else, change the previous line and open your dialog // After that, if the dialog has finished correctly, add your feature to the editable layer. } } where I put the code lines that you have sended me " DelegatingTool delPolygonTool = (DelegatingTool) MyCursorTool.create(toolbox.getContext()); drawPolygonTool = (MyCursorTool) delPolygonTool.getDelegate(); context.getWorkbenchFrame().getToolBar().addCursorTool(drawPolygonTool.getName(), delPolygonTool, MyCursorTool.createEnableCheck(context.getWorkbenchContext(),drawPolygonTool));" to associate the button to the toolbar Message: 3 Date: Mon, 28 Apr 2008 11:54:18 +0200 From: Sergio Baños Calvo <[EMAIL PROTECTED]> Subject: Re: [Kosmo] R: Resumen de Kosmo, Vol 24, Envío 31 (Extending the drawPolygon tool) To: Lista de Kosmo <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Good morning Giovanni. I think there is a concept that should be clarified: PlugIns -> Menu items and toolbar buttons that executes an action Tools -> Activates a cursor with an associated funcionality In the example that you sent the two concepts are mixed in one. The functionality that you're trying to develop uses a cursor to draw the polygon, so a tool should be used. You should change your code and redefine only the methods getName() and getIcon() (to use the ones that you have indicated) and the gestureFinished() and create() methods: public static CursorTool create( LayerNamePanelProxy layerNamePanelProxy ) { FeatureDrawingUtil featureDrawingUtil = new FeatureDrawingUtil(layerNamePanelProxy); return featureDrawingUtil.prepare(new MyCursorTool(featureDrawingUtil), true); } protected void gestureFinished() throws Exception { reportNothingToUndoYet(); String message = createEnableCheck(getWorkbench().getContext(),this).check(null); if(message != null) { getWorkbench().getFrame().warnUser(message); return; } if (!checkPolygon()) { return; } // Here an add edit transaction is created, you can get the drawed polygon with the method getPolygon() featureDrawingUtil.drawRing(getPolygon(), isRollingBackInvalidEdits(), this, getPanel()); // If you want to open a custom dialog or something else, change the previous line and open your dialog // After that, if the dialog has finished correctly, add your feature to the editable layer. } Your class must only extend the DrawPolygonTool class and must no implement PlugIn. In order to add the tool to the main toolbar, use this: DelegatingTool delPolygonTool = (DelegatingTool) MyCursorTool.create(toolbox.getContext()); drawPolygonTool = (MyCursorTool) delPolygonTool.getDelegate(); context.getWorkbenchFrame().getToolBar().addCursorTool(drawPolygonTool.getName(), delPolygonTool, MyCursorTool.createEnableCheck(context.getWorkbenchContext(),drawPolygonTool)); Hope this helps. Regards, ------------------------------ Message: 3 Date: Mon, 28 Apr 2008 12:41:39 +0200 From: Sergio Baños Calvo <[EMAIL PROTECTED]> Subject: Re: [Kosmo] R: Resumen de Kosmo, Vol 24, Envío 37 (Extending the drawPolygon tool) To: Lista de Kosmo <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Good morning again, Giovanni. You should add them to the DisegnaPoligonoExtension install method: public void install( PlugInContext context ) throws Exception { DelegatingTool delPolygonTool = (DelegatingTool) MyCursorTool.create(context.getWorkbenchContext()); drawPolygonTool = (MyCursorTool) delPolygonTool.getDelegate(); context.getWorkbenchFrame().getToolBar().addCursorTool(drawPolygonTool.getName(), delPolygonTool, MyCursorTool.createEnableCheck(context.getWorkbenchContext(),drawPolygonTool)); } Regards, Giovanni Virdis escribió: > I have created the following class: > > public class DisegnaPoligono extends DrawPolygonTool { > > /** Nome Plugin */ > public final static String NAME = "Nuovo Poligono"; > > /** Icona Plugin */ > public final static Icon ICON = IconLoader.icon("DrawPolygon.gif"); > > public String getName() { > return NAME; > } > > public Icon getIcon() { > return ICON; > } > > protected DisegnaPoligono(FeatureDrawingUtil featureDrawingUtil) > { > super(featureDrawingUtil); > } > > public static CursorTool create( LayerNamePanelProxy > layerNamePanelProxy ) > { > FeatureDrawingUtil featureDrawingUtil = new > FeatureDrawingUtil(layerNamePanelProxy); > return featureDrawingUtil.prepare(new > DisegnaPoligono(featureDrawingUtil), true); > } > > protected void gestureFinished() throws Exception > { > reportNothingToUndoYet(); > > String message > =createEnableCheck(getWorkbench().getContext(),this).check(null); > > if(message != null) > { > getWorkbench().getFrame().warnUser(message); > return; > } > > if (!checkPolygon()) { > return; > } > > // Here an add edit transaction is created, you can get the drawed > polygon with the method getPolygon() > featureDrawingUtil.drawRing(getPolygon(),isRollingBackInvalidEdits(), > this, getPanel()); > > // If you want to open a custom dialog or something else, change the > previous line and open your dialog > // After that, if the dialog has finished correctly, add your feature > to the editable layer. > } > > > } > > where I put the code lines that you have sended me > > " DelegatingTool delPolygonTool = (DelegatingTool) > MyCursorTool.create(toolbox.getContext()); > drawPolygonTool = (MyCursorTool) delPolygonTool.getDelegate(); > context.getWorkbenchFrame().getToolBar().addCursorTool(drawPolygonTool.getName(), > > delPolygonTool, > > MyCursorTool.createEnableCheck(context.getWorkbenchContext(),drawPolygonTool));" > > to associate the button to the toolbar > > > > > Message: 3 > Date: Mon, 28 Apr 2008 11:54:18 +0200 > From: Sergio Baños Calvo <[EMAIL PROTECTED]> > Subject: Re: [Kosmo] R: Resumen de Kosmo, Vol 24, Envío 31 (Extending > the drawPolygon tool) > To: Lista de Kosmo <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Good morning Giovanni. > > I think there is a concept that should be clarified: > > PlugIns -> Menu items and toolbar buttons that executes an action > Tools -> Activates a cursor with an associated funcionality > > In the example that you sent the two concepts are mixed in one. The > functionality that you're trying to develop uses a cursor to draw the > polygon, so a tool should be used. You should change your code and > redefine only the methods getName() and getIcon() (to use the ones that > you have indicated) and the gestureFinished() and create() methods: > > public static CursorTool create( LayerNamePanelProxy > layerNamePanelProxy ) { > FeatureDrawingUtil featureDrawingUtil = new > FeatureDrawingUtil(layerNamePanelProxy); > > return featureDrawingUtil.prepare(new > MyCursorTool(featureDrawingUtil), true); > } > > protected void gestureFinished() throws Exception { > reportNothingToUndoYet(); > > String message = > createEnableCheck(getWorkbench().getContext(),this).check(null); > > if(message != null) > { > getWorkbench().getFrame().warnUser(message); > return; > } > > if (!checkPolygon()) { > return; > } > > // Here an add edit transaction is created, you can get the > drawed polygon with the method getPolygon() > featureDrawingUtil.drawRing(getPolygon(), > isRollingBackInvalidEdits(), this, getPanel()); > > // If you want to open a custom dialog or something else, change > the previous line and open your dialog > // After that, if the dialog has finished correctly, add your > feature to the editable layer. > } > > Your class must only extend the DrawPolygonTool class and must no > implement PlugIn. > > In order to add the tool to the main toolbar, use this: > > DelegatingTool delPolygonTool = (DelegatingTool) > MyCursorTool.create(toolbox.getContext()); > drawPolygonTool = (MyCursorTool) delPolygonTool.getDelegate(); > context.getWorkbenchFrame().getToolBar().addCursorTool(drawPolygonTool.getName(), > > delPolygonTool, > > MyCursorTool.createEnableCheck(context.getWorkbenchContext(),drawPolygonTool)); > > Hope this helps. > > Regards, > > _______________________________________________ > Kosmo mailing list > [email protected] > http://lists.saig.es/mailman/listinfo/kosmo > > -- Sergio Baños Calvo Jefe de desarrollos Sistemas Abiertos de Información Geográfica, S.L. (SAIG S.L.) Tlfno. móvil: 685005960 Tlfno. fijo: (+34) 954788876 E-mail: [EMAIL PROTECTED] ------------------------------ Message: 4 Date: Mon, 28 Apr 2008 14:49:37 -0500 From: "Francisco" <[EMAIL PROTECTED]> Subject: Re: [Kosmo] Kosmos y GPS Garmin To: "Lista de Kosmo" <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response muchas gracias Sergio, voy a revisar saludos Francisco ----- Original Message ----- From: "Sergio Baños Calvo" <[EMAIL PROTECTED]> To: "Lista de Kosmo" <[email protected]> Sent: Monday, April 28, 2008 4:14 AM Subject: Re: [Kosmo] Kosmos y GPS Garmin > Buenos días Francisco. > > Actualmente no existe ninguna extensión de Kosmo para bajar/subir > información a/desde un GPS. No está previsto actualmente incorporar alguna > extensión al respecto para la próxima versión, pero tomamos nota para ver > si podemos incluir algo al respecto. > > Si se anima a desarrollar, le indico unos cuantos enlaces que le pueden > ayudar en el desarrollo de dicha extensión: > > http://sourceforge.net/projects/jgps > http://www.openjump.org/wiki/show/Loading+GPS+data > http://www.tegmento.org/gpsylon/ > http://jgps.uf-soft.de/en/index.htm > > Un cordial saludo, > > Francisco escribió: >> Hola, es posible crear o existe alguna extension de kosmo para bajar o >> subir informacion al GPS Garmin >> saludos Salas >> >> ___________________________________ >> Este mensaje esta libre de virus. >> Revisado por Kaspersky Antivirus >> Engine version: 4.0.1.14 Engine date: 2002/06/25 Definition count: 647578 >> Definition date: 2008/04/24 MDAV version: 2.2.9 >> Dpto de Sistemas Informáticos >> Oficina Central Grupo Empresarial GEOCUBA >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Kosmo mailing list >> [email protected] >> http://lists.saig.es/mailman/listinfo/kosmo >> > > -- > > Sergio Baños Calvo > > Jefe de desarrollos > Sistemas Abiertos de Información Geográfica, S.L. (SAIG S.L.) > Tlfno. móvil: 685005960 > Tlfno. fijo: (+34) 954788876 > > E-mail: [EMAIL PROTECTED] > > _______________________________________________ > Kosmo mailing list > [email protected] > http://lists.saig.es/mailman/listinfo/kosmo > ___________________________________ Este mensaje esta libre de virus. Revisado por Kaspersky Antivirus Engine version: 4.0.1.14 Engine date: 2002/06/25 Definition count: 650174 Definition date: 2008/04/27 MDAV version: 2.2.9 Dpto de Sistemas Informáticos Oficina Central Grupo Empresarial GEOCUBA ------------------------------ Message: 5 Date: Mon, 28 Apr 2008 15:08:57 -0500 From: "Francisco" <[EMAIL PROTECTED]> Subject: Re: [Kosmo] sobre creacion de extensiones To: "Lista de Kosmo" <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Sergio, Copie la carpeta crs de saig-core para mi extension helloWorldExtension y sigo las instrucciones del manual pero cuando llego a la página 13 en Imagen 11: Nueva Clase Java- Crear Clase HelloWorldExtension no se visualizan las superclass cuando doy browse, te adjunto la imagen. Parece que tengo algo mal configurado pero no me doy cuenta. Pudieras indicarme cual es la solucion? saludos Francisco Salas ----- Original Message ----- From: "Sergio Baños Calvo" <[EMAIL PROTECTED]> To: "Lista de Kosmo" <[email protected]> Sent: Monday, April 28, 2008 4:30 AM Subject: Re: [Kosmo] sobre creacion de extensiones > Buenos días Francisco. > > En el proyecto saig-core debe tener una distribución parecida a la > siguiente: > > - saig-core > ------ bin > ------ crs > ------ logs > ------ repository > ------ src > ------ symbol > ------ template > ------ xml > > En esa línea se refiere a copiar el directorio "crs" (y todo su contenido) > al directorio del proyecto de la extensión, quedando dicho directorio como > sigue: > > - helloWorldExtension > ------ bin > ------ crs > ------ logs > ------ src > > > El número de errores que me indica probablemente sea debido a que no tiene > configurado como base del proyecto "helloWorldExtension" al proyecto > "saig-core", tal y como se indica en las páginas 8 y 9 del manual de > generación de extensiones en Kosmo. Compruebe que en la pestaña "Projects" > que se muestra en las imágenes esté correctamente configurado dicho > proyecto. > > Un cordial saludo, > > Francisco escribió: >> cuando en la página 10 del manual de extesiones el punto 6 plantea * Por >> último, debemos copiar el directorio / crs / * * desde el proyecto / >> saig-core / * *al nuevo proyecto.* >> * * significa que es copiar scr del saig-core y pegarlo en el proyecto >> helloWorldextesion, simplemente dando clic derecho copiar y sobre el >> proyecto clic >> derecho pegar? >> Si ese es el procedimiento porque me sale este error? son alrededor de >> 100 errores... >> Severity and Description Path Resource Location Creation Time Id >> a cannot be resolved helloWorldExtension/src/com/vividsolutions/jump/warp >> AffineTransform.java line 132 1209157413593 22809 >> saludos Francisco Salas >> >> ___________________________________ >> Este mensaje esta libre de virus. >> Revisado por Kaspersky Antivirus >> Engine version: 4.0.1.14 Engine date: 2002/06/25 Definition count: 648305 >> Definition date: 2008/04/25 MDAV version: 2.2.9 >> Dpto de Sistemas Informáticos >> Oficina Central Grupo Empresarial GEOCUBA >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Kosmo mailing list >> [email protected] >> http://lists.saig.es/mailman/listinfo/kosmo >> > > -- > > Sergio Baños Calvo > > Jefe de desarrollos > Sistemas Abiertos de Información Geográfica, S.L. (SAIG S.L.) > Tlfno. móvil: 685005960 > Tlfno. fijo: (+34) 954788876 > > E-mail: [EMAIL PROTECTED] > > _______________________________________________ > Kosmo mailing list > [email protected] > http://lists.saig.es/mailman/listinfo/kosmo > ___________________________________ Este mensaje esta libre de virus. Revisado por Kaspersky Antivirus Engine version: 4.0.1.14 Engine date: 2002/06/25 Definition count: 650174 Definition date: 2008/04/27 MDAV version: 2.2.9 Dpto de Sistemas Informáticos Oficina Central Grupo Empresarial GEOCUBA ------------ próxima parte ------------ Se ha borrado un mensaje que no está en formato texto plano... Nombre : helloworldextension.jpg Tipo : image/jpeg Tamaño : 48409 bytes Descripción: no disponible Url : http://lists.saig.es/pipermail/kosmo/attachments/20080428/cdd30c00/helloworldextension.jpg ------------------------------ _______________________________________________ Kosmo mailing list [email protected] http://lists.saig.es/mailman/listinfo/kosmo Fin de Resumen de Kosmo, Vol 24, Envío 38 ***************************************** _______________________________________________ Kosmo mailing list [email protected] http://lists.saig.es/mailman/listinfo/kosmo
