Skip to content

Commit e9135ba

Browse files
committed
Updating drawfbp in github
0 parents  commit e9135ba

File tree

324 files changed

+27523
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+27523
-0
lines changed

.classpath

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="test" value="true"/>
17+
<attribute name="optional" value="true"/>
18+
<attribute name="maven.pomderived" value="true"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
22+
<attributes>
23+
<attribute name="maven.pomderived" value="true"/>
24+
</attributes>
25+
</classpathentry>
26+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
27+
<classpathentry kind="output" path="target/classes"/>
28+
</classpath>

.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2+
hs_err_pid*
3+
4+
5+
*-fulltrace.txt
6+
7+
# Gradle
8+
.gradle
9+
10+
# Maven packages/etc
11+
target
12+
build/classes
13+
build/dependency-cache
14+
build/reports
15+
build/docs/javadoc
16+
build/ivy.xml
17+
18+
19+
# Eclipse project
20+
bin
21+
.settings
22+
23+
24+
# IDEA project
25+
.idea/
26+
*.iml
27+
28+
# System's crap
29+
Thumbs.db
30+
.DS_Store
31+

.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>drawfbp</name>
4+
<comment>Diagramming Tool for Flow-Based Programming. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
21+
<nature>org.eclipse.jdt.core.javanature</nature>
22+
</natures>
23+
</projectDescription>

