AlejandraV25 / proclipsing

Automatically exported from code.google.com/p/proclipsing
0 stars 0 forks source link

Not recognize processing methods in new class #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create new project on elipse
2. Write my code in MyProyect.java
3. Create new file to write a new class from new>class

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Eclipse Galileo 3.5.1
Processing 1.0.5
Proclipsing 1.0.4

Please provide any additional information below.
It's a simple question but i dont know how can i get the eclipse recognize
new processing class.

Thanks 

Original issue reported on code.google.com by fran.cla...@gmail.com on 4 Mar 2010 at 6:31

GoogleCodeExporter commented 9 years ago
The answer is extends on the other class. Easy!

Original comment by fran.cla...@gmail.com on 8 Mar 2010 at 11:07

GoogleCodeExporter commented 9 years ago
The additional class file should look something like this:

// make sure it knows about Processing
import processing.core.PApplet;

// you don't actually extend anything, instead you will hand it a reference to 
your PApplet
public class MyClass{

// this is the PApplet this class will be drawn on
PApplet parent; 

// in the constructor you indicate which applet it will interact with
public MyClass(PApplet p){
     parent = p;
}

A more fleshed out example is available at the end of the tutorial: 
http://processing.org/learning/eclipse/

Original comment by Chris.Lonnen on 31 May 2010 at 2:00

GoogleCodeExporter commented 9 years ago
Oh, and whenever you want to call a Processing method from the new class, you 
have to call it as a method of 
the parent applet. For example, instead of:

line(30, 20, 85, 75); 

you would use:

parent.line(30, 20, 85, 75);

Original comment by Chris.Lonnen on 31 May 2010 at 5:25

GoogleCodeExporter commented 9 years ago
Thanks Chris, i'll check it out. 

Original comment by fran.cla...@gmail.com on 1 Jun 2010 at 6:56

GoogleCodeExporter commented 9 years ago
Thanks for helping out with this and thanks for posting the link to the 
processing Eclipse page, Chris.  We plan on getting documentation about this up 
soon.

Original comment by maddpar...@gmail.com on 6 Oct 2010 at 3:12