 |
Author |
Topic: P5 vs Eclipse (Read 30325 times) |
|
toxi_ Guest

|
Re: P5 vs Eclipse
« Reply #15 on: Jan 23rd, 2004, 1:34pm » |
|
michael, if you're going to develop an applet, i think you have structured your classes slightly wrongly, as "Visualisations" should be your main class. and because of that, your problem is that you're not initializing the BApplet correctly. The least thing you should do is to call the init() method in your Visualisations class. so do this instead: Code:Visualizations v = new Visualizations(); v.init(); v.setup(); // optional v.Initialize(); |
| the init() function of BApplet will create a BGraphics instanced necessary for loadFont() used by your "Initialize()" method. hth!
|
|
|
|
michael05
|
Re: P5 vs Eclipse
« Reply #16 on: Jan 23rd, 2004, 4:14pm » |
|
thanks. i never worked with applets in java. now i throwed the visualization methods in the main class. thats not nice but it works fine.
|
°°°°°°°°°°°°°°°°°°°° http://www.m05.de
|
|
|
fabsina

|
Re: P5 vs Eclipse
« Reply #17 on: Apr 5th, 2004, 9:16pm » |
|
hello! this is a greenhorn speking. my problem is simliar to michael's: i want to make classes which gain and control data and others which visualize it. i'm working with eclipse and want to use the processing libraries, especially the BApplet class. Now I'm wondering if i can use two classes extending BApplet and using its functionalities. To give an example: public class Painter extends BApplet { Inputter i; void setup() { i = new Inputter(); } void loop() { background(i.getmX()); } } public class Inputter extends BApplet { public int getmX() { return mouseX; } } This way, it won't return the actual mouseX, but just 0. But neither can I use the loop() method in both classes. So can I work with both classes extending the BApplet, or shall I rather have only one main applet extending BApplet and all other classes (delivering some other data) are written in "real Java"? I hope I could make myself clear. Thank you! Martina
|
|
|
|
amoeba
|
Re: P5 vs Eclipse
« Reply #18 on: Apr 6th, 2004, 12:08am » |
|
You shouldn't really need multiple BApplets. Keep one instance of BApplet and pass it as a parameter to functions that need it. I.e. instead of having a loop with drawing commands in all classes that need to draw, have a loop() in one class only and do something like the following: Code:class foo extends BApplet { ... public void loop() { bar.draw(this); } } class bar { public void draw(BApplet b) { b.ellipse(100,100, 10,10); } } |
| This solves the issue of where (and when) drawing takes place, and also keeps a tidier house.
|
marius watz // amoeba http://processing.unlekker.net/
|
|
|
ASCII33


|
Re: P5 vs Eclipse
« Reply #19 on: Apr 16th, 2004, 3:00am » |
|
on Jan 5th, 2004, 11:16pm, pyson wrote:I had various problems making eclipse work on my Mac os x 10.2.8 (...) |
| Thanks, Toxi, for an exellent "how-to" ! Here is some additional tweeks, to set it up on MacOs X ( 10.3.3 ): As of the "initial" setup, in the "P5 vs Eclipse" post by Toxi: 1) The JavaSDK is already installed ( v1.4.2 ) 3) When adding the Processing Libraries, include the "RXTXcomm.jar" file, as noted by pyson in "Reply #9". ( I made a new folder in my "Processing 0069" directory, called "jar_copies", into wich I copied the three jar files out from the OS X Processing 0069.app "Packcage" ). As of the "Ant" export: 1) Include all three jars again ( pde.jar, comm.jar, RXTXcomm.jar ) 2) The path to the SDK is "/Library/Java" 3) The build.xml file should be copied into your" Eclipse project folder": That is into the Eclipse APPLICATION, not the folder on your harddisk... That was all Jørgen
|
|
|
|
dkor
|
Re: P5 vs Eclipse
« Reply #20 on: Apr 21st, 2004, 12:48am » |
|
Has somebody been successful in building applets with eclipse under linux ? I have been trying to export an applets using eclipse 2.1.2, 3M8 in linux, here is a screen shot: http://xenia.media.mit.edu/~dkor/error.png The error message is : Could not find one or more classes: "org.apache.tools.ant.BuildException". Please check the Ant classpath. it appears in the "Modify attributes and launch Option Panel" under the "Targets" tab. Note that there isn't any targets to be selected the "Targets" tab I followed toxi's instructions but I can't seem to be able to make it work in spite of obsessive impulsive behavior. ANY ADVICE IS WELCOMED ... Daniel.
|
|
|
|
toxi
|
Re: P5 vs Eclipse
« Reply #21 on: May 13th, 2004, 4:42pm » |
|
just for future reference/order: the new version (v0.5) of the ant build script, now also supports byte code obfuscation as described in new this thread
|
http://toxi.co.uk/
|
|
|
Quasimondo

|
Re: P5 vs Eclipse
« Reply #22 on: May 16th, 2004, 1:00pm » |
|
Excellent Tutorial toxi - got everything running smoothly now. Thank you! Just a note to those who get a Quote: [javac] BUILD FAILED: file:C:/eclipse/workspace/HelloP5/build.xml:38: Error running javac.exe compiler |
| error. This is caused by a wrong JAVA_HOME setting in line 20 of build.xml You will have to set that to the correct folder on your harddrive. For example on my machine it's: Code: <property name="JAVA_HOME" location="C:\j2sdk1.4.2_04"/> |
|
|
Mario Klingemann | Quasimondo | Incubator | côdeazur
|
|
|
mKoser

