Bug 1373 : Does not accept a color declaration
Last modified: 2009-11-22 09:40




Status:
RESOLVED
Resolution:
WONTFIX -
Priority:
P2
Severity:
normal

 

Reporter:
Sverker Almehed
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-11-20 09:20
Hello. I get a funny error when I try an old program in the latest versions of
processing. I have tried it both on Vista and Linux with the same result. It works on
processing-0135 where it was developed.

The code locks like :

import processing.opengl.*;
int w = 300;
int h = 300;
float Xmag = 0.;
float Ymag = 0.;
xyz x0 = new xyz (w/2,h/2,0);
xyz n0 = new xyz (0., -1., 0.1);
int inst = 0;
color mc = color (200, 10, 10);
Moebius band = new Moebius (100., 10., mc);
...

When java reaches the last line it stops with the error :
The constructor Moebius(float, float, int) is undefined

The Moebius class has the constructor :

class Moebius {
Moebius (float r1, float r2, color c) {
m_np = 200;
...

As far as I can see you havn't changed the color class.
Additional Comment #1 From fry 2009-11-22 09:40
I cannot debug from that segment of code, but to fix it, just move around
how you're handling the declarations, definitions, and assignments. Assign
the color and create the class inside of setup() instead of as part of the
declaration.