We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › eclipse question...
Page Index Toggle Pages: 1
eclipse question... (Read 849 times)
eclipse question...
Dec 26th, 2006, 6:51pm
 
Hi: I already read toxi's tutorial on using processing+eclipse. It works fine for me. I can create applets using just one class (extending from PApplet) but what should I do for using 'hue' or 'saturation' in another class outside my first class (the one where I use setup() & draw())???
I think it's something related to the primitive 'color' in PDE, isn't it?
any thought?

thanks !

diex
Re: eclipse question...
Reply #1 - Dec 26th, 2006, 7:55pm
 
I think you only need to import processing.core.* and the class must extend PApplet.
Re: eclipse question...
Reply #2 - Dec 26th, 2006, 8:19pm
 
yes.. that was what I think too. but, I can't use 'hue' or 'saturation' in other subclasses. For example:
I've got my main class "sketch#####.java" that extends from PApplet. I've got another class "Paleta.java" that also extends from PApplet. My third class "simil.java" extends from "Paleta.java" then, here is where I can't use 'hue'.
I get a java.lang.NullPointerException error at that line.

what I'm doing wrong?
thx !

diex


Re: eclipse question...
Reply #3 - Dec 26th, 2006, 8:47pm
 
Mhmm, I've try this
Code:

g.colorMode(HSB);
int cl=g.color(25,25,25);
float h =g.hue(cl);
System.out.println(h);

and I've got an output. But it's 14.166666.
Re: eclipse question...
Reply #4 - Dec 27th, 2006, 12:11am
 
nope.
java.lang.NullPointerException
at processing.core.PApplet.colorMode(PApplet.java:7471)

anyway, what's the point about last.?

thank you !

Page Index Toggle Pages: 1