[graphl-cvs] graphl/src/org/mediavirus/graphl GraphlPane.java GraphlApplet.java GraphlApplication.ja
Status: Pre-Alpha
Brought to you by:
flo1
From: Flo L. <fl...@us...> - 2005-12-14 12:44:00
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24265/src/org/mediavirus/graphl Modified Files: GraphlPane.java GraphlApplet.java GraphlApplication.java Log Message: - FEATURE: new command line flag to start "navigator" thread to zoom & pan in the graph - CODE: loading graphs returns URL[] with all loaded (+included) files - CODE: dynamically adding config-file + all included files to default filter - DOC: extended user guide Index: GraphlApplet.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplet.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** GraphlApplet.java 5 Sep 2005 15:51:50 -0000 1.11 --- GraphlApplet.java 14 Dec 2005 12:43:51 -0000 1.12 *************** *** 16,22 **** import java.net.URL; import java.net.URLConnection; - import java.util.ArrayList; import java.util.Iterator; - import java.util.List; import javax.swing.JApplet; --- 16,20 ---- *************** *** 42,46 **** private RDFGraph settingsGraph = new RDFGraph(); /** A List with all configuration nodes in the settings graph */ ! private List configurations = new ArrayList(); public GraphlApplet() { --- 40,44 ---- private RDFGraph settingsGraph = new RDFGraph(); /** A List with all configuration nodes in the settings graph */ ! //private List configurations = new ArrayList(); public GraphlApplet() { *************** *** 145,150 **** } ! catch (MalformedURLException e) { ! e.printStackTrace(); } } --- 143,149 ---- } ! catch (IOException ex) { ! System.err.println("Error reading settings: " + ex.getMessage()); ! ex.printStackTrace(); } } *************** *** 163,167 **** ((RDFGraph)mainPanel.getGraph()).readFromURL(rdfurl); } ! catch (MalformedURLException e) { e.printStackTrace(); } --- 162,167 ---- ((RDFGraph)mainPanel.getGraph()).readFromURL(rdfurl); } ! catch (IOException e) { ! System.err.println("Error loading RDF file: " + e.getMessage()); e.printStackTrace(); } Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** GraphlApplication.java 5 Sep 2005 15:51:50 -0000 1.21 --- GraphlApplication.java 14 Dec 2005 12:43:51 -0000 1.22 *************** *** 103,109 **** SourceFilter filter = new SourceFilter(); // TODO (2) we should model datasources as a class for UI access etc. ! filter.addSource("file:/C:/data/projects/graphl/config/vocabs/foaf-owl.rdf"); ! filter.addSource("file:/C:/data/projects/graphl/config/vocabs/rdf+rdfs.rdf"); ! filter.addSource("file:/C:/data/projects/graphl/config/config.rdf"); filter.addSource(NS.graphl + "SYSTEM"); --- 103,108 ---- SourceFilter filter = new SourceFilter(); // TODO (2) we should model datasources as a class for UI access etc. ! //filter.addSource("file:/C:/data/projects/graphl/config/vocabs/foaf-owl.rdf"); ! //filter.addSource("file:/C:/data/projects/graphl/config/vocabs/rdf+rdfs.rdf"); filter.addSource(NS.graphl + "SYSTEM"); *************** *** 249,254 **** loadURL(currentURL); } ! catch (MalformedURLException e) { ! JOptionPane.showMessageDialog(this, "The specified URL\n" + p.getURLString() + "\nis not valid!", "Invalid URL", JOptionPane.ERROR_MESSAGE); } } --- 248,253 ---- loadURL(currentURL); } ! catch (IOException e) { ! JOptionPane.showMessageDialog(this, "Error reading URL:\n" + e.getMessage(), "Error reading URL", JOptionPane.ERROR_MESSAGE); } } *************** *** 428,432 **** //mainPanel.getGraph().clear(); ! mainPanel.getGraph().readFromFile(file.getAbsolutePath()); //setTitle("Graphl - " + file.getName()); currentFile = file; --- 427,431 ---- //mainPanel.getGraph().clear(); ! mainPanel.getGraph().readFromFile(file); //setTitle("Graphl - " + file.getName()); currentFile = file; *************** *** 443,447 **** * @param url The URL of the RDF file to load. */ ! public void loadURL(URL url) { if (url != null) { mainPanel.getGraphPane().pauseLayouter(); --- 442,446 ---- * @param url The URL of the RDF file to load. */ ! public void loadURL(URL url) throws IOException{ if (url != null) { mainPanel.getGraphPane().pauseLayouter(); *************** *** 460,471 **** public void reload() { if (currentURL != null) { ! mainPanel.getGraph().readFromURL(currentURL); } else if (currentFile != null){ try { ! mainPanel.getGraph().readFromFile(currentFile.getAbsolutePath()); } catch (IOException ioex) { ! System.out.println(ioex.getMessage()); } } --- 459,475 ---- public void reload() { if (currentURL != null) { ! try { ! mainPanel.getGraph().readFromURL(currentURL); ! } ! catch (IOException e) { ! System.err.println("Error reloading URL: " + e.getMessage()); ! } } else if (currentFile != null){ try { ! mainPanel.getGraph().readFromFile(currentFile); } catch (IOException ioex) { ! System.err.println("Error reloading file: " + ioex.getMessage()); } } *************** *** 505,510 **** RDFGraph settingsGraph = (RDFGraph)mainPanel.graphPane.getSourceGraph(); ! settingsGraph.readFromFile(filename); ! JRadioButtonMenuItem defaultItem = null; Node defaultSettings = null; --- 509,524 ---- RDFGraph settingsGraph = (RDFGraph)mainPanel.graphPane.getSourceGraph(); ! Iterator<URL> urls = settingsGraph.readFromFile(new File(filename)); ! ! if (urls.hasNext()) { ! SourceFilter filter = new SourceFilter(); ! while (urls.hasNext()) { ! URL url = urls.next(); ! System.out.println(" filtering: " + url); ! filter.addSource(url.toString()); ! } ! mainPanel.graphPane.getFilteredGraph().addFilter(filter); ! } ! JRadioButtonMenuItem defaultItem = null; Node defaultSettings = null; *************** *** 560,564 **** boolean decorations = true, controls = true, ! menubar = true; String filename = DEFAULT_FILE; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; --- 574,579 ---- boolean decorations = true, controls = true, ! menubar = true, ! navigator = false; String filename = DEFAULT_FILE; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; *************** *** 582,585 **** --- 597,603 ---- if (args[i].equals("menubar=off")) menubar = false; } + else if (args[i].startsWith("navigator=")) { + if (args[i].equals("navigator=on")) navigator = true; + } else if (args[i].startsWith("config=")) { configfile = args[i].substring(7); *************** *** 592,595 **** --- 610,614 ---- } else { + System.out.println(i); usage(true); } *************** *** 617,621 **** } ! //app.startNavigator(); } } --- 636,640 ---- } ! if (navigator) app.startNavigator(); } } *************** *** 688,692 **** if (! node.getProperty(NS.graphl + "public","true").equalsIgnoreCase("false")){ if (first == null) first = node; ! if (node.getProperty(NS.graphl + "active","").equalsIgnoreCase("true")) { if (settings.hasNext()) { node = (Node) settings.next(); --- 707,711 ---- if (! node.getProperty(NS.graphl + "public","true").equalsIgnoreCase("false")){ if (first == null) first = node; ! if (node.getProperty(NS.graphl + "active","false").equalsIgnoreCase("true")) { if (settings.hasNext()) { node = (Node) settings.next(); Index: GraphlPane.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPane.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** GraphlPane.java 7 Sep 2005 12:29:55 -0000 1.21 --- GraphlPane.java 14 Dec 2005 12:43:51 -0000 1.22 *************** *** 442,446 **** if (node.hasType(NS.graphl + "Configuration")) { configurations.add(node); ! node.setProperty(NS.graphl + "active","false"); } } --- 442,446 ---- if (node.hasType(NS.graphl + "Configuration")) { configurations.add(node); ! //node.setProperty(NS.graphl + "active","false"); } } |