swig/SWIG/Examples/GIFPlot/Java
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Harco de Hilster 74c7af45f7 added java support in the GIFPlot example
some minor changes where needed in the interface file


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@331 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-03-05 18:05:55 +00:00
..
cm15 added java support in the GIFPlot example 2000-03-05 18:05:55 +00:00
cmap added java support in the GIFPlot example 2000-03-05 18:05:55 +00:00
gifplot.i added java support in the GIFPlot example 2000-03-05 18:05:55 +00:00
Makefile added java support in the GIFPlot example 2000-03-05 18:05:55 +00:00
ortho.java added java support in the GIFPlot example 2000-03-05 18:05:55 +00:00
README added java support in the GIFPlot example 2000-03-05 18:05:55 +00:00
shadow.java added java support in the GIFPlot example 2000-03-05 18:05:55 +00:00
simple.java added java support in the GIFPlot example 2000-03-05 18:05:55 +00:00

The gifplot example does not work straight out of the box, 
I had to change ../Interface/gifplot.i slightly for java.

a)
The colors (e.g. BLACK) where defined as:

	#define BLACK 0

and the functions expect 'Pixel color' where Pixel is a unsigned char.
#define constants contain no type information and are translated to integer
constants. Because of that, you have to cast every Pixel to a byte in java.

Changing the definition to:
	const Pixel BLACK = 0;
fixes this.

b)
The definitions:

const PixMap *SQUARE = &PixMap_SQUARE;
const PixMap *TRIANGLE = &PixMap_TRIANGLE;
const PixMap *CROSS = &PixMap_CROSS;

don't work.
The wrapper code expects actual variables SQUARE, etc. and they are not
defined in gifplot.h.

c)
In shadow mode the method ColorMap::default() clashes with the reserved name
default.