New DrawFBP release

466 views
Skip to first unread message

Paul Morrison

unread,
Feb 21, 2019, 10:05:13 PM2/21/19
to Flow Based Programming
Release v2.16.1 is now available on GitHub/drawfbp.  It has a couple of new functions, as well as having had a number of earlier problems corrected. 

The most important new functions are:

- Compile Java program, and

- Run Java program

DrawFBP is written in Java, so it is relatively easy for it to run Java networks - it could probably be enhanced to compile C#, as well...  Is there any interest?

Under the covers, DrawFBP now uses javaGeom, so the jar file for this has to be added to the Eclipse build path, or included in a classpath parameter for running as a DOS command.  This is described in


If anyone has ideas about how to package this better, I'd be glad to hear about it!

The latest release of DrawFBP is now available from Maven by entering


Finally, the Excise function has been slightly modified: external port attributes are now entered by modifying the External Port blocks, not the Enclosure block.


Paul Morrison

unread,
Feb 22, 2019, 9:53:08 PM2/22/19
to Flow Based Programming
Bug found in DrawFBP v2.16.1 in Compile function (thanks, Bob!).  I will be posting a fix shortly, which will be Release v2.16.2.

Apologies, and thanks for your patience!

Ged Byrne

unread,
Feb 23, 2019, 5:23:43 AM2/23/19
to flow-based-...@googlegroups.com
Hi Paul,

Wonderful news.  The release not the bug.  I look forward to downloading and giving it a try.  

It sounds like you are moving towards a full IDE.  Do you have any concrete plans in that direction?

Regards,


Ged

--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

toivo...@gmail.com

unread,
Feb 23, 2019, 10:34:14 AM2/23/19
to Flow Based Programming
Hi, 

If IDE is a goal, I recommend using standard IDE and creating DrawFBP as plugin for IDE.

Creating IDE itself requires lot of work, it’s not worth the effort, I think. And later maintenance is nightmare.

For example creating Eclipse plugin is not very difficult. It requires initially fair amount of work.

But once you know how handle all quirks, its relatively easy.

And from now on you have all Eclipse features for free. Open source code from your DrawFBP, edit and save, no problem. Compile and run your flow, just few clicks. Debug, easy. Sync with Git or SVN, easy. Etc.


Thanks

Toivo

To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-programming+unsub...@googlegroups.com.

Alex Korshunov

unread,
Feb 25, 2019, 6:27:25 AM2/25/19
to Flow Based Programming
Great!

Paul Morrison

unread,
Feb 25, 2019, 11:01:17 AM2/25/19
to Flow Based Programming
Thanks for the encouragement, gentlemen! 

And Bob, I think I found your Save problem... for which many thanks!

Accordingly, I have upgraded DrawFBP v2.16.2 from pre-Release to a full Release.  I will do some more testing, and then put it up on Maven in the next few days...

Toivo, I like the idea of an Eclipse plugin - I will investigate that...  I assume that a) Eclipse is a very popular (the most popular?) Java development vehicle (at any rate I am fairly familiar with it, although not with plugins!), and b) that it runs in a variety of different environments...  If I start to dig into it, would you be willing to give me a hand occasionally?

One area I am still confused about is how Java packages work with the folder structure - e.g. the folder structure of the classes built by javac seem to be based on the package statement, not on the source folder structure.  So far I haven't been able to find a description of why this should be so - does Eclipse work like that too?

Thanks again - as always, feedback will be very welcome!

Paul Morrison

unread,
Feb 25, 2019, 11:24:18 AM2/25/19
to Flow Based Programming
Another packaging question:

Is there a cleaner way to incorporate javaGeom in the deliverables, compared with the way I describe in https://github.com/jpaulm/drawfbp/blob/master/README.md ...?

TIA

toivo...@gmail.com

unread,
Feb 26, 2019, 9:00:40 AM2/26/19
to Flow Based Programming

Hi Paul,


I am not Eclipse expert, but I will try to help you.


Eclipse is widely used, I use it under both Linux and Windows.


If you decide to create Eclipse plugin you have 2 options:


1. Download Eclipse IDE for Eclipse Committers

(which contains Eclipse Plug-in Development Environment, in short PDE).


2. If you prefer to keep your current Eclipse, you can install PDE plugins separately.


Next, It might be useful to play little with plugin examples.

From Eclipse menu → New → Other… Plugin Development → Plugin-in Project → Next

Wizard will open, give some to project → Next → Next and choose one of the templates.


Eclipse have different kinds plugin-s with different functionality.


Usually all wanted functionality is implemented as set of plugins.

You may want to start with one plugin, which is probably some kind of Editor.

And add other plugins later.


When you start actually implement editor plugin, you need to choose which graphical framework you use. Eclipse itself uses SWT, but I understand you have already lot of code in Swing. Swing can used in Eclipse plugin also.

See

https://stackoverflow.com/questions/23675830/turn-java-swing-application-into-eclipse-plugin


Where are other alternatives as well, for example

https://www.eclipse.org/graphiti/


Also you can use JavaFX in Eclipse plugin.



>> Another packaging question:


Instead of

java -cp "javaGeom-0.11.1.jar;build/libs/drawfbp-2.15.10.jar" com.jpaulmorrison.graphics.DrawFBP


you can use something like (put all your jar files into lib subdirectory)


java -cp "lib/*" com.jpaulmorrison.graphics.DrawFBP

And in case of Eclipse plugin – all needed jars are packed in plugin.

Regards,
Toivo

Paul Morrison

unread,
Feb 26, 2019, 12:52:29 PM2/26/19
to flow-based-...@googlegroups.com
Many thanks, Toivo!  This way of invoking DrawFBP is much cleaner!  For releases in pre-Release status, we might have to use the old technique, though!

Did you see my question about packages and folder structure?  Any thoughts?

I'll definitely look at plugins!

TIA

Paul

--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.

Ged Byrne

unread,
Feb 26, 2019, 3:31:02 PM2/26/19
to flow-based-...@googlegroups.com
Hi Paul,

The package and the folder structure should always match. The standard class loader will convert the full class name into a path to load the class.  

Here’s the description of the package model in the language specification. 

If you read the purple box in section 7.2 it gives the full details.  

if this simple organization were used on an operating system where the file name separator is /, the package name:
jag.scrabble.board

would be transformed into the directory name:

jag/scrabble/board

It’s possible to change this behaviour by implementing a custom class loader.  

Regards,


Ged

Paul Morrison

unread,
Feb 26, 2019, 4:16:34 PM2/26/19
to Flow Based Programming
Thanks, Ged!

This implies that you can never have a source module directly in the src\ folder...?  Or can you have modules that are not part of packages - i.e. with no 'package' statement?

TIA

Paul Morrison

unread,
Feb 26, 2019, 8:18:05 PM2/26/19
to flow-based-...@googlegroups.com
Looks like you can have small programs with no package statement!

Thanks, everyone!

Paul Morrison

unread,
Feb 27, 2019, 10:21:34 AM2/27/19
to Flow Based Programming
Release v2.16.2 now checks that the package statement in Java programs matches the folder structure.  It is now available on Maven Central.

Cheers,

Paul M.

Paul Morrison

unread,
Mar 16, 2019, 10:09:05 PM3/16/19
to Flow Based Programming
As you may have seen, I have decided to implement a first attempt at Compile and Run facilities in DrawFBP - first for Java, and then more recently for C#.  These are both working - at least for my test cases - using my latest release, v2.16.4.  The issues I am running into are all related to packaging, so I have sort of reached the limits of my knowledge of this for both Java and C#...  Toivo made a suggestion for packaging the more recent releases (for which thanks, Toivo), which works well for normal Releases, but IIUC requires pre-Release code to be treated differently, so feedback on that would be great (described in https://github.com/jpaulm/drawfbp/blob/master/README.md )!

For Java, I have separated the function of compiling (components and networks) from that of running networks.  The generated classes generate .class files in the 'bin' directory, if there is one.   If there isn't, the .class files go into the same folder as the corresponding source files (OK?).  

'Run' runs one of these classes, provided that it has a 'main' method.  Following the style of other DrawFBP functions, the user can specify one or more jar files for the program's build path (in addition to the JavaFBP jar file).

The 'package' clause has to match the top directory level(s) of the source code.

I have followed basically the same pattern for C#, with 'namespace' being treated the same way as Java 'package'.  The main difference is that my C# Compile compiles all the programs in a folder, and creates an .exe file with the same name as the folder...  Does this make sense?!

As we found with some of my previous problems, these tend to be caused by my being too familiar with the code, so it would also be great if experts in Java or C# respectively could do some testing of DrawFBP!

Toivo, I will look into Eclipse plugins next! 

Regards,

Paul M.

Paul Morrison

unread,
Mar 19, 2019, 11:24:56 AM3/19/19
to flow-based-...@googlegroups.com, Bob Corrick, Toivo Adams
Pre-Release versions v2.16.3 and v2.16.4 of DrawFBP have been deleted - sorry, people!  Release v2.16.5 has now been created, and is in pre-Release status.

This release now supports compiling and running C# programs.  If your program requires additional dlls, you can add them using the File/Add Additional Dll File function - this is analogous to the File/Add Additional Jar File function, delivered a few releases ago.

Currently there is no DrawFBP-supported way to delete jar or dll files from DrawFBP's list, but you can delete them manually by editing user.DrawFBPProperties.xml .  I will add a function to clear this in an upcoming release.

Feedback would be much appreciated!

Cheers,

Paul M.

Paul Morrison

unread,
Mar 24, 2019, 3:01:28 PM3/24/19
to Flow Based Programming
I was not too comfortable with Release v2.16.5, so I have upgraded to v2.16.6 - it is in DrawFBP Releases in pre-Release status.

Feedback would be appreciated!  (Try the Compile and Run features!)