|
Re: P5 vs Eclipse
« Reply #23 on: May 19th, 2004, 3:10pm » |
|
Mario, i really thought you had spotted the error which is keeping me from using Eclipse with Processing ... but no, i've changed the JAVA_HOME to my local java-folder, and i still get: Quote: Buildfile: C:\eclipse\workspace\HelloP5\build.xml init: [delete] Deleting directory C:\eclipse\workspace\HelloP5\build [mkdir] Created dir: C:\eclipse\workspace\HelloP5\build compile: [javac] Compiling 2 source files to C:\eclipse\workspace\HelloP5\build [javac] BUILD FAILED: file:C:/eclipse/workspace/HelloP5/build.xml:40: Error running javac.exe compiler Total time: 211 milliseconds |
| i have now tried reinstalling eclipse 4 times (sice new years), and gone through Toxi's tutorial every time reading everything... and I am still not able to get it working! I really need this, since I am building a large project at the moment, and the my code is starting to become very difficult to work with in the processing IDE... I've tried fiddling with the setting in line[40] of the build.xml file, hoping that maybe it was because i needed to change a minor thing in the javac call ... but then again, it seems as if it can't even find my javac.exe! (i've also tried manually adding the /bin/ folder of my java-instalation to the Ant JAR's, but no luck!) Does anyone have a clue of what i should look for? thanks, + mikkel
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
arielm
|
Re: P5 vs Eclipse
« Reply #24 on: May 19th, 2004, 5:18pm » |
|
mikkel, i've been using eclipse with processing for a while without using any ant build script. the only thing you have to do is to create a new java project (that will hold as many sketches as you want) and copy inside bagel.jar... how to make your own bagel.jar? 1) take a .jar file exported-to-web by processing 2) rename it to .zip 3) remove from it any class that looks like a scketch, leaving only the core processing classes (BApplet, BGraphics, etc...) 4) rename it to .jar then, inside your new eclipse java project, create a new class that extends BApplet and you're ready to go... note: when you first-time execute-as-an-applet inside eclipse, the size of the applet is 200x200 by default... it's possible to correct it (then it's automatically remembered) using the "run..." menu finally, when you want to post your stuff to the web, be sure to recook a .jar file that will include both the processing core classes and your sketch's ones... ah, one last thing: be sure that your java project is "compiling for 1.1" (for applets to work well with microsoft vm): - right click your project - go to "properties" - then "java compiler" - check "use project settings" - then "compliance and classfiles" - check that "compiler compliance level" is on 1.3 and not on 1.4 (on that very same panel: you have 4 checkboxes under "classfile generation", you can uncheck them all if you want your classes to be much tinier, but then you loose precious information that can be useful when debugging, i.e. error line numbers... one good alternative would be to use proguard standalone to shrink your final .jar file before posting it to the web but that's another story...) hth
|
Ariel Malka | www.chronotext.org
|
|
|
Quasimondo

|
Re: P5 vs Eclipse
« Reply #25 on: May 19th, 2004, 7:47pm » |
|
mikkel, this morning I had this strange effect that I received the "javac error" again. Somehow it looked like Java or Windows had forgotten the standard path to the compiler again. Fortunately after rebooting it worked just fine again. So I assume there is some problem with the path to javac on your system though I'm not expert enough to tell you where to look.
|
Mario Klingemann | Quasimondo | Incubator | côdeazur
|
|
|
Quasimondo

|
Re: P5 vs Eclipse
« Reply #26 on: May 19th, 2004, 7:50pm » |
|
Just a minute - did you add the path to javac to the PATH variable in your Windows System settings already?
|
Mario Klingemann | Quasimondo | Incubator | côdeazur
|
|
|
mKoser

|
Re: P5 vs Eclipse
« Reply #27 on: May 19th, 2004, 8:32pm » |
|
well... i went to DOS and found this: Code: C:\>echo %CLASSPATH% "C:\Program Files\Java\j2re1.4.2_04\lib\ext\QTJava.zip" |
| My classpath seems to be stripped bare of anything BUT the QTJava stuff ... would it make sense to add the the path to my Javac-file?... and how would I do this (I couldn't find it in any of the windows-start-up settings (by opening up 'msconfig'). ( I am in deep water here, i have no clue of what to do with the CLASSPATH variable! ) ?
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
toxi_ Guest

|
Re: P5 vs Eclipse
« Reply #28 on: May 19th, 2004, 8:37pm » |
|
mikkel, CLASSPATH is an environment variable. you can edit it by opening the "system" control panel from the start menu. then select the "advanced" tab and then "environment variables". then check if there's a CLASSPATH defined for your user, if so edit this one, else edit the system's one to your liking also, let's have a look at your eclipse prob at our next meeting *hinthint*
|
|
|
|
Quasimondo

|
Re: P5 vs Eclipse
« Reply #29 on: May 19th, 2004, 9:01pm » |
|
AFAIK - you will have to add the path to javac to your PATH variable, not to the CLASSPATH. The executable javac.exe simply has to be found by windows from wherever you call it - that's what PATH is for. CLASSPATH is the environment variable that is used by java itself to find the libraries that it uses for compilation
|
Mario Klingemann | Quasimondo | Incubator | côdeazur
|
|
|
|