[graphl-cvs] graphl/src/org/mediavirus/graphl/graph/rdf RDFGraph.java
Status: Pre-Alpha
Brought to you by:
flo1
From: Flo L. <fl...@us...> - 2004-10-27 10:55:51
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18264/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFGraph.java Log Message: - FEATURE: finally implemented sortgedNodeLayouter with proportional layout - AbstractFacet.assignedElements is now a list, to be able to sort it - BUG: block graph update events during loading - FEATURE: nodes are placed at deterministic locations initially (loading the same file twice will result in the same layout) - FEATURE: minor performance enhancements for repulsionnodelayouter - renamed "controls" command line option to "toolbar" Index: RDFGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFGraph.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RDFGraph.java 19 Oct 2004 16:16:59 -0000 1.5 --- RDFGraph.java 27 Oct 2004 10:55:41 -0000 1.6 *************** *** 41,45 **** URL baseURL = null; ! public RDFNode getNodeById(String id){ return (RDFNode)allNodes.get(id); --- 41,49 ---- URL baseURL = null; ! ! private int loadCount = 0; ! ! private float loadAlpha = 0.1f; ! public RDFNode getNodeById(String id){ return (RDFNode)allNodes.get(id); *************** *** 78,112 **** } catch (MalformedURLException e) {} - RDFParser parser = new RDFParser(); InputSource input = new InputSource(new FileReader(filename)); input.setSystemId(""); ! try { ! parser.parse(input,this); ! } ! catch (SAXException se) { ! se.printStackTrace(); ! } ! ! resetDirty(); } public void readFromURL(URL url){ baseURL = url; - RDFParser parser = new RDFParser(); InputSource input; try { input = new InputSource(url.openConnection().getInputStream()); input.setSystemId(url.toString()); ! ! parser.parse(input,this); } catch (IOException e) { e.printStackTrace(); } ! catch (SAXException se) { ! se.printStackTrace(); ! } ! resetDirty(); } --- 82,115 ---- } catch (MalformedURLException e) {} InputSource input = new InputSource(new FileReader(filename)); input.setSystemId(""); ! readGraph(input); } public void readFromURL(URL url){ baseURL = url; InputSource input; try { input = new InputSource(url.openConnection().getInputStream()); input.setSystemId(url.toString()); ! readGraph(input); } catch (IOException e) { e.printStackTrace(); } ! } ! ! public void readGraph(InputSource input) { ! RDFParser parser = new RDFParser(); ! loading = true; ! try { ! parser.parse(input,this); ! } ! catch (Exception e) { ! e.printStackTrace(); ! } ! loading = false; resetDirty(); + fireGraphContentsChanged(); } *************** *** 173,177 **** if (node == null){ node = new RDFNode(this, uri); ! node.setCenter(400*Math.random()-200,400*Math.random()-200); addElements(Collections.singleton(node), null); if (DEBUG) System.out.println("created node " + uri); --- 176,184 ---- if (node == null){ node = new RDFNode(this, uri); ! float r = 20 + loadCount; ! loadAlpha += 30/r; ! node.setCenter(r*Math.sin(loadAlpha), r*Math.cos(loadAlpha)); ! loadCount++; ! //node.setCenter(400*Math.random()-200,400*Math.random()-200); addElements(Collections.singleton(node), null); if (DEBUG) System.out.println("created node " + uri); *************** *** 293,296 **** --- 300,304 ---- allNodes.clear(); super.clear(); + loadCount = 0; } |