Version 7 (modified by 12 years ago) (diff) | ,
---|
Compiling Renew Source
(for version 2.4)
The steps required to compile Renew are listed below. For your convenience we provide a script that will do the required steps for you (see the following subsection).
- get the source from http://www.renew.de
- get the prerequisites (ant, javacc, jalopy, junit,... / consult README in folder src for more information)
- setup environment (ant properties in src/ant/local.properties)
- compile renew (by calling ant)
- prepare eclipse project settings (optional)
Environment setup:
prepare-sources.zip Archive contains:
- eclipse project setting files (.classpath and .project)
- bash script (for your convenience) that will everything for you, which is:
- download Renew sources and prerequisites,
- set-up the environment,
- compile Renew and
- prepare the eclipse project
Please consult the bash script for details and/or adapt for your own purposes.
The script, which requires wget to be installed, has been tested on Linux and OS X. It should work without problem on win/cygwin (http://www.cygwin.com).
Netcomponents
Creating a New Netcomponent Repository
Netcomponent Repositories can be integrated in two different ways: in a simple way and in an elaborated way as plugin for Renew.
Simple NC Repository
see also Chapter 2.7.6 of the Renew User Guide
A folder that contains at least one Renew net drawing (.rnw file), a file called .sequence and subfolder called images, which again contains at least one image called generic.gif, suffices as a NC Repository. It can be directly used in Renew by using the command Tools > Netcomponents > select from directory. A NC repository will be available as a tool palette in Renew. By using the available tools from the palette the net associated with the tool will be included in your drawing.
Exmple Folder Structure
Here is a minimalistic folder structure for an NC repository.
tools/ ├── .sequence ├── example-nc.rnw └── images └── generic.gif
Details
- In order to fit nicely into the GUI all images should be of the size 24x24 in pixels.
- The net component example-nc (defined by the net drawing example-nc.rnw) will appear in the tool tip as NC example-nc.
- If an image in images with the name example-nc.gif exists the image will be used in as tool button icon or generic.gif instead.
- The file .sequence allows to sort the tool buttons in a predefined order. Add the names of the drawing (without .rnw) to the file, only one name per line. All non-mentioned NCs will be added to the end of the palette.
- The NC will be added to the drawing at the location of the mouse click, i.e. coordinates x=0, y=o (upper left corner) of the NC will be on mouse position. You might have to adjust the location of the figures in the NC drawing to achieve a comfortable behavior.
NC Plugin
In order to create a plugin that provides a NC repository you have to provide a repository directory - in the fashion described above - and a plugin configuration file (plugin.cfg).
There are several nice and interesting things about repository plugins:
- Since they do not need any Java code, they can be built without any compilation.
- Just drop a folder containing the plugin.cfg and a tools directory into the plugins folder of Renew
- It will be loaded on the next start or on the fly with the command load (e.g. load *).
- Components in the tools directory can be adjusted on the fly; just unload the palette and reload the modified version.
Example plugin.cfg
mainClass = de.renew.netcomponents.PalettePlugin name = Example Components provides = de.renew.custom.example-components requires = de.renew.util,de.renew.simulator,ch.ifa.draw,de.renew.formalism,de.renew.misc,de.renew.gui,de.renew.nc de.renew.nc.dir-prop-name=de.renew.custom.example-components.dir de.renew.nc.init-prop-name=de.renew.custom.example-components.init de.renew.custom.example-components.dir = tools de.renew.custom.example-components.init = false version = 0.1 versionDate = 7 June 2013 versionText = An example repository
Exmple Folder Structure
example-plugin ├── plugin.cfg └── tools ├── .sequence ├── example-nc.rnw └── images ├── example-nc.gif └── generic.gif
Example
Here is an example for your convenience: example-plugin.zip
Icon Image Creation with Renew
In order to easily, and quickly generate images for the NCs you can use Renew and ImageMagick.
- Draw your icon (use/modify your NC) and export the result as png (Ctrl-0 [zero]).
- Convert with convert (ImageMagick): convert -geometry 24x24 net.png net.gif
Grouping / Netcomponent Figure
The Netcomponent plugin also provides the possibility to group figures that belong together. This grouping is flat (no hierarchical grouping) and weak (single elements are still selectable and manipulatable). Netcomponents may or may not be grouped by a Netcomponent figure and week and flat grouping can also be used in any net.
Advanced Features
The Netcomponent Plugin also allows to integrate custom tools (tool buttons) into a components palette, e.g. customized arcs.
However, for this you need to provide a custom facade class that implements the ComponentsPluginExtender
.
Attachments (2)
-
example-plugin.zip (4.2 KB) - added by 12 years ago.
Example folder structure for a NC repository.
-
prepare-sources.zip (2.0 KB) - added by 10 years ago.
2.4.2 version of script to compile Renew from sources
Download all attachments as: .zip