README.md

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
DrawFBP
2+
=======
3+
4+
#### Tool for Creating and Exploring Flow-Based Programming Diagram Hierarchies
5+
6+
General web site on Flow-Based Programming: https://jpaulm.github.io/fbp/ .
7+
8+
Current release is `v3.1.7`. This will not be promoted to Maven for a while, to allow continuing work with the same release - the major Zoom issue, #79, however, has been fixed, and the jar file can be found on `build\libs`.
9+
10+
The jar file (which includes the `math.geom2d` and `JavaHelp` jar files) - `drawfbp-3.1.7.jar` - can be obtained from the Releases folder (click on `tags`, then `Releases`), `build\libs` , and Maven, a little later.
11+
12+
This release incorporates a large number of IntelliJ suggestions - it has not been thoroughly tested as yet - please contact me if you notice discrepancies...
13+
14+
If you click on the Maven shield below to obtain DrawFBP, select `Download` and `jar`.
15+
16+
[![Maven Central](https://img.shields.io/maven-central/v/com.jpaulmorrison/drawfbp.svg?label=DrawFBP)](https://search.maven.org/search?q=g:%22com.jpaulmorrison%22%20AND%20a:%22drawfbp%22)
17+
18+
Note: The Maven shield will show the earlier version for a while...
19+
20+
21+
Associating `.drw` file type with DrawFBP application
22+
---
23+
24+
There is a `.bat` file, `draw.bat`, which can be associated with the filetype `.drw` - the easiest way to do this is to right click on a `.drw` file, then select `Open with...`. Now select the `Always use this app to open .drw files` option, then go down to the section which allows you to browse directories and files, and select `draw.bat` in your local `GitHub\drawfbp` directory.
25+
26+
**Note:** To use the `draw.bat` function, create/modify your environment variables, as follows:
27+
28+
- **DRAWFBP_LIB** to specify the local repository containing the `draw.bat` file (`...\GitHub\drawfbp`) and the `\build\libs` directory containing the downloaded `drawfbp-x.y.z.jar` jar file
29+
- **DRAWFBP_VERSION** specifying the current version number
30+
31+
<!--
32+
33+
Now, to associate the `drawfbp.bat` file with the `.drw` file type, issue the following commands in DOS, running in *adminstrator mode*:
34+
35+
`assoc .drw=DrawFBPFile`
36+
`ftype DrawFBPFile=cmd /k call "%DRAWFBP_LIB%\draw.bat" "%1" %*`
37+
38+
(see https://stackoverflow.com/questions/28189137/windows-establish-file-association-to-batch-file )
39+
40+
-->
41+
42+
You can also call the `draw.bat` function directly in DOS as e.g.
43+
44+
<folder containing DrawFBP on your machine>\draw.bat <name of .drw file>
45+
46+
47+
**Note:** `fbp.json` in `docs` does not download correctly: please do a copy and paste from https://github.com/jpaulm/drawfbp/blob/master/docs/fbp.json (current version thanks to Henri Bergius of NoFlo).
48+
49+
50+
Sample DrawFBP network
51+
---
52+
53+
Here is a simple diagram built using DrawFBP, courtesy of Bob Corrick, showing process names, IIPs, and actual class names (used for generating runnable code, and also when checking port connections).
54+
55+
![FilterByFirstValue](https://github.com/jpaulm/drawfbp/blob/master/docs/FilterByFirstValue.png "Simple Network Diagram")
56+
57+
Running DrawFBP
58+
---
59+
60+
To run from the command line, do a `cd` to wherever you have stored your DrawFBP jar file, and enter:
61+
62+
<code>java -jar drawfbp-x.y.z.jar</code> where `x.y.z` is the version number.
63+
64+
If you have downloaded the whole DrawFBP project, you can position to your DrawFBP folder, and then enter this command to run DrawFBP:
65+
66+
<code>java -jar build\libs\drawfbp-x.y.z.jar</code> where `x.y.z` is the version number.
67+
68+
<!-- In either case, this command may be followed with the location of a `.drw` file, as of `v2.20.10`, e.g.
69+
70+
cd ....GitHub\drawfbp
71+
java -jar build\libs\drawfbp-x.y.z.jar C:\Users\Paul\Documents\GitHub\drawfbp\Testing.drw
72+
73+
You can also associate your copy of the DrawFBP jar file permanently with all occurrences of the `.drw` extension (using Windows facilities).
74+
75+
-->
76+
77+
Description
78+
-----------
79+
80+
DrawFBP is a picture-drawing tool that allows users to create multi-level diagrams implementing the technology and methodology known as Flow-Based Programming (FBP). Diagrams are saved in DrawFBP XML format, and can actually be used to generate JavaFBP networks, which can then be compiled and run on an IDE such as Eclipse.
81+
82+
DrawFBP supports "stepwise refinement" or "top-down development" by supporting subnets - blocks in the diagram that can specify lower level diagrams, which can in turn specify lower level ones, and so on. DrawFBP allows the user to draw a diagram just using short, descriptive names for blocks (nodes) and to fill in either component or subnet names later. Multiple levels can be held under separate tabs, allowing the user to jump back and forth between different levels of a design.
83+
84+
Alternatively, complex diagrams can be turned into multi-level diagrams by using the "excise" function of the Enclosure block: a group of blocks can be converted into a separate subnet and replaced by a "subnet" block, containing appropriate "external port" blocks, in one operation (see Youtube DrawFBP 5 - https://www.youtube.com/watch?v=5brTDk8cpNo around 9:06).
85+
86+
DrawFBP can generate networks for Java, C#, and NoFlo (JSON). These are kept separate in the DrawFBP dialogs and typically use different libraries.
87+
88+
DrawFBP also generates a network definition in .fbp notation. This was originally defined by Wayne Stevens, and has been somewhat modified for NoFlo. It will also be usable as input to the C++ implementation, called CppFBP.
89+
90+
For information about FBP in general, see the FBP web site - http://www.jpaulmorrison.com/fbp .
91+
92+
Six Youtube videos are currently available showing how to use DrawFBP, for drawing diagrams, and generating running JavaFBP networks, using the Eclipse IDE - see below...
93+
94+
95+
#### Getting Started with your Diagram
96+
97+
To get started using DrawFBP once you have downloaded it, start it going, then click anywhere on the drawing screen, and a block will appear, with a popup prompting you to add a (short) description. The type of block defaults to "Process", but a number of other block types are available, controlled by the buttons along the bottom of the screen.
98+
99+
To indicate a connection between two blocks, click anywhere on the border of the "from" block; then hold down the button and drag the mouse to an edge of the "to" block. You should see a small blue circle appear where you can click the end of the arrow.
100+
101+
Other features are described in the Help facility.
102+
103+
104+
Features
105+
----
106+
107+
- Variety of block types, including "Initial IP", Report, File, Legend (text with no boundary), External ports (for subnets), Human (!)
108+
- Top-down design supported - although bottom-up is also supported (blocks can be placed on the diagram and connected, and class names filled in later)
109+
- Display subnets in separate tabs
110+
- Convert portion of diagram to subnet (using Enclosure block "Excise" function)
111+
- Specify connection capacity
112+
- "Automatic" ports
113+
- Checking for valid port names
114+
- Indicate "drop oldest" attribute for given connection
115+
- Generate complete networks in Java, C#, JSON, or .fbp notation
116+
- Pan, zoom in/out
117+
- Drag portion only of diagram (using Enclosure block)
118+
- Go to folder from diagram (as of v2.14.1)
119+
- Keyboard-only usage (except positioning of blocks)
120+
- Choose fonts (fixed size and variable size, indicating support for Russian, Hindi (Devanagari), and Chinese)
121+
- Change font size
122+
- Structured Help facility
123+
- Export diagram as image
124+
- Print diagram
125+
- Drag blocks, sections of diagram (using "Enclosure"), heads or tails of arrows; create or drag bends in arrows
126+
- "Grid" positioning on/off
127+
- Extra arrowhead (one per arrow)
128+
- New Functions (as of `v2.16.1`):
129+
- Compile Java program
130+
- Run Java program
131+
- New Functions (as of `v2.16.5`):
132+
- Compile C# program
133+
- Run C# program
134+
- As of `v2.18.1`, File Chooser now displays date and time on non-jar items, and entries can be sorted by name (ascending) or by date/time (descending)
135+
- Compare two diagrams
136+
- When saving generated network, code compares package name against directory structure, and adjusts package name if they don't match
137+
- As of `v2.20.10`, you can associate `drawfbp.bat` with the file suffix `.drw`, using Windows facilities
138+
139+
140+
Videos on DrawFBP features
141+
----
142+
143+
In addition, there are six Youtube videos about DrawFBP, illustrating a number of basic ("classical") FBP concepts (what we are now calling "FBP-inspired" or "FBP-like" systems do not necessarily contain all of these, although DrawFBP should be able to support most of these systems):
144+
- [DrawFBP video #1](https://www.youtube.com/watch?v=OrKenPOV4Js)
145+
- [DrawFBP video #2](https://www.youtube.com/watch?v=9NXYNxDjFWY)
146+
- [DrawFBP video #3](https://www.youtube.com/watch?v=-AmzfhV2hIU)
147+
- [DrawFBP video #4](https://www.youtube.com/watch?v=F0lKQpIjfVE)
148+
- [DrawFBP video #5](https://www.youtube.com/watch?v=5brTDk8cpNo) - concept of "subnets", both at design and implementation time
149+
- [DrawFBP video #6](https://youtu.be/IvTAexROKSA) - simple interactive systems using WebSockets, with demo of JavaFBP-WebSockets (JavaFBP and HTML5)
150+
151+
**Note:** File Chooser now displays date and time on non-jar items, and entries can be sorted by name (ascending) or by date/time (descending).
152+
153+
In addition, the Excise function has changed a little, so the interaction will not be exactly as shown in the video (video #5)
154+
155+
Running DrawFBP (2)
156+
----
157+
DrawFBP can be executed directly by executing its jar file, but, as of v2.15.10, it needs the 2D geometry jar file. The combination is called a "fat jar" file - before v2.18.1, the jar name contained `all-`; from v2.18.1 on, the `all-` has been dropped.
158+
159+
DrawFBP requires Java 1.7 or later.
160+
161+
If you want access to the Java annotations of your components, add the jar file(s) containing them (at least JavaFBP and possibly others) to the project Properties/Build Path (for Eclipse), or e.g. type on the command line
162+
163+
java -cp "build/libs/drawfbp-x.y.z.jar;..\javafbp\build\libs\javafbp-4.1.2.jar" com.jpaulmorrison.graphics.DrawFBP
164+
165+
where `x.y.z` is the DrawFBP version number.
166+
167+
- to run under Linux, replace the semi-colon(s) with colon(s).
168+
169+
Note: if you are displaying a network built using a pre-v2.13.0 version of DrawFBP, with some or all of the component classes (from JavaFBP) filled in, you will have to reaccess the component classes, as the naming conventions have changed slightly.
170+
171+
**DrawFBP properties** are held in a file called <code>DrawFBPProperties.xml</code> in the user's home directory. If this does not exist, it will be created the first time the user runs DrawFBP - it is automatically updated as the user uses various DrawFBP facilities.
172+
173+
Compare facility
174+
---
175+
176+
DrawFBP now (as of v2.19.0) lets you compare two diagrams, indicating which blocks and lines have been added or deleted. In the case of deleted blocks and lines, the Compare facility paints the old block (called a "ghost") and/or line in pale gray on the new diagram.
177+
178+
Added blocks and lines are marked with an "A" symbol, deleted blocks and lines with a "D" symbol, and deleted blocks also with the word "ghost".
179+
180+
XML Schema for `.drw` files
181+
---
182+
183+
An XML Schema has been added to the `lib` folder - https://github.com/jpaulm/drawfbp/blob/master/lib/drawfbp_file.xsd - specifying the format of the XML files used to hold DrawFBP diagrams. These files have an extension of `.drw`. This schema can also be used to check whether the file format of any other diagramming tool matches the `.drw` format.
184+
185+
Old `.drw` files can still be displayed using the latest release of DrawFBP (v2.13.0 and following), but will be stored in the new format when they are rebuilt.
186+
187+
External ports for subnets still have to be added.
188+
189+
Running networks generated by DrawFBP
190+
---
191+
192+
**When you set up a Java project, for use with DrawFBP, it is recommended that you specify the output classes to be in the `bin` directory, rather than `target/classes`.**
193+
194+
JavaFBP or C#FBP networks created by DrawFBP can be run stand-alone: for Java, you will need to add the JavaFBP jar file, obtainable from GitHub - do a Maven search for javafbp - click on `Download`, and then `jar` - to the Java Build Path of any projects you create.
195+
196+
If you want to run an app using JavaFBP-WebSockets, you will need the jar file for that as well, as described in the README file for the `javafbp-websockets` project on GitHub - it is also on Maven.
197+
198+
Just as any necessary Java jar files can be obtained from the JavaFBP project on GitHub, to run C# applications using FBP you will need `.dll` files for `FBPLib` and `FBPVerbs`, obtained from the C#FBP libraries - https://github.com/jpaulm/csharpfbp .
199+
200+
`jar` files and `dll` files can be added to your project by using the `File/Add additional jar/dll files` function.
201+

Testing.drw

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0"?>
2+
<drawfbp_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://github.com/jpaulm/drawfbp/blob/master/lib/drawfbp_file.xsd"><net><desc>Components filled in</desc> <complang>Java</complang> <clicktogrid>false</clicktogrid>
4+
<blocks><block> <x> 623 </x> <y> 190 </y> <id> 32 </id> <type>L</type> <width>82</width> <height>38</height> <description>rejected</description> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet>
5+
</block>
6+
<block> <x> 242 </x> <y> 161 </y> <id> 48 </id> <type>B</type> <width>92</width> <height>64</height> <description>read
7+
sample
8+
file</description> <blockclassname>C:/Users/Paul/Documents/GitHub/javafbp/build/libs/javafbp-4.1.0.jar!com.jpaulmorrison.fbp.core.components.io.ReadFile</blockclassname> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet>
9+
</block>
10+
<block> <x> 435 </x> <y> 161 </y> <id> 4 </id> <type>B</type> <width>92</width> <height>64</height> <description>filter by
11+
first letter</description> <blockclassname>C:/Users/Paul/Documents/GitHub/javafbp/build/libs/javafbp-4.1.0.jar!com.jpaulmorrison.fbp.core.components.text.StartsWith</blockclassname> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet>
12+
</block>
13+
<block> <x> 434 </x> <y> 79 </y> <id> 38 </id> <type>I</type> <width>18</width> <height>18</height> <description>J</description> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet>
14+
</block>
15+
<block> <x> 585 </x> <y> 236 </y> <id> 23 </id> <type>B</type> <width>92</width> <height>64</height> <description>Ignore</description> <blockclassname>C:/Users/Paul/Documents/GitHub/javafbp/build/libs/javafbp-4.1.0.jar!com.jpaulmorrison.fbp.core.components.routing.Discard</blockclassname> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet>
16+
</block>
17+
<block> <x> 241 </x> <y> 79 </y> <id> 43 </id> <type>I</type> <width>314</width> <height>18</height> <description>C:/Users/bobco/drawfbp/txt-nonexist.csv</description> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet>
18+
</block>
19+
<block> <x> 724 </x> <y> 59 </y> <id> 45 </id> <type>I</type> <width>130</width> <height>18</height> <description>Accepted entries</description> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet>
20+
</block>
21+
<block> <x> 732 </x> <y> 128 </y> <id> 30 </id> <type>B</type> <width>92</width> <height>64</height> <description>display
22+
accepted
23+
lines</description> <blockclassname>C:/Users/Paul/Documents/GitHub/javafbp/build/libs/javafbp-4.1.0.jar!com.jpaulmorrison.fbp.core.components.swing.ShowText</blockclassname> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet>
24+
</block>
25+
<block> <x> 598 </x> <y> 131 </y> <id> 31 </id> <type>L</type> <width>91</width> <height>38</height> <description>accepted</description> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet>
26+
</block>
27+
</blocks> <connections>
28+
<connection> <fromx>481</fromx> <fromy>171</fromy> <tox>584</tox> <toy>204</toy> <fromid>4</fromid> <toid>23</toid> <id>17</id> <endsatline>false</endsatline><upstreamport>REJ</upstreamport><downstreamport>IN</downstreamport><segno>0</segno><bends> <bend> <x>584</x> <y> 171</y> </bend>
29+
</bends> </connection>
30+
<connection> <fromx>288</fromx> <fromy>161</fromy> <tox>389</tox> <toy>161</toy> <fromid>48</fromid> <toid>4</toid> <id>33</id> <endsatline>false</endsatline><upstreamport>OUT</upstreamport><downstreamport>IN</downstreamport><segno>0</segno></connection>
31+
<connection> <fromx>243</fromx> <fromy>88</fromy> <tox>242</tox> <toy>129</toy> <fromid>43</fromid> <toid>48</toid> <id>35</id> <endsatline>false</endsatline><downstreamport>SOURCE</downstreamport><segno>0</segno></connection>
32+
<connection> <fromx>437</fromx> <fromy>88</fromy> <tox>437</tox> <toy>129</toy> <fromid>38</fromid> <toid>4</toid> <id>27</id> <endsatline>false</endsatline><downstreamport>TEST</downstreamport><segno>0</segno></connection>
33+
<connection> <fromx>728</fromx> <fromy>68</fromy> <tox>728</tox> <toy>96</toy> <fromid>45</fromid> <toid>30</toid> <id>30</id> <endsatline>false</endsatline><downstreamport>TITLE</downstreamport><segno>0</segno></connection>
34+
<connection> <fromx>481</fromx> <fromy>142</fromy> <tox>686</tox> <toy>142</toy> <fromid>4</fromid> <toid>30</toid> <id>31</id> <endsatline>false</endsatline><upstreamport>ACC</upstreamport><downstreamport>IN</downstreamport><segno>0</segno></connection>
35+
</connections> </net> </drawfbp_file>

0 commit comments

Comments
 (0)