import processing.xml.*; import geomerative.*; NewsParser newsParser; PShape globe; RShape grp; PFont font; ArrayList countries; HashMap hm; String[] keys; int theMax; boolean ignoringStyles = false; void setup() { size(940,477); smooth(); //noLoop(); // VERY IMPORTANT: Allways initialize the library before using it RG.init(this); RG.ignoreStyles(ignoringStyles); RG.setPolygonizer(RG.ADAPTATIVE); grp = RG.loadShape("BlankMap-World6-Equirectangular2.svg"); newsParser = new NewsParser(); String[] newsSources = { "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml", "http://rss.cnn.com/rss/cnn_topstories.rss", "http://rss.news.yahoo.com/rss/mostemailed", "http://rss.news.yahoo.com/rss/world", "http://rss.news.yahoo.com/rss/mostviewed", "http://rss.news.yahoo.com/rss/highestrated", "http://hosted.ap.org/lineups/TOPHEADS-rss_2.0.xml?SITE=NCKIN&SECTION=HOME", "http://feeds.reuters.com/reuters/topNews", "http://english.aljazeera.net/Services/Rss/?PostingId=2007731105943979989","http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml", "http://www.npr.org/rss/rss.php?id=1001","http://feeds.guardian.co.uk/theguardian/rss", }; //not working "http://www.allheadlinenews.com/rss/world.xml" "http://www.iht.com/rss/frontpage.xml" //"http://rss.xinhuanet.com/rss/english.xml" "http://www.csmonitor.com/rss/top.rss" google hm = newsParser.parseNews(newsSources); countries = new ArrayList(); int[] theValues = new int[hm.size()]; Iterator it = hm.values().iterator(); int cnt = 0; while (it.hasNext()) { Countries c = (Countries) it.next(); countries.add(grp.getChild(c.getName())); //println(cnt + " " + c.getName() + " " + c.getValue()); theValues[cnt]=c.getValue(); cnt++; } theMax = max(theValues); font = loadFont("HelveticaNeue-UltraLight-32.vlw"); //grp.centerIn(g, 100, 1, 1); } void draw() { //translate(width/2, height/2); background(180,163,120); //globe.disableStyle(); //fill(245,150); //stroke(200); strokeWeight(0.1); //shape(globe, 0,0,width,height); // Draw at coordinate (10, 10) at size 100 x 100 RShape p; RPoint pt = new RPoint(mouseX, mouseY); for (int i=0; i