but I just realized that the OP was moved to Exhibition, so I thought I would re-post my question here. It is in reference to the JAXB tutorial on the wiki:
I want to use JAXB for a data viz I'm working on, but having some difficulty getting the example working with my xml file, which I think may have to do with the way it's structured. The xml is a representation of a person's network of contacts (my contacts, my contacts' contacts, and so on), so it looks like this:
I took the example from the Wiki and adapted MyURL.java to create a class for Level and Name. In AppConfig.java, I map the level elements to an ArrayList of type Level:
Then in the Level class I create a var for the id attribute, and map the name elements to an ArrayList of type Name:
@XmlAttribute(name="id")
int levelVal;
@XmlElement(name="name")
List<Name> names = new ArrayList<Name>();
In draw() I have a for loop:
for(Level l : config.levels ) {
println( l.levelVal );
for( Name n : l.names ) {
println( n.name );
}
}
but it only prints the first level (0) and name (Brooke). I'm trying to understand whether this could be due to the recursive structure of the xml and/or the way I've nested the Name class inside the Level class, or if I'm just misunderstanding the way the AppConfig class works? As always, greatly appreciate any tips or suggestions, thanks!
Hi, I developed a project in Eclipse and used EclipseP5Exporter to generate the .jar and html files. The first time I open the .html file, the applet appears and everything works fine. But thereafter, if I refresh the page, or close the window/tab and try to open the file again, the canvas area displays blank. When I quit and relaunch the browser, same thing happens - works first time, then nothing. This happens both locally and with the files I uploaded to my site, which is here:
Hi, I've done a bit of Processing in Eclipse, but I'm running into a problem I haven't encountered before. I can run the sketch as an Applet, but when I run as Java Application, I get the following error:
Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: DataVizMain
at processing.core.PApplet.main(PApplet.java:7254)
at arc_segments.DataVizMain.main(DataVizMain.java:16)
Caused by: java.lang.ClassNotFoundException: DataVizMain
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at processing.core.PApplet.main(PApplet.java:7251)
... 1 more
Everything was working as both Applet and Application until I made a new version of the project by copying and pasting it in the Package Explorer. After I did this, both versions started giving the above error. After deleting the newer version, I'm STILL getting the error. The project directory structure is as follows:
Given when this error started appearing (right after I copied the project), I assume it is something really basic that has to do with the Eclipse project directory structure, but I'm just not familiar enough with it to understand what I did wrong. Any help much appreciated, thanks.
Hi, I'm working on a data visualization for a sort of Facebook chain letter. The first person sends to ten of their friends, who are asked to send to ten of their friends, so on and so forth. The visualization is supposed to show who passes the request along, and to how many of their friends.
I'm displaying the initial ten recipients as arc segments of different colors that make up a circle in the middle of the screen. For each of the initial ten, I want to display smaller child arcs branching off, but so far I've only been able to draw two levels:
I created an ArcSegment class that has it's own array of AcrSegment children, but I'm only able to access the children (not children-of-children, etc.) when I call the drawSegment method. Can anyone give me any pointers on how I would loop recursively all the way down to the bottom of each child array to call the drawSegment method on every child? Here's the code, thanks for any help:
ArcSegment[] baseSegments = new ArcSegment[10];
int x, y; // arc origin
void setup() {
size(800, 800);
colorMode(HSB);
x = width/2;
y = height/2;
int w = 200;
int h = 200;
int start = 0;
int stop = 36;
int colorHue = 0;
int colorSat = 255;
for( int i = 0; i < baseSegments.length; i++) {
int kidNum = (int) random(1, 10);
baseSegments[i] = new ArcSegment(x, y, w, h, start, stop, colorHue, colorSat, kidNum, 0);
start += 36;
stop += 36;
colorHue += 26;
}
}