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 › using eclipse
Page Index Toggle Pages: 1
using eclipse (Read 3028 times)
using eclipse
May 19th, 2005, 2:02am
 
Hello folks,
I have tried to implement my p5 workspace to the eclipse to develop projects here, but searching the archives although I came up with should add two jars[pde.jar, comm.jar] for the projects in eclipse, I couldn't find one of them in the p5 beta. And since comm.jar seems mandatory[BApplet.class] I needed to return using the old libraries of p5 alpha.

Does anyone has any advice on this?
(hope I posted this on the right column)
ilteris
Re: using eclipse
Reply #1 - May 20th, 2005, 12:28pm
 
Hello ilteris.. are you on a mac? have you tried selecting 'show package contents' when right clicking on the processing application? in there you will find the .jar's. However, I've got these and have tried to integrate them into a project in Eclipse but without any joy (doiong it the same way as for the alpha - though I'm sure a few things have changed - eg. I can't even find PApplet).. Perhaps someone could do a quick walkthrough of which files need to go where etc etc..

Also, related but slightly seperate. I need to use BImage and BVideo as part of a larger Java project. (this could be with the Alpha).. I have to integrate it into someone else's code (which takes care of all the stage and framerate etc and is an application - not applet).. I'm running into a lot of problems to do with Processing Alpha being in the default package (cant access it from another package).... Am I just being stupid??
Re: using eclipse
Reply #2 - May 20th, 2005, 8:41pm
 
hello phil,
I am on a windows pc.

did you try toxi's tutorial for p5 alpha?
http://processing.org/discourse/yabb/YaBB.cgi?board=Integrate;action=display;num=1106256315;start=0

also for eclipse IDE users I have another question. When I try to run a basic p5 example snippet of keyPressed it just don't take input from the keyboard although the applet gives me no errors at all.

I have included two .jars I have mentioned at the top in my projects so they are not an issue.

Anyone has encounter something similar before?


Re: using eclipse
Reply #3 - May 22nd, 2005, 11:21pm
 
thanks literis, yeah. I did do the tutorial. this is for the alpha though and a few things have changed. Since writing that post I've figured it out though. for those who havn't (and aren't too familiar with eclipse).. you need to add the processing beta jar's into your project build path (in prefs) - best to get these by downloading the windows expert download (no java - the mac download seemed not to have the core jar when i copied them from the package contents)....  make sure you import processing.core.* ; and then extend PApplet.... the rest is as in toxi's tutorial.

I have another question though. I'm trying to use BImage and BVideo in my java application (NOT applet).. ive extended BApplet in my main class as BImage does not seem to work properly without this but I am not using setup or draw methods as i need to integrate this with some code from a 'proper' java develloper (which I am not) and he has set up the main clas for me... BImage works but BVideo gives me errors.. Does BApplet set something up for BVideo to work when it initialises that I can set up in my application. (I can't run it as a BApplet because of the other clases I'm using -xith3d, odejava etc).. I'm at a bit of a loss.. Help anyone?

java.lang.NullPointerException
     at processing.core.PApplet.registerNoArgs(PApplet.java:564)
     at processing.core.PApplet.registerDispose(PApplet.java:555)
     at processing.video.Capture.<init>(Capture.java:175)
     at P90VideoTest.<init>(P90VideoTest.java:25)
     at P90VideoTest.main(P90VideoTest.java:47)
java.lang.RuntimeException: Could not register dispose + () for processing.video.Capture@5b8520
     at processing.core.PApplet.die(PApplet.java:1773)
     at processing.core.PApplet.die(PApplet.java:1791)
     at processing.core.PApplet.registerNoArgs(PApplet.java:567)
     at processing.core.PApplet.registerDispose(PApplet.java:555)
     at processing.video.Capture.<init>(Capture.java:175)
     at P90VideoTest.<init>(P90VideoTest.java:25)
     at P90VideoTest.main(P90VideoTest.java:47)
Exception in thread "main" java.lang.RuntimeException: Error while setting up Capture
     at processing.core.PApplet.die(PApplet.java:1773)
     at processing.core.PApplet.die(PApplet.java:1791)
     at processing.video.Capture.<init>(Capture.java:198)
     at P90VideoTest.<init>(P90VideoTest.java:25)
     at P90VideoTest.main(P90VideoTest.java:47)
Re: using eclipse
Reply #4 - May 25th, 2005, 8:14pm
 
If you're using BETA v80 and higher, it's PApplet, PImage, PVideo. For ALPHA v68 and under, it will be BApplet, BImage, BVideo.
Code:

import processing.core.*;

public class TestP80 extends PApplet{

public void setup(){
size(800,400);
stroke(155,0,0);
}

public void draw(){
line(mouseX,mouseY,width/2,height/2);
}
}

Be sure that core.jar is added to your external project class. (added by the propertiesMenu of your project). This JAR is in the lib folder of your BETA folder. For ALPHA it would be comm.jar + pde.jar.

My P5 Code remains in a Default Package Folder.
Re: using eclipse
Reply #5 - May 27th, 2005, 2:58pm
 
I think the problem is running the class as an applet. Philworthy wants the class run as an Java application and not as an applet. But since the class extends PApplet, it seems that the class can only be run as an applet. I have the same problem, i.e. I don't want to launch my class not as an applet but a "real" java application. Is that possible? Is there an other class like PApplet, for applications instead of applets?
Re: using eclipse
Reply #6 - Jun 16th, 2005, 1:58am
 
gll wrote on May 25th, 2005, 8:14pm:
My P5 Code remains in a Default Package Folder.


this is not a good idea if you choose to create more packages, as there is no way to explicitly reference the (default package).  i generally put my main class (the only one that extends PApplet) in a package called 'main', then i can access it from other packages with
Code:

import main.*;
Re: using eclipse
Reply #7 - Jul 6th, 2005, 4:32pm
 
I've had this problem too.  Using eclipse none of the keyboard functions seem to work.  The mouse functions do work though.

Anybody any ideas what's going on?
Re: using eclipse
Reply #8 - Jul 13th, 2005, 1:15am
 
haven't had any trouble with key presses myself; this code:
Code:

public void keyPressed () {
if (key=='z') { sg.toggleVisibility(); }
else if (key=='q') { System.exit(0); }
else if (key=='b') { background(0); }
else if ((int)key>=48 && (int)key<=55) { sg.st.setSnap((int)key-48); }
else if ((int)key == 8) { sg.st.setSnap(false); }
}
}


is sitting in my main class, which extends PApplet, and works fine....

haven't tried keyboard or mouse handlers in classes that don't extend PApplet, but it wouldn't surprise me if they don't work in non-PApplet-subclasses...
Page Index Toggle Pages: 1