Code M_6_3_01

Komplexe Methoden –  M.6 Dynamische Datenstrukturen –  M.6.3 Daten im Force Directed Layout –  M_6_3_01

Pages


  • 442 - 443

  • 444 - 445

Comments

  • 2011-01-20 @ 10:44 am   |  Comment by thomas koberger

    hallo!

     

    wenn ich den code als applet exportiere und im browser öffne, wird nichts angezeigt und ich  bekomme in der java-console folgende fehlermeldung:

     

    Exception in thread "Animation Thread" java.lang.NullPointerException

    at direct_forced_layout_1_0.setup(direct_forced_layout_1_0.java:119)
    at processing.core.PApplet.handleDraw(Unknown Source)
    at processing.core.PApplet.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:662)

     

    woran kann das liegen?

     

    lg thomas

  • 2011-01-27 @ 11:53 am   |  Comment by Hartmut Bohnacker

    Hallo Thomas,

     

    ein erstes Problem lässt sich beheben, wenn man im Code die Zeile

     

    frame.setResizable(true);

    auskommentiert. Das geht im Applet nicht.

     

    Dann gibt es aber leider ein noch schwieriger zu lösendes Problem. Ein Applet darf nämlich nicht so einfach auf andere URLs zugreifen. Infos dazu gibt es hier:

    http://wiki.processing.org/w/Export_Info_and_Tips#Applet_Security_Restrictions

    Man muss anscheinend das Applet signieren. Ob das dann allerdings alle Probleme löst, weiß ich nicht. Infos zum signieren von Applets hab ich hier gefunden:

    http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html

     

    Gruß,

    Hartmut

  • 2011-06-05 @ 5:53 pm   |  Comment by Mauro

    Hi,

     

    wollte mal fragen ob es möglich ist in dem code verschiedene XML auslesen zu lassen und darzustellen? wenn ich eine neue XML Datei einfüge dann bekomm ich ArrayIndexoutofIndexExepticion 0 >=0.Wisst ihr wie man vorgehen könnte?

     

    grüße mauro

  • 2011-06-10 @ 3:04 pm   |  Comment by Hartmut Bohnacker

    Hallo Mauro, im Prinzip sollte es schon möglich sein, auch andere XMLs mit diesem Code zu verwenden. Allerdings müssen diese XMLs schon irgendwie zu der Logik dieses Sketches passen. Schließlich wird hier nicht nur ein XML ausgelesen, sondern ausgehend von einem Wikipedia-Artikel alle dort verlinkten Artikel ausgelesen, usw.

     

    Du müsstest also auch ein solches "System" von XML-Files haben, oder den Sketch irgendwie umbauen. Das kann aber unter Umständen schon recht kompliziert sein. Und vor allem nicht pauschal zu beschreiben.

  • 2011-11-27 @ 4:54 am   |  Comment by Vlad Atanasiu

    Hello,

     

    Here is a solution concept for using this code as an applet:

     

    1. Write a php code that reads from the Wikipedia API.

    2. Put the code in the same directory as the Processing applet would be.

    3. Change all Wikipedia URL's in M_6_3_01 to point to your php file.

    4. Compile and publish M_6_3_01.

     

    Cheers,
    Vlad

     

  • 2015-08-07 @ 10:34 am   |  Comment by Henk Lamers

    Hi,

    When I run this program I get the following message in my console.

     

    [Fatal Error] :1:1: Premature end of file. 

    Changed line 91, 97, 120 and 143 (in the WikipediaNode class):

    http://

    into:

     

    https://

    Greetings,

    Henk Lamers

Leave a Comment

   (required)

  

Please enable JavaScript to post a comment.

(.zip, max. 1MB)  

Proof that you are human!
Please paste the snippet below in an empty Processing sketch!
What number does the Processing console show?

randomSeed(90763);
println(int(random(100000)));

  (required)