The following items are included:
dingo-java.jar containing com.indigo.Dingo wrapper classlib directory containing binaries for all supported platforms:
lib/Linux/x86/libdingojni.so — 32-bit Linux binarylib/Linux/x64/libdingojni.so — 64-bit Linux binarylib/Mac/10.5/libdingojni.dylib — universal Mac OS X 10.5 binary (32-bit, 64-bit, 64-bit PPC)lib/Mac/10.6/libdingojni.dylib — universal Mac OS X 10.6 binary (32-bit, 64-bit, 64-bit PPC)lib/Win/x86/dingojni.dll — 32-bit Windows mediator binarylib/Win/x86/dingo.dll — 32-bit Windows core binarylib/Win/x64/dingojni.dll — 64-bit Windows mediator binarylib/Win/x64/dingo.dll — 64-bit Windows core binaryThird-party open-source libraries:
lib/Win/{x86,x64}/libcairo-2.dll (LGPL 2.1, MPL 1.1)lib/Win/{x86,x64}/libpng12-0.dll (as is)lib/Win/{x86,x64}/zlib1.dll (as is)Depending on the OS and architecture, proper binaries are loaded automatically.
Dingo class object represents a library instance. All operations are represented by methods of this object.
Several library instances may be created within one thread to act simultaneously and independently. However,
each instance requires a certain amount of memory, and thus it is recommended to have as few instances as
possible.
The procedure for rendering workflow is the following:
setOutputFormat().setBondLength() method.render().getResult().Dingo (String path);
Receives the path to Win, Linux, and Mac directories containing binary modules (see
distribution section above for details). E.g., if the libraries are stored in
lib/Win/, lib/Linux, and lib/Mac directories, call new Dingo(“lib”). You can specify absolute paths as
well.
Dingo ();
Same as Dingo(“lib”).
Instances are independent and are safe to be used in parallel.
void setLogPath (String path);
Sets the path to the log file. If not set, no logging is done.
See also load-highlighting option in option reference.
void loadMoleculeFromFile (String filename);
void loadMolecule (String str);
void loadMolecule (byte[] buf);
void loadReactionFromFile (string filename);
void loadReaction (byte[] buf);
void loadReaction (String buf);
Loads the molecule or reaction from file, string, or buffer.
bool moleculeIsEmpty ();
bool reactionIsEmpty ();
Checks whether the loaded molecule or reaction structural formula is empty.
void setOutputFormat (String format)
Sets the output format to png, svg or pdf for rendering or mol or rxn for molecule and reaction
layout respectively. No default value. Case-insensitive.
void setOutputFile (String filename)
Sets the output file. If not set, rendering is performed to internal buffer, which you can later obtain with
getResult().
void setImageSize (int width, int height);
Sets the desired image size in pixels. If no size is given, the picture is adjusted automatically according to the specified bond length and margins:
void setBondLength (float length);
Sets the average bond length in pixels. If the size is not set, this determines the size of the resulting image; otherwise it is ignored. The default value is 100 pixels.
See also margin-factor setting in option reference.
The concept of options in Dingo is to make the interface more flexible. Examples of options are relative-
thickness, implicit-hydrogen-mode, background-color, etc (names are case-insensitive). image-size,
bond-length, output-format, output-file options duplicate the setImageSize, setBondLength,
setOutputFormat, and setOutputFile calls, respectively. See Option reference
for the complete list of options.
Use an appropriate method depending on the type of the option.
void setOption (String name, String value)
void setOption (String name, boolean value)
void setOption (String name, float value)
void setOption (String name, float r, float g, float b)
void setOption (String name, int w, int h)
One can use the first method for to set options of any kind, e.g. setOption(“base-color”, “0.0,0.0,1.0”)
instead of setOption(“base-color”, 0.0f, 0.0f, 1.0f).
The components of the value are comma-separated, and C-style formatting is used for floats, i.e. decimal point is a period, not a comma.
void setOptions (String options)
It is also possible to set multiple options at once, e.g. setOptions(“implicit-hydrogen-mode=none;
coloring=1; aam-color=0.2,0.5,0.3”). The options within the string should be separated by a semicolon.
Equality sign may be surrounded by spaces, too.
void render ();
void layout ();
Perform layout and store the result as a MOLFile or RXNFile. Proper format should be set using setOutputFormat().
byte[] getResult ();
Dingo dingo = new Dingo();
dingo.setOutputFormat("png");
dingo.setOutputFile("test.png");
dingo.setBondLength(50);
dingo.setOption("base-color", 0.0f, 0.5f, 0.2f);
dingo.loadMolFromString("C1=CC=NC=C1");
dingo.render();
The shorter version of the above would be the following:
Dingo dingo = new Dingo();
dingo.setOptions("output-format=png; output-file=test.png; bond-length=50; base-color=0,0.5,0.2");
dingo.loadMolFromString("C1=CC=NC=C1");
dingo.render();