Re: [JPP-Devel] CAD plugin. Add new library (as depency)

2020-06-04 Thread edgar . soldin
On 04.06.2020 10:19, Giuseppe Aruta wrote:
> Indeed I was planning this way: from user's point of view there is no 
> difference.

yup. exactly my point.

> On the other hand, I was thinking about developers who have a project in 
> their eclipse connected to svn (or not) and have a warning that a library is 
> missing whenever they want to compile (right now, a very rare situation)

this would be solved via reflection meaning instantiating classes from a string 
name and running methods derived from string names as well e.g. like

https://stackoverflow.com/questions/3574065/instantiate-a-class-object-with-constructor-that-accepts-a-string-parameter
https://stackoverflow.com/questions/1782598/with-java-reflection-how-to-instantiate-a-new-object-then-call-a-method-on-it

so in your case (just written, down not compiled) roughly

Class cl = Class.forName("com.cadplan.jump.utils.LoadSymbolFiles");
// find constructor with the context argument
Constructor cons = cl.getConstructor(WorkbenchContext.class);
// this is your instance
Object o = cons.newInstance(context);
// find & run the method
Method method = cl.getDeclaredMethod("start");
method.invoke(o);

this way the classes accessed do not have to be present during compile but only 
during runtime. this may throw a lot of exceptions, so make sure to catch them 
properly, easiest with one catches all.

> I can add a readme text file on SVN>CAD plugin>dist folder explaining that 
> VertexSymbol.jar library is required to compile

better put a howto_compile.txt or such in the src folder ;) where devs will 
stumble over it.

> Best regards
> Peppe

ditto.. sunny regards from rainy germany, ede

>
>
> Il giorno mer 3 giu 2020 alle ore 22:20  > ha scritto:
>
> On 03.06.2020 17:32, Giuseppe Aruta wrote:
> > Hi all,
> > I want to add VertexSymbolsXXX.jar as depency to CAD plugin.
> > This is the reason:
> > Currently, whenever the user saves a new block (CAD toolbar>Block>Save
> > geometry as block) as file, this can be used also as a point/line symbol
> > for styling. But, to do that, the user needs to close/restart again OJ.
> > Adding this dependency and using a few lines of code, a new block will 
> be
> > automatically available as a symbol without restarting OpenJUMP.
> > I would like your opinion before to to this change
>
> could you explain why you want to make it a dependency rather than just 
> detecting if the other extension is installed and run some code only when it 
> is detected?
>
> ..ede
>
>
> ___
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net 
> 
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>
>
> ___
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>



___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


[JPP-Devel] SVN: [6302] core/trunk/ChangeLog

2020-06-04 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6302
  http://sourceforge.net/p/jump-pilot/code/6302
Author:   ma15569
Date: 2020-06-04 08:49:10 + (Thu, 04 Jun 2020)
Log Message:
---
Updated ChangeLOg file

Modified Paths:
--
core/trunk/ChangeLog

Modified: core/trunk/ChangeLog
===
--- core/trunk/ChangeLog2020-06-04 08:47:27 UTC (rev 6301)
+++ core/trunk/ChangeLog2020-06-04 08:49:10 UTC (rev 6302)
@@ -4,6 +4,11 @@
 # 3. be concise but convey the change in a way that ordinary users understand
 #< 80 chars 
-->#
 
+2020-06-04 Giuseppe Aruta
+CAD tools. Small enhancement: a new saved block will be automatically 
+available as a symbol (Cadplan VertexSymbols plugin) in the session 
without 
+restarting OpenJUMP
+
 2020-06-02 Giuseppe Aruta
Upgraded patch of VertexSymbols plugin (ver. 0.20a)
Correct bug: styles didn't upgrade into the workbech view



___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


[JPP-Devel] SVN: [6301] core/trunk/lib/plus/CadTools-0.8.jar

2020-06-04 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6301
  http://sourceforge.net/p/jump-pilot/code/6301
Author:   ma15569
Date: 2020-06-04 08:47:27 + (Thu, 04 Jun 2020)
Log Message:
---
Small enhancement: a new saved block will be automatically available as a 
symbol (Cadplan VertexSymbols plugin) in the session without restarting OpenJUMP

Added Paths:
---
core/trunk/lib/plus/CadTools-0.8.jar

Added: core/trunk/lib/plus/CadTools-0.8.jar
===
(Binary files differ)

Index: core/trunk/lib/plus/CadTools-0.8.jar
===
--- core/trunk/lib/plus/CadTools-0.8.jar2020-06-04 08:43:49 UTC (rev 
6300)
+++ core/trunk/lib/plus/CadTools-0.8.jar2020-06-04 08:47:27 UTC (rev 
6301)

Property changes on: core/trunk/lib/plus/CadTools-0.8.jar
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property


___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


[JPP-Devel] SVN: [6300] plug-ins/CADExtension/dist

2020-06-04 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6300
  http://sourceforge.net/p/jump-pilot/code/6300
Author:   ma15569
Date: 2020-06-04 08:43:49 + (Thu, 04 Jun 2020)
Log Message:
---
Updated new build (0.8) and source code

Added Paths:
---
plug-ins/CADExtension/dist/CadTools-0.8.jar
plug-ins/CADExtension/dist/CadTools-08 souce code (requires 
VertexSymbols-020a).zip

Added: plug-ins/CADExtension/dist/CadTools-0.8.jar
===
(Binary files differ)

Index: plug-ins/CADExtension/dist/CadTools-0.8.jar
===
--- plug-ins/CADExtension/dist/CadTools-0.8.jar 2020-06-04 08:40:11 UTC (rev 
6299)
+++ plug-ins/CADExtension/dist/CadTools-0.8.jar 2020-06-04 08:43:49 UTC (rev 
6300)

Property changes on: plug-ins/CADExtension/dist/CadTools-0.8.jar
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: plug-ins/CADExtension/dist/CadTools-08 souce code (requires 
VertexSymbols-020a).zip
===
(Binary files differ)

Index: plug-ins/CADExtension/dist/CadTools-08 souce code (requires 
VertexSymbols-020a).zip
===
--- plug-ins/CADExtension/dist/CadTools-08 souce code (requires 
VertexSymbols-020a).zip 2020-06-04 08:40:11 UTC (rev 6299)
+++ plug-ins/CADExtension/dist/CadTools-08 souce code (requires 
VertexSymbols-020a).zip 2020-06-04 08:43:49 UTC (rev 6300)

Property changes on: plug-ins/CADExtension/dist/CadTools-08 souce code 
(requires VertexSymbols-020a).zip
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property


___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


[JPP-Devel] SVN: [6299] plug-ins/CADExtension/trunk/src/org/openjump/advancedtools/ block/SaveBlockPlugIn.java

2020-06-04 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6299
  http://sourceforge.net/p/jump-pilot/code/6299
Author:   ma15569
Date: 2020-06-04 08:40:11 + (Thu, 04 Jun 2020)
Log Message:
---
 a new saved block will be automatically available as a symbol (Caplan 
Symbology plugin) without restarting OpenJUMP

Modified Paths:
--

plug-ins/CADExtension/trunk/src/org/openjump/advancedtools/block/SaveBlockPlugIn.java

Modified: 
plug-ins/CADExtension/trunk/src/org/openjump/advancedtools/block/SaveBlockPlugIn.java
===
--- 
plug-ins/CADExtension/trunk/src/org/openjump/advancedtools/block/SaveBlockPlugIn.java
   2020-06-03 07:49:07 UTC (rev 6298)
+++ 
plug-ins/CADExtension/trunk/src/org/openjump/advancedtools/block/SaveBlockPlugIn.java
   2020-06-04 08:40:11 UTC (rev 6299)
@@ -22,6 +22,7 @@
 import com.vividsolutions.jump.feature.Feature;
 import com.vividsolutions.jump.geom.CoordUtil;
 import com.vividsolutions.jump.workbench.JUMPWorkbench;
+import com.vividsolutions.jump.workbench.Logger;
 import com.vividsolutions.jump.workbench.WorkbenchContext;
 import com.vividsolutions.jump.workbench.plugin.AbstractPlugIn;
 import com.vividsolutions.jump.workbench.plugin.EnableCheckFactory;
@@ -189,7 +190,10 @@
 + filename;
 GeometryUtils.writeToFile(newGeom, filenamedir);
 }
-
+   if (checkSymbolLibrary()) {
+   
com.cadplan.jump.utils.LoadSymbolFiles loadSymbols = new 
com.cadplan.jump.utils.LoadSymbolFiles(context);
+   loadSymbols.start();
+   }
 context.getWorkbenchFrame().setStatusMessage(Warning2);
 
 if (blockPanel != null) {
@@ -205,6 +209,25 @@
 }
 }
 
+boolean checkSymbolLibrary() {
+   ClassLoader cl = this.getClass().getClassLoader();
+   @SuppressWarnings("rawtypes")
+   Class c = null;
+   try {
+   c = 
cl.loadClass("com.cadplan.jump.utils.LoadSymbolFiles");
+
+   }
+   catch (ClassNotFoundException e) {
+   Logger.warn("Could not load Symbol file library", e);
+   }
+   if (c != null) {
+   return true;
+   } else {
+   return false;
+   }
+   }
+
+
 private JPanel createMainPanel() {
 JPanel jpanel = new JPanel(new GridBagLayout());
 JLabel jLabel = new JLabel();



___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] CAD plugin. Add new library (as depency)

2020-06-04 Thread Giuseppe Aruta
OK. I found a solution. No dependency required. Thank Ede
Peppe

Il giorno gio 4 giu 2020 alle ore 10:19 Giuseppe Aruta <
giuseppe.ar...@gmail.com> ha scritto:

> Indeed I was planning this way: from user's point of view there is no
> difference.
> On the other hand, I was thinking about developers who have a project in
> their eclipse connected to svn (or not) and have a warning that a library
> is missing whenever they want to compile (right now, a very rare situation)
> I can add a readme text file on SVN>CAD plugin>dist folder explaining that
> VertexSymbol.jar library is required to compile
> Best regards
> Peppe
>
>
> Il giorno mer 3 giu 2020 alle ore 22:20  ha scritto:
>
>> On 03.06.2020 17:32, Giuseppe Aruta wrote:
>> > Hi all,
>> > I want to add VertexSymbolsXXX.jar as depency to CAD plugin.
>> > This is the reason:
>> > Currently, whenever the user saves a new block (CAD toolbar>Block>Save
>> > geometry as block) as file, this can be used also as a point/line symbol
>> > for styling. But, to do that, the user needs to close/restart again OJ.
>> > Adding this dependency and using a few lines of code, a new block will
>> be
>> > automatically available as a symbol without restarting OpenJUMP.
>> > I would like your opinion before to to this change
>>
>> could you explain why you want to make it a dependency rather than just
>> detecting if the other extension is installed and run some code only when
>> it is detected?
>>
>> ..ede
>>
>>
>> ___
>> Jump-pilot-devel mailing list
>> Jump-pilot-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>
>
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] CAD plugin. Add new library (as depency)

2020-06-04 Thread Giuseppe Aruta
Indeed I was planning this way: from user's point of view there is no
difference.
On the other hand, I was thinking about developers who have a project in
their eclipse connected to svn (or not) and have a warning that a library
is missing whenever they want to compile (right now, a very rare situation)
I can add a readme text file on SVN>CAD plugin>dist folder explaining that
VertexSymbol.jar library is required to compile
Best regards
Peppe


Il giorno mer 3 giu 2020 alle ore 22:20  ha scritto:

> On 03.06.2020 17:32, Giuseppe Aruta wrote:
> > Hi all,
> > I want to add VertexSymbolsXXX.jar as depency to CAD plugin.
> > This is the reason:
> > Currently, whenever the user saves a new block (CAD toolbar>Block>Save
> > geometry as block) as file, this can be used also as a point/line symbol
> > for styling. But, to do that, the user needs to close/restart again OJ.
> > Adding this dependency and using a few lines of code, a new block will be
> > automatically available as a symbol without restarting OpenJUMP.
> > I would like your opinion before to to this change
>
> could you explain why you want to make it a dependency rather than just
> detecting if the other extension is installed and run some code only when
> it is detected?
>
> ..ede
>
>
> ___
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel