Sam, I do appreciate your frustration,
and hope that people can come up with ways to simplify the work
flow. What follows is my first crack at it. There is also some
stuff in the readme.txt on SourceForge for JavaFBP - there is a
copy of this on my web site, called
http://www.jpaulmorrison.com/graphicsstuff/FBPreadme.txt
, which was written before DrawFBP existed, and does not
assume
Eclipse as the IDE, although it mentions it. I am sure I
have omitted important steps, so let's just use this as the base
for the tutorial that people have been requesting... unless of
course it would be better to approach it from a totally different
angle...?
Looking forward to feedback, brickbats, etc.
Paul
--------------------------------------------------------
I have put the xml-format encoding for a simple diagram up on my
web site -
http://www.jpaulmorrison.com/graphicsstuff/MergeSortDisplay.drw
, where .drw is the extension for DrawFBP diagrams. You do not
code this up, although theoretically you could - it just records
all the diagram info, including x-y coordinates for all blocks,
arrows and bends.
Now save this file into a convenient directory, and read it with
DrawFBP. The result should be a diagram looking like this:
http://www.jpaulmorrison.com/graphicsstuff/MergeSortDisplay.png
Now at this point, the blocks don't have components associated
with them, so you
can generate code, but it will flag the
"component" clauses as having errors.
So the next thing to do is to assign Java components to the
blocks: right click on each block, and click on "Select
Component/Subnet Class" for each one. You can either load a class
from one of your own libraries, or from the JavaFBP jar file (you
will be prompted to find this and download it if you don't already
have it). If you use the JavaFBP jar file, you could use
Generate.class for the two Generate blocks, Sort.class for the
Sort (a very Mickey Mouse Sort component, which can only handle up
to 9999 IPs), and WriteToConsole.class for Display.
After associating a class with each component, generate the
network again (using Generate Network.../Java), and save it into a
convenient Java library, you will probably have to do a refresh
under your IDE to see it; then change the package name as
required, and it should be runnable as a Java application under
your favorite IDE. If you are using Eclipse, add the latest
JavaFBP jar file to Project/Properties/JavaBuild Path/Libraries
for all your JavaFBP properties.
The output of the two Generates will be merged into Sort on a
first-come, first-served basis, so the output should look
something like the following:
000001abcd
000001abcd
000002abcd
000002abcd
000003abcd
000003abcd
...
000059abcd
000059abcd
000060abcd
000060abcd
000061abcd
000062abcd
000063abcd
...
000097abcd
000098abcd
000099abcd
000100abcd
Run complete. Time: 0.156 seconds