When runing an exported applet / jar from the command line using
java -jar QubulusMaps.jar
it works just fine. This jar has all the dependencies merged into it and is the default export option.
However when choosing the option "Force 'Multiple-Jars' (for custom OpenGL renderers)" I get the following results.
C:\users\martin\workspace\QubulusMaps\applet>java -jar QubulusMaps.jar
Exception in thread "main" java.lang.NoClassDefFoundError: processing/core/PAppl
et
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Caused by: java.lang.ClassNotFoundException: processing.core.PApplet
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 12 more
Could not find the main class: qubulusmaps.QubulusMaps. Program will exit.
C:\users\martin\workspace\QubulusMaps\applet>java -cp .\core.jar;. QubulusMaps
Exception in thread "main" java.lang.NoClassDefFoundError: QubulusMaps
Caused by: java.lang.ClassNotFoundException: QubulusMaps
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: QubulusMaps. Program will exit.
Could anyone tell me how to make the multi jar scenario run so it finds both PApplet and my main class?
Looking the the controlP5 homepage the image shows a horizontal layout. But the example code arranges them vertically. I can't figure out how to arrange them horizontally. Thanks.
Current status: Everything builds and runs now but I am experiencing other problems.
1. Can not start GStreamer factories
No such Gstreamer factory: xvidenc
No such Gstreamer factory: x264enc
No such Gstreamer factory: schroenc
No such Gstreamer factory: jp2kenc
Why is this? Are the codecs in some library that I am still missing?
2. MJPEG is the only one working on very short movies
I can only use MJPEG output without erros. However if I record more than 20+ seconds I can not play the video. The file grows to the correct size but I can't view it. Can I post it somewhere for you to have a look at it? My guess is that the container does not agree with MJPEG?
3. THEORA files are 0 bytes (less important but maybe a bug?)
When using THEORA the file is never larger than 4 bytes.
public void loadCSV(String csvfile) { csvreader = new CSVReader(this.parent, csvfile); //CSVReader is Table class http://benfry.com/writing/archives/3
createPoints(); }
private void createPoints() { im = parent.createImage(layerWidth, layerHeight, PConstants.ARGB);
xy = new float[csvreader.getRowCount()-1][];
for(int i=1;i<csvreader.getRowCount();i++){
//Get long and lat and convert to floats. float lon = Float.parseFloat(csvreader.data[i][1])*0.000001f; //Parse and shift string float lat = Float.parseFloat(csvreader.data[i][2])*0.000001f;
//Convert to screen coords xy[i-1] = map.getScreenPositionFromLocation(new Location(lat, lon)); //Unfoldingmaps
}
drawDots();
}
In my first attempt I draw directly on the PImage. Then I tint(gray, alpha) the PImage which gives me ability to fade the dots in and out.
// public void drawDots() // { // //Add dots to image // // for(int i=1;i<csvreader.getRowCount();i++){ // im.set((int)xy[i-1][0], (int)xy[i-1][1], ((PApplet)parent).color(r,g,b)); //Only a small pixel dot. // } // } // // public void draw() { // pg.background(255,0); // // pg.beginDraw(); // pg.tint(255,a); //Working fine // pg.image(im,0,0); // pg.endDraw(); // parent.image(pg,0,0); //Give pg to parent // }
However I want to be able to draw ellipses instead of just pixels so I made a new version where I draw to pg.ellipses
public void drawDots() { int a = 255; int r = 256; int g = 0; int b = 0;
pg.tint(255,a); //Not working pg.popMatrix(); pg.endDraw(); }
public void draw() { parent.image(pg,0,0); //Give pg to parent }
Now I get nice ellipses but tint(gray,alpha) does not work anymore. It seems like it only affects PImages with ARGB format.
So my questions are
Is there anyway for me to merge the two above? I have tried for a few days now but I can't get it right. Goal is to have a dot layer with transparency
I am wasting time mocking around with JAVA2D and P2/3D in terms of transparency and layers. They support different sets functionality and also are pretty bad in terms of performance. What approach would you recommend for a layered application where each layer should be able to be blended in and out and hold either PNG images or arbitrary graphics like dots?
I would rather use OpenGL for my layers. Though I do read some GL I am not yet fluent. Doea anyone know of any OpenGL example that handles transparency, images and graphics like ellipses, lines, text which I can use for reference?
Hi
I am trying to use Control P5 with a simple exampel I found at openprocessing. However I am not able to draw lines anymore if I choose to initiate ControlP5. If I comment out the ControlP5 everything works.
My guess is that controlP5 overdraws the canvas but I can't figure out how to synch them right.
main program - here controlSetup() is commented out and it is possible to draw on canvas. Try to commenting it in and the canvas becomes undrawable.
import controlP5.*;
// Globals ControlP5 controlP5; ProceduralScribbler ps; public float rseed = 0.4; // seed value public float brushdist = 40.0; // brush distance sensitivity
// Canvas int backgroundColor = 255; int strokeColor = 50;
void keyPressed(){ if (key == ' ') { ps.reset(); } if (key == 'm') { //controlP5.draw(); } }
scribble class
class ProceduralScribbler { ArrayList history = new ArrayList();
int activeScribble = 0; public ProceduralScribbler(){}
public ProceduralScribbler(int activeScribble) { activeScribble = activeScribble; }
public void update(int mouse_x, int mouse_y) { switch(activeScribble) { case 0: // Sketchy { PVector d = new PVector(mouse_x,mouse_y,0); history.add(0,d);
for (int p=0; p<history.size(); p++){ PVector v = (PVector) history.get(p); float joinchance = p/history.size() + d.dist(v)/brushdist; if (joinchance < random(rseed)) { line(d.x,d.y,v.x,v.y); } } } break; default: break; } }
public void reset() { background(255); history.clear(); } }
control code
// UI Group Position offsets public int groupxoffset = 0; public int groupyoffset = 10; public int groupwidth = 200; public int groupheigth = 80;
// Menu element offsets public int worldoffset = 10; public int xoffset = 10; public int yoffset = 15;
void controlSetup() {
controlP5 = new ControlP5(this); //controlP5.setAutoDraw(false); //controlP5.setMoveable(false);
// Group menu items ControlGroup ui = controlP5.addGroup("Settings", groupxoffset, groupyoffset, groupwidth); ui.setBackgroundColor(color(0, 200)); ui.setBackgroundHeight(groupheigth); ui.mousePressed(); // Menu is hidden by default