Cheers,

Paul M.

Paul Morrison

unread,
Apr 20, 2019, 11:17:45 AM4/20/19
to flow-based-...@googlegroups.com, Bob Corrick, Toivo Adams
I would very much appreciate having some volunteers for testing my latest release of DrawFBP - v2.16.10. 

The main change, which might interest some of you, is that I am now generating.fbp notation (originally developed by Wayne Stevens, and adopted by NoFlo).  This is now being treated as a (mini-)language, on a par with Java and C#, rather than as a function under File.  Of course it does not support the newly implemented "Compile" and "Run" functions...

I have not put this release up on Maven yet, as Maven will not allow me to make small tweaks IIUC, so it needs a bit of testing before this happens.

As I have asked before, any ideas about packaging of DrawFBP would also be welcome - I'm currently using Toivo's idea about grouping multiple jar files in the 'lib' directory, but this does not readily support a "pre-Release" status...

Regards,

Paul M.



toiv...@gmail.com

unread,
Apr 21, 2019, 6:39:07 AM4/21/19
to Flow Based Programming
Hi Paul,

You can pack all your jar files to one ‘fat’ jar file.
Maven will do this for you, but you need to add instructions to Maven pom file.
Also Gradle can build fat jar.

https://stackoverflow.com/questions/19150811/what-is-a-fat-jar

Maybe this helps you?

Regards, 
Toivo
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-programming+unsub...@googlegroups.com.

Paul Morrison

unread,
Apr 21, 2019, 4:26:47 PM4/21/19
to flow-based-...@googlegroups.com
Thanks, Toivo, that sounds great!  Wish me luck building a fat jar!

To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.

Paul Morrison

unread,
Apr 22, 2019, 2:14:54 PM4/22/19
to flow-based-...@googlegroups.com
Hi Toivo,

I have successfully created a "fat jar" ...  and it seems to work!  So far so good!  Many thanks!

Now in https://stackoverflow.com/questions/19150811/what-is-a-fat-jar , they talk about doing it in Maven (starting with "<pluginrepositories>") - can I just put this (maybe using some other syntax) into the writeNewPom in build.gradle?  Probably dumb question!  I confess I don't really understand how Gradle talks to Maven!

Thanks in advance,

Paul

On Sun, Apr 21, 2019 at 6:39 AM <toiv...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.

toiv...@gmail.com

unread,
Apr 24, 2019, 7:01:38 AM4/24/19
to Flow Based Programming

Hi Paul,

 

I don’t know Gradle.

 

I use Maven and in pom file it looks like

 

                .    .    .

 

       <build>

           <plugins>

 

              <plugin>

                   <groupId>org.apache.maven.plugins</groupId>

                   <artifactId>maven-assembly-plugin</artifactId>

                   <version>3.1.0</version>

                   <configuration>

                       <descriptorRefs>

                           <descriptorRef>jar-with-dependencies</descriptorRef>

                       </descriptorRefs>

      

                   </configuration>

                   <executions>

                       <execution>

                           <id>assemble-all</id>

                           <phase>package</phase>

                           <goals>

                               <goal>single</goal>

                           </goals>

                       </execution>

                   </executions>

                     </plugin>

       

            </plugins>

       </build>

 

Regards, 

Toivo

To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-programming+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-programming+unsub...@googlegroups.com.

Paul Morrison

unread,
Apr 24, 2019, 11:11:20 AM4/24/19
to Flow Based Programming
Thanks, Toivo.  However, I may have to look for other solutions...?  I just read https://product.hubspot.com/blog/the-fault-in-our-jars-why-we-stopped-building-fat-jars by Jonathan Haber, and he lists a number of issues with fat jars, including size.  My fat jar is about 8 Megs!  His product SlimFast may be a solution... if I can fit it into my environment!

I did try to use Ray Holder's gradle-one-jar, but haven't been able to get it working yet!

Regards,

P.

ComFreek

unread,
Apr 24, 2019, 1:26:51 PM4/24/19
to Flow Based Programming
I have been following the discussion and have just read it more in-depth. 

Am Dienstag, 26. Februar 2019 15:00:40 UTC+1 schrieb toivo...@gmail.com:

[...]


Eclipse is widely used, I use it under both Linux and Windows.


According to [1], IntelliJ IDEA is at least equally widely used and some sources even claim Eclipse's death. Do note that I did not research about IntelliJ IDEA's death claims, so my comment might be biased.
In any case, I would advise designing the GUI for the plugin in a IDE-agnostic way.


John Cowan

unread,
Apr 24, 2019, 2:00:52 PM4/24/19
to Flow Based Programming
I don't think you have anything to worry about.  In that article, there are 100,000 classes with all dependencies in place, and gobs of changes by a whole herd of engineers.  DrawFBP is pretty much at the opposite extreme.  What doesn't work for them should be just fine for you.

To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.

toiv...@gmail.com

unread,
Apr 24, 2019, 2:47:02 PM4/24/19