graphl-cvs Mailing List for Graphl - Hybrid graph visualization tool (Page 5)
Status: Pre-Alpha
Brought to you by:
flo1
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(48) |
Sep
(6) |
Oct
(64) |
Nov
(12) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(10) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(34) |
Sep
(31) |
Oct
|
Nov
|
Dec
(25) |
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(43) |
Jul
(16) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Flo L. <fl...@us...> - 2005-09-05 15:52:13
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15947/src/org/mediavirus/graphl Modified Files: GraphlApplet.java GraphlApplication.java Log Message: updated save machanism to new multi-souurce paradigm Index: GraphlApplet.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplet.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GraphlApplet.java 17 Aug 2005 15:52:51 -0000 1.10 --- GraphlApplet.java 5 Sep 2005 15:51:50 -0000 1.11 *************** *** 127,133 **** URL settingsurl = new URL(getDocumentBase(), urlstr); settingsGraph.clear(); ! settingsGraph.readFromURL(settingsurl); - mainPanel.graphPane.setConfigurationGraph(settingsGraph); Node defaultSettings = null; --- 127,132 ---- URL settingsurl = new URL(getDocumentBase(), urlstr); settingsGraph.clear(); ! ((RDFGraph)mainPanel.getGraph()).readFromURL(settingsurl); Node defaultSettings = null; *************** *** 182,186 **** ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ! ((RDFGraph)mainPanel.getGraph()).writeToRDF(bytes); String data = bytes.toString(); --- 181,185 ---- ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ! ((RDFGraph)mainPanel.getGraph()).writeToRDF(bytes, saveURL.toString()); String data = bytes.toString(); Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** GraphlApplication.java 24 Aug 2005 16:09:30 -0000 1.20 --- GraphlApplication.java 5 Sep 2005 15:51:50 -0000 1.21 *************** *** 32,35 **** --- 32,36 ---- import javax.swing.KeyStroke; + import org.mediavirus.graphl.graph.Graph; import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.graph.filter.FilteredGraph; *************** *** 70,73 **** --- 71,76 ---- JMenu configConfigurationMenu; + JMenu saveMenu; + Font menuFont = new Font(null, Font.PLAIN, 12); *************** *** 96,107 **** }); ! FilteredGraph fgraph = new FilteredGraph(new RDFGraph()); SourceFilter filter = new SourceFilter(); 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"); ! fgraph.addFilter(filter); ! mainPanel = new GraphlPanel(fgraph); this.getContentPane().setLayout(new BorderLayout()); --- 99,113 ---- }); ! Graph graph = new RDFGraph(); ! 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"); ! ! mainPanel = new GraphlPanel(graph); ! mainPanel.graphPane.getFilteredGraph().addFilter(filter); this.getContentPane().setLayout(new BorderLayout()); *************** *** 113,117 **** fileMenu.setFont(menuFont); ! newItem = new JMenuItem("New"); newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_DOWN_MASK)); newItem.addActionListener(new ActionListener() { --- 119,123 ---- fileMenu.setFont(menuFont); ! newItem = new JMenuItem("Clear"); newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_DOWN_MASK)); newItem.addActionListener(new ActionListener() { *************** *** 123,127 **** fileMenu.add(newItem); ! openFileItem = new JMenuItem("Open File..."); openFileItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK)); openFileItem.addActionListener(new ActionListener() { --- 129,133 ---- fileMenu.add(newItem); ! openFileItem = new JMenuItem("Load File..."); openFileItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK)); openFileItem.addActionListener(new ActionListener() { *************** *** 133,137 **** fileMenu.add(openFileItem); ! openURLItem = new JMenuItem("Open URL..."); openURLItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK + KeyEvent.SHIFT_DOWN_MASK)); openURLItem.addActionListener(new ActionListener() { --- 139,143 ---- fileMenu.add(openFileItem); ! openURLItem = new JMenuItem("Load URL..."); openURLItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK + KeyEvent.SHIFT_DOWN_MASK)); openURLItem.addActionListener(new ActionListener() { *************** *** 145,168 **** fileMenu.addSeparator(); ! saveItem = new JMenuItem("Save"); ! saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_DOWN_MASK)); ! saveItem.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! doSave(); ! } ! }); ! saveItem.setFont(menuFont); ! fileMenu.add(saveItem); ! saveAsItem = new JMenuItem("Save As..."); ! saveAsItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_DOWN_MASK + KeyEvent.SHIFT_DOWN_MASK)); ! saveAsItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { doSaveAs(); } }); ! saveAsItem.setFont(menuFont); ! fileMenu.add(saveAsItem); ! fileMenu.addSeparator(); --- 151,168 ---- fileMenu.addSeparator(); ! saveMenu = new JMenu("Save Changes"); ! saveMenu.setFont(menuFont); ! fileMenu.add(saveMenu); ! saveItem = new JMenuItem("to new File..."); ! saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_DOWN_MASK + KeyEvent.SHIFT_DOWN_MASK)); ! saveItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { doSaveAs(); } }); ! saveItem.setFont(menuFont); ! saveMenu.add(saveItem); ! fileMenu.addSeparator(); *************** *** 338,342 **** protected boolean doSave(File file) { try { ! mainPanel.getGraph().writeToRDF(new FileOutputStream(currentFile)); mainPanel.getGraph().resetDirty(); } --- 338,354 ---- protected boolean doSave(File file) { try { ! FilteredGraph fgraph = new FilteredGraph(mainPanel.getGraphPane().getSourceGraph()); ! SourceFilter filter = new SourceFilter(false, false); ! ! String urlstr = ""; ! try { ! urlstr = new URL("file:///" + file.getAbsolutePath()).toString(); ! filter.addSource(urlstr); ! } ! catch (MalformedURLException e) {} ! filter.addSource(NS.graphl + "USER"); ! fgraph.addFilter(filter); ! ! RDFGraph.writeToRDF(fgraph, new FileOutputStream(currentFile), urlstr); mainPanel.getGraph().resetDirty(); } *************** *** 354,368 **** */ protected void doLoad() { - if (mainPanel.getGraph().isDirty()) { - int choice = JOptionPane.showConfirmDialog(this, "File has been changed. Do you want to save your changes?", "Save Changes?", JOptionPane.YES_NO_CANCEL_OPTION); - if (choice == JOptionPane.CANCEL_OPTION) return; - if (choice == JOptionPane.YES_OPTION) { - boolean result = doSave(); - // if save not succesful, treat as cancel - if (result != true) { - return; - } - } - } JFileChooser chooser = new JFileChooser(); --- 366,369 ---- *************** *** 388,391 **** --- 389,398 ---- try { loadFile(chooser.getSelectedFile()); + + JMenuItem saveFileItem = new JMenuItem("to " + chooser.getSelectedFile().getName()); + saveFileItem.addActionListener(new SaveFileAdapter(chooser.getSelectedFile())); + saveFileItem.setFont(menuFont); + saveMenu.add(saveFileItem); + } catch (IOException ioex) { *************** *** 397,400 **** --- 404,419 ---- } + private class SaveFileAdapter implements ActionListener { + private File f; + + public SaveFileAdapter(File f) { + this.f = f; + } + + public void actionPerformed(ActionEvent e) { + doSave(f); + } + } + /** * Loads the graph from the specified file. *************** *** 410,414 **** mainPanel.getGraph().readFromFile(file.getAbsolutePath()); ! setTitle("Graphl - " + file.getName()); currentFile = file; } --- 429,433 ---- mainPanel.getGraph().readFromFile(file.getAbsolutePath()); ! //setTitle("Graphl - " + file.getName()); currentFile = file; } *************** *** 485,492 **** public void loadSettings(String filename) throws IOException { ! // TODO (1) fix this to properly access graph. think about GraphlPanel vs. GraphlApplication features ! RDFGraph settingsGraph = (RDFGraph)((FilteredGraph)mainPanel.graphPane.getGraph()).getSource(); settingsGraph.readFromFile(filename); - mainPanel.graphPane.setConfigurationGraph(settingsGraph); JRadioButtonMenuItem defaultItem = null; --- 504,509 ---- public void loadSettings(String filename) throws IOException { ! RDFGraph settingsGraph = (RDFGraph)mainPanel.graphPane.getSourceGraph(); settingsGraph.readFromFile(filename); JRadioButtonMenuItem defaultItem = null; *************** *** 626,630 **** public void run() { try { ! List nodes = mainPanel.graphPane.graph.getNodes(); for (Iterator iter = nodes.iterator(); iter.hasNext();) { Node node = (Node) iter.next(); --- 643,647 ---- public void run() { try { ! List nodes = mainPanel.graphPane.filteredGraph.getNodes(); for (Iterator iter = nodes.iterator(); iter.hasNext();) { Node node = (Node) iter.next(); |
From: Flo L. <fl...@us...> - 2005-09-05 15:50:48
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15664/src/org/mediavirus/graphl/graph Modified Files: DefaultEdge.java DefaultElement.java GraphElement.java DefaultNode.java Log Message: removed getLabel() method of graph element Index: DefaultNode.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/DefaultNode.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** DefaultNode.java 17 Aug 2005 15:52:50 -0000 1.15 --- DefaultNode.java 5 Sep 2005 15:50:40 -0000 1.16 *************** *** 107,118 **** return posY; } - /** - * Return the label of this node. - * - * @return the label of this node - */ - public String getLabel() { - return toString(); - } /** --- 107,110 ---- *************** *** 266,269 **** --- 258,274 ---- this.width = width; } + /** + * @see org.mediavirus.graphl.graph.Node#invertPin(org.mediavirus.graphl.graph.Edge) + */ + public void invertPin(Edge edge) { + if (edgesFrom.contains(edge)) { + edgesFrom.remove(edge); + edgesTo.add(edge); + } + else if (edgesTo.contains(edge)) { + edgesTo.remove(edge); + edgesFrom.add(edge); + } + } } Index: GraphElement.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/GraphElement.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GraphElement.java 17 Aug 2005 15:52:50 -0000 1.7 --- GraphElement.java 5 Sep 2005 15:50:40 -0000 1.8 *************** *** 24,35 **** void setZIndex(int z); int getZIndex(); - - /** - * Returns the value of this element. - * - * @return the value of the element - */ - // TODO (2, 2h) this should be removed! maybe a getLabel() in NodeView/EdgeView - String getLabel(); } \ No newline at end of file --- 24,27 ---- Index: DefaultEdge.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/DefaultEdge.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** DefaultEdge.java 17 Aug 2005 15:52:50 -0000 1.13 --- DefaultEdge.java 5 Sep 2005 15:50:40 -0000 1.14 *************** *** 64,75 **** return to; } - /** - * Returns the label of this node. - * - * @return the label of the node - */ - public String getLabel() { - return toString(); - } /** --- 64,67 ---- *************** *** 182,196 **** * Inverts the direction of the edge (from and to are swapped). */ - // TODO (1) also update edge data in the nodes! public void invert() { Node temp = from; from = to; to = temp; } /** * @see org.mediavirus.graphl.graph.GraphElement#getBaseURL() - * - * @uml.property name="baseURL" */ public String getSource() { --- 174,187 ---- * Inverts the direction of the edge (from and to are swapped). */ public void invert() { Node temp = from; from = to; to = temp; + from.invertPin(this); + to.invertPin(this); } /** * @see org.mediavirus.graphl.graph.GraphElement#getBaseURL() */ public String getSource() { *************** *** 200,205 **** /** * @see org.mediavirus.graphl.graph.GraphElement#setBaseURL(java.lang.String) - * - * @uml.property name="baseURL" */ public void setSource(String source) { --- 191,194 ---- Index: DefaultElement.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/DefaultElement.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DefaultElement.java 11 Jan 2005 13:26:41 -0000 1.3 --- DefaultElement.java 5 Sep 2005 15:50:40 -0000 1.4 *************** *** 30,36 **** } - /** - * @see org.mediavirus.graphl.graph.PropertySet#getProperties() - */ public Map getProperties() { return (Map)properties.clone(); --- 30,33 ---- |
From: Flo L. <fl...@us...> - 2005-09-05 15:49:28
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15386/src/org/mediavirus/graphl/vocabulary Modified Files: NS.java Log Message: added rdfs namespace Index: NS.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary/NS.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NS.java 24 Aug 2005 16:05:16 -0000 1.2 --- NS.java 5 Sep 2005 15:49:19 -0000 1.3 *************** *** 11,13 **** --- 11,14 ---- public static final String graphl = "http://www.mediavirus.org/graphl#"; public static final String foaf = "http://xmlns.com/foaf/0.1/"; + public static final String rdfs = "http://www.w3.org/2000/01/rdf-schema#"; } |
From: Flo L. <fl...@us...> - 2005-09-05 15:49:17
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15283/src/org/mediavirus/graphl/view Modified Files: AbstractFacet.java Log Message: changed some task priorities Index: AbstractFacet.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/AbstractFacet.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractFacet.java 30 Nov 2004 09:38:33 -0000 1.6 --- AbstractFacet.java 5 Sep 2005 15:48:58 -0000 1.7 *************** *** 60,64 **** // do nothing per default. ! // TODO (2) either implement a generic property mechanism here, or implement his method in all subclasses // (it should then be removed here). } --- 60,64 ---- // do nothing per default. ! // TODO (2) either implement a generic property mechanism here, or implement this method in all subclasses // (it should then be removed here). } |
From: Flo L. <fl...@us...> - 2005-09-05 15:48:48
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15190/src/org/mediavirus/graphl/painter Modified Files: StraightLineEdgePainter.java Log Message: commented out defunct method Index: StraightLineEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/StraightLineEdgePainter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StraightLineEdgePainter.java 17 Aug 2005 15:52:51 -0000 1.7 --- StraightLineEdgePainter.java 5 Sep 2005 15:48:39 -0000 1.8 *************** *** 254,259 **** */ public boolean isPointInLabel(GraphlPane graphPane, Edge edge, Point point) { ! if (isPaintLabel()) { ! // TODO (2) how to get the label string String label = edge.getLabel(); if (label != null){ --- 254,264 ---- */ public boolean isPointInLabel(GraphlPane graphPane, Edge edge, Point point) { ! return false; ! ! // TODO (X) properly implement this ! ! /* ! if (isPaintLabel()) { ! // xTODO (2) how to get the label string String label = edge.getLabel(); if (label != null){ *************** *** 263,267 **** double y2 = edge.getTo().getCenterX(); ! // TODO (2): properly calculate label clicking (0.5h) if ((point.x > (x1+x2)/2-5) && (point.x < (x1+x2)/2+5) && (point.y > (y1+y2)/2-5) && (point.y < (y1+y2)/2+5) ) { return true; --- 268,272 ---- double y2 = edge.getTo().getCenterX(); ! // xTODO (2): properly calculate label clicking (0.5h) if ((point.x > (x1+x2)/2-5) && (point.x < (x1+x2)/2+5) && (point.y > (y1+y2)/2-5) && (point.y < (y1+y2)/2+5) ) { return true; *************** *** 270,273 **** --- 275,279 ---- } return false; + */ } |
From: Flo L. <fl...@us...> - 2005-09-05 15:48:07
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15108/src/org/mediavirus/graphl/layout Modified Files: RepulsionNodeLayouter.java SortedNodeLayouter.java Log Message: changed some task priorities Index: RepulsionNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/RepulsionNodeLayouter.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RepulsionNodeLayouter.java 24 Aug 2005 16:05:54 -0000 1.9 --- RepulsionNodeLayouter.java 5 Sep 2005 15:47:59 -0000 1.10 *************** *** 36,40 **** Node node2 = (Node)nodes.next(); if (node2 != node) { ! //TODO (2) see if node is in same subgraph, otherwise do not repulse NodeMovement movement2 = graphManager.getNodeMovement(node2); if (movement2 != null) { --- 36,40 ---- Node node2 = (Node)nodes.next(); if (node2 != node) { ! //TODO (3) see if node is in same subgraph, otherwise do not repulse NodeMovement movement2 = graphManager.getNodeMovement(node2); if (movement2 != null) { Index: SortedNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/SortedNodeLayouter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SortedNodeLayouter.java 17 Aug 2005 15:52:49 -0000 1.8 --- SortedNodeLayouter.java 5 Sep 2005 15:47:59 -0000 1.9 *************** *** 177,181 **** } else if (datatype == STRING) { ! // TODO (2, 1h) improve this val = str.charAt(0) * 256 * 256 + str.charAt(1) * 256 + str.charAt(2); } --- 177,181 ---- } else if (datatype == STRING) { ! // TODO (X, 1h) improve this val = str.charAt(0) * 256 * 256 + str.charAt(1) * 256 + str.charAt(2); } |
From: Flo L. <fl...@us...> - 2005-09-05 15:47:30
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15035/src/org/mediavirus/graphl/gui Modified Files: EdgeContextMenu.java NodeContextMenu.java InPlaceNodeEditor.java Log Message: added methods to access filtered and unfiltered versions of the graph in GraphlPane Index: EdgeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/EdgeContextMenu.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** EdgeContextMenu.java 11 Jan 2005 13:26:42 -0000 1.17 --- EdgeContextMenu.java 5 Sep 2005 15:47:18 -0000 1.18 *************** *** 95,99 **** } ! graphlPane.getGraph().notifyLayoutUpdated(); graphlPane.repaint(); } --- 95,99 ---- } ! graphlPane.getFilteredGraph().notifyLayoutUpdated(); graphlPane.repaint(); } *************** *** 380,384 **** public void resourceChanged(String property) { currentEdge.setType(property); ! graphlPane.getGraph().notifyPropertyChanged(); graphlPane.repaint(); } --- 380,384 ---- public void resourceChanged(String property) { currentEdge.setType(property); ! graphlPane.getFilteredGraph().notifyPropertyChanged(); graphlPane.repaint(); } Index: NodeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/NodeContextMenu.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NodeContextMenu.java 11 Jan 2005 13:26:42 -0000 1.18 --- NodeContextMenu.java 5 Sep 2005 15:47:18 -0000 1.19 *************** *** 95,99 **** } ! graphlPane.getGraph().notifyLayoutUpdated(); graphlPane.repaint(); } --- 95,99 ---- } ! graphlPane.getFilteredGraph().notifyLayoutUpdated(); graphlPane.repaint(); } *************** *** 390,394 **** public void resourceChanged(String property) { currentNode.setType(property); ! graphlPane.getGraph().notifyPropertyChanged(); graphlPane.repaint(); } --- 390,394 ---- public void resourceChanged(String property) { currentNode.setType(property); ! graphlPane.getFilteredGraph().notifyPropertyChanged(); graphlPane.repaint(); } Index: InPlaceNodeEditor.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/InPlaceNodeEditor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** InPlaceNodeEditor.java 24 Aug 2005 16:11:15 -0000 1.3 --- InPlaceNodeEditor.java 5 Sep 2005 15:47:18 -0000 1.4 *************** *** 159,163 **** m_graphPane.add(m_component); editingStarting(m_component); ! m_graphPane.getGraph().addGraphListener(this); m_editingInProgress=true; } --- 159,163 ---- m_graphPane.add(m_component); editingStarting(m_component); ! m_graphPane.getFilteredGraph().addGraphListener(this); m_editingInProgress=true; } *************** *** 176,181 **** return false; m_graphPane.remove(m_component); ! m_graphPane.getGraph().removeGraphListener(this); ! m_graphPane.getGraph().notifyLayoutUpdated(); m_editingInProgress=false; } --- 176,181 ---- return false; m_graphPane.remove(m_component); ! m_graphPane.getFilteredGraph().removeGraphListener(this); ! m_graphPane.getFilteredGraph().notifyLayoutUpdated(); m_editingInProgress=false; } *************** *** 195,200 **** m_nodeEditingController.editingAborted(m_node); m_graphPane.remove(m_component); ! m_graphPane.getGraph().removeGraphListener(this); ! m_graphPane.getGraph().notifyLayoutUpdated(); m_editingInProgress=false; } --- 195,200 ---- m_nodeEditingController.editingAborted(m_node); m_graphPane.remove(m_component); ! m_graphPane.getFilteredGraph().removeGraphListener(this); ! m_graphPane.getFilteredGraph().notifyLayoutUpdated(); m_editingInProgress=false; } |
From: Flo L. <fl...@us...> - 2005-09-05 15:46:48
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14883/src/org/mediavirus/graphl/interaction Modified Files: DefaultNodeManipulator.java GraphlManipulator.java Log Message: added methods to access filtered and unfiltered versions of the graph in GraphlPane Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** GraphlManipulator.java 24 Aug 2005 16:12:41 -0000 1.11 --- GraphlManipulator.java 5 Sep 2005 15:46:38 -0000 1.12 *************** *** 84,88 **** else { graphPane.pauseLayouter(); ! graphMenu.show(e.getX(), e.getY(), graphPane.getGraph()); } } --- 84,88 ---- else { graphPane.pauseLayouter(); ! graphMenu.show(e.getX(), e.getY(), graphPane.getFilteredGraph()); } } *************** *** 128,132 **** if (e.getClickCount() == 2) { //(e.getWhen() - lastClick) < 300) { if ((clickNode == null) && (clickEdge == null)) { ! final Node newNode = graphPane.getGraph().createNode(); clickNode = newNode; clickNode.setCenter(p.getX(), p.getY()); --- 128,132 ---- if (e.getClickCount() == 2) { //(e.getWhen() - lastClick) < 300) { if ((clickNode == null) && (clickEdge == null)) { ! final Node newNode = graphPane.getFilteredGraph().createNode(); clickNode = newNode; clickNode.setCenter(p.getX(), p.getY()); *************** *** 153,157 **** } ); editor.startEditing(); ! graphPane.getGraph().notifyPropertyChanged(); graphPane.repaint(); } --- 153,157 ---- } ); editor.startEditing(); ! graphPane.getFilteredGraph().notifyPropertyChanged(); graphPane.repaint(); } *************** *** 175,179 **** else { clickEdge.invert(); ! graphPane.getGraph().notifyLayoutUpdated(); graphPane.repaint(); } --- 175,179 ---- else { clickEdge.invert(); ! graphPane.getFilteredGraph().notifyLayoutUpdated(); graphPane.repaint(); } *************** *** 184,188 **** if ((e.getModifiers() & MouseEvent.CTRL_MASK) == 0) { graphPane.getSelection().clear(); ! graphPane.getGraph().notifyLayoutUpdated(); } if (clickNode != null) { --- 184,188 ---- if ((e.getModifiers() & MouseEvent.CTRL_MASK) == 0) { graphPane.getSelection().clear(); ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } if (clickNode != null) { *************** *** 194,198 **** System.out.println(clickNode.getType()); } ! graphPane.getGraph().notifyLayoutUpdated(); } else if (clickEdge != null) { --- 194,198 ---- System.out.println(clickNode.getType()); } ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } else if (clickEdge != null) { *************** *** 203,207 **** graphPane.getSelection().addEdge(clickEdge); } ! graphPane.getGraph().notifyLayoutUpdated(); } } --- 203,207 ---- graphPane.getSelection().addEdge(clickEdge); } ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } } *************** *** 227,231 **** else { graphPane.pauseLayouter(); ! graphMenu.show(e.getX(), e.getY(), graphPane.getGraph()); } } --- 227,231 ---- else { graphPane.pauseLayouter(); ! graphMenu.show(e.getX(), e.getY(), graphPane.getFilteredGraph()); } } *************** *** 247,261 **** // we also allow multiple edges between two nodes! RDFEdge edge = new RDFEdge(edgeNode, overNode); ! graphPane.getGraph().addElements(null, Collections.singleton(edge)); } else if ( overNode!=edgeNode ) { ! Node newNode = graphPane.getGraph().createNode(); newNode.setCenter(p.getX(), p.getY()); ! Edge edge = graphPane.getGraph().createEdge(edgeNode, newNode); Point d = new Point(); graphPane.screenToGraphPoint(dragStart,d); // TODO (3) length should be mapped to arbitrary property! ((DefaultEdge)edge).setLength(dragStart.distance(d)); ! ((DefaultGraph)graphPane.getGraph()).addElements(Collections.singleton(newNode), Collections.singleton(edge)); TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, newNode, this); editor.startEditing(); --- 247,263 ---- // we also allow multiple edges between two nodes! RDFEdge edge = new RDFEdge(edgeNode, overNode); ! edge.setSource(NS.graphl + "USER"); ! graphPane.getFilteredGraph().addElements(null, Collections.singleton(edge)); } else if ( overNode!=edgeNode ) { ! Node newNode = graphPane.getFilteredGraph().createNode(); newNode.setCenter(p.getX(), p.getY()); ! Edge edge = graphPane.getFilteredGraph().createEdge(edgeNode, newNode); ! edge.setSource(NS.graphl + "USER"); Point d = new Point(); graphPane.screenToGraphPoint(dragStart,d); // TODO (3) length should be mapped to arbitrary property! ((DefaultEdge)edge).setLength(dragStart.distance(d)); ! ((DefaultGraph)graphPane.getSourceGraph()).addElements(Collections.singleton(newNode), Collections.singleton(edge)); TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, newNode, this); editor.startEditing(); *************** *** 281,285 **** e.consume(); moved = true; ! graphPane.getGraph().notifyLayoutUpdated(); } // else if (dragEdge != null) { --- 283,287 ---- e.consume(); moved = true; ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } // else if (dragEdge != null) { *************** *** 317,321 **** graphPane.screenToGraphPoint(point,graphPoint); dragNode.setCenter(graphPoint.getX(),graphPoint.getY()); ! graphPane.getGraph().notifyLayoutUpdated(); } } --- 319,323 ---- graphPane.screenToGraphPoint(point,graphPoint); dragNode.setCenter(graphPoint.getX(),graphPoint.getY()); ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } } Index: DefaultNodeManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/DefaultNodeManipulator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultNodeManipulator.java 29 Dec 2004 14:31:30 -0000 1.1 --- DefaultNodeManipulator.java 5 Sep 2005 15:46:38 -0000 1.2 *************** *** 62,66 **** if (node != overNode) { overNode = node; ! graphPane.getGraph().notifyUpdated(); } } --- 62,66 ---- if (node != overNode) { overNode = node; ! graphPane.getFilteredGraph().notifyUpdated(); } } *************** *** 74,78 **** (p.getY() < (overNode.getCenterY()+overNode.getHeight()/2)-10)) { overNode = null; ! graphPane.getGraph().notifyUpdated(); } } --- 74,78 ---- (p.getY() < (overNode.getCenterY()+overNode.getHeight()/2)-10)) { overNode = null; ! graphPane.getFilteredGraph().notifyUpdated(); } } |
From: Flo L. <fl...@us...> - 2005-09-05 15:46:48
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14883/src/org/mediavirus/graphl Modified Files: GraphlPane.java GraphlPanel.java Log Message: added methods to access filtered and unfiltered versions of the graph in GraphlPane Index: GraphlPanel.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPanel.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GraphlPanel.java 17 Aug 2005 15:52:51 -0000 1.23 --- GraphlPanel.java 5 Sep 2005 15:46:38 -0000 1.24 *************** *** 44,48 **** GraphlPane graphPane; GraphlManipulator gui; - Graph graph; JCheckBox layoutBox; --- 44,47 ---- *************** *** 56,68 **** public GraphlPanel(){ ! graph = new RDFGraph(); initialize(); } public GraphlPanel(Graph graph) { ! this.graph = graph; initialize(); } protected void initialize() { --- 55,99 ---- public GraphlPanel(){ ! graphPane = new GraphlPane(); ! initGraphlPane(); initialize(); } public GraphlPanel(Graph graph) { ! graphPane = new GraphlPane(graph); ! initGraphlPane(); initialize(); } + private void initGraphlPane() { + graphPane.setEnabled(true); + graphPane.addManipulator(new GraphlManipulator()); + graphPane.addManipulator(new DefaultNodeManipulator()); + graphPane.getFilteredGraph().addGraphListener(this); + graphPane.addKeyListener(this); + graphPane.addMouseWheelListener(new MouseWheelListener () { + public void mouseWheelMoved(MouseWheelEvent e) { + //invert the rotation to create standard scroll-zoom + //behaviour (scroll up=zoom in, scroll down=zoom out) + int wheelRotation = e.getWheelRotation() * -1; + int sliderValue = getZoomSlider().getValue(); + //ignore scrolling in invariant directions at extreme values + if ((wheelRotation < 0 && getZoomSlider().getValue() == getZoomSlider().getMinimum()) + ||(wheelRotation > 0 && getZoomSlider().getValue() == getZoomSlider().getMaximum())) { + return; + } + sliderValue += wheelRotation * e.getScrollAmount() * WHEEL_ZOOM_FACTOR; + if(sliderValue < getZoomSlider().getMinimum()) { + sliderValue = getZoomSlider().getMinimum(); + } + if(sliderValue > getZoomSlider().getMaximum()) { + sliderValue = getZoomSlider().getMaximum(); + } + getZoomSlider().setValue(sliderValue); + } + }); + + } + protected void initialize() { *************** *** 200,230 **** public GraphlPane getGraphPane() { if (graphPane == null) { - graphPane = new GraphlPane(graph); - graphPane.setEnabled(true); - graphPane.addManipulator(new GraphlManipulator()); - graphPane.addManipulator(new DefaultNodeManipulator()); - graphPane.getGraph().addGraphListener(this); - graphPane.addKeyListener(this); - graphPane.addMouseWheelListener(new MouseWheelListener () { - public void mouseWheelMoved(MouseWheelEvent e) { - //invert the rotation to create standard scroll-zoom - //behaviour (scroll up=zoom in, scroll down=zoom out) - int wheelRotation = e.getWheelRotation() * -1; - int sliderValue = getZoomSlider().getValue(); - //ignore scrolling in invariant directions at extreme values - if ((wheelRotation < 0 && getZoomSlider().getValue() == getZoomSlider().getMinimum()) - ||(wheelRotation > 0 && getZoomSlider().getValue() == getZoomSlider().getMaximum())) { - return; - } - sliderValue += wheelRotation * e.getScrollAmount() * WHEEL_ZOOM_FACTOR; - if(sliderValue < getZoomSlider().getMinimum()) { - sliderValue = getZoomSlider().getMinimum(); - } - if(sliderValue > getZoomSlider().getMaximum()) { - sliderValue = getZoomSlider().getMaximum(); - } - getZoomSlider().setValue(sliderValue); - } - }); } return graphPane; --- 231,234 ---- *************** *** 243,249 **** } ! // TODO (1) fix access and casting public RDFGraph getGraph() { ! return (RDFGraph)((FilteredGraph) graphPane.getGraph()).getSource(); } --- 247,254 ---- } ! // TODO (1) fix access and casting. DEP: #1 ! // TODO (1, 4h) #1 rewrite all load, save,... operations for new global graph paradigm public RDFGraph getGraph() { ! return (RDFGraph)((FilteredGraph) graphPane.getFilteredGraph()).getSource(); } *************** *** 281,288 **** edges.addAll(node.getEdgesFrom()); edges.addAll(node.getEdgesTo()); ! ((DefaultGraph)graphPane.getGraph()).deleteElements(Collections.singleton(node),edges); } ! ((DefaultGraph)graphPane.getGraph()).deleteElements(null,graphPane.getSelection().getSelectedEdges()); } --- 286,293 ---- edges.addAll(node.getEdgesFrom()); edges.addAll(node.getEdgesTo()); ! ((DefaultGraph)graphPane.getSourceGraph()).deleteElements(Collections.singleton(node),edges); } ! ((DefaultGraph)graphPane.getSourceGraph()).deleteElements(null,graphPane.getSelection().getSelectedEdges()); } Index: GraphlPane.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPane.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** GraphlPane.java 17 Aug 2005 15:52:51 -0000 1.19 --- GraphlPane.java 5 Sep 2005 15:46:38 -0000 1.20 *************** *** 36,39 **** --- 36,40 ---- import org.mediavirus.graphl.graph.GraphListener; import org.mediavirus.graphl.graph.Node; + import org.mediavirus.graphl.graph.filter.FilteredGraph; import org.mediavirus.graphl.graph.rdf.RDFGraph; import org.mediavirus.graphl.interaction.Manipulator; *************** *** 76,80 **** /** The graph being visualized. */ ! protected Graph graph; /** The listener for the graph. */ protected GraphListener graphListener; --- 77,81 ---- /** The graph being visualized. */ ! protected FilteredGraph filteredGraph; /** The listener for the graph. */ protected GraphListener graphListener; *************** *** 99,105 **** public GraphlPane(Graph graph) { super(null); graphListener=new GraphHandler(); manipulators=new ArrayList(); - setGraph(graph); enableEvents(MouseEvent.MOUSE_EVENT_MASK | MouseEvent.MOUSE_MOTION_EVENT_MASK | KeyEvent.KEY_EVENT_MASK | FocusEvent.FOCUS_EVENT_MASK | ComponentEvent.COMPONENT_EVENT_MASK); setBackground(Color.white); --- 100,106 ---- public GraphlPane(Graph graph) { super(null); + setSourceGraph(graph); graphListener=new GraphHandler(); manipulators=new ArrayList(); enableEvents(MouseEvent.MOUSE_EVENT_MASK | MouseEvent.MOUSE_MOTION_EVENT_MASK | KeyEvent.KEY_EVENT_MASK | FocusEvent.FOCUS_EVENT_MASK | ComponentEvent.COMPONENT_EVENT_MASK); setBackground(Color.white); *************** *** 108,112 **** updateTransform(); ! layouter = new Layouter(new GraphlLayoutStrategy(getGraph(), getFacetRegistry())); startLayouter(); //setupDefaultPainters(); --- 109,113 ---- updateTransform(); ! layouter = new Layouter(new GraphlLayoutStrategy(getFilteredGraph(), getFacetRegistry())); startLayouter(); //setupDefaultPainters(); *************** *** 123,127 **** public void setFacetRegistry(FacetRegistry registry) { this.facetRegistry = registry; ! registry.updateFacets(graph); repaint(); } --- 124,128 ---- public void setFacetRegistry(FacetRegistry registry) { this.facetRegistry = registry; ! registry.updateFacets(filteredGraph); repaint(); } *************** *** 215,220 **** // } ! if (graph!=null) ! synchronized (graph) { // this is the main rendering loop //TODO (2, 1h) we have to store zMin somewhere (GraphView?) and get it here to save 1 loop --- 216,221 ---- // } ! if (filteredGraph!=null) ! synchronized (filteredGraph) { // this is the main rendering loop //TODO (2, 1h) we have to store zMin somewhere (GraphView?) and get it here to save 1 loop *************** *** 225,229 **** curZ = nextZ; nextZ = Integer.MAX_VALUE; ! iterator=graph.getEdges().iterator(); while (iterator.hasNext()) { Edge edge=(Edge)iterator.next(); --- 226,230 ---- curZ = nextZ; nextZ = Integer.MAX_VALUE; ! iterator=filteredGraph.getEdges().iterator(); while (iterator.hasNext()) { Edge edge=(Edge)iterator.next(); *************** *** 239,243 **** } } ! iterator=graph.getNodes().iterator(); while (iterator.hasNext()) { Node node=(Node)iterator.next(); --- 240,244 ---- } } ! iterator=filteredGraph.getNodes().iterator(); while (iterator.hasNext()) { Node node=(Node)iterator.next(); *************** *** 307,311 **** public void graphContentsChanged(Graph graph) { ! facetRegistry.updateFacets(graph); } --- 308,315 ---- public void graphContentsChanged(Graph graph) { ! if (graph == filteredGraph) { ! updateSettingsFromGraph(getSourceGraph()); ! facetRegistry.updateFacets(getSourceGraph()); ! } } *************** *** 330,334 **** } ! // we have to update all nodes' facets, because new nodes may have changed // an existing node's type // TODO (2) implement node and edge change notification in GraphListener --- 334,338 ---- } ! // we have to update all nodes' facets, because new nodes may have changed // an existing node's type // TODO (2) implement node and edge change notification in GraphListener *************** *** 386,391 **** * @return the current graph */ ! public Graph getGraph() { ! return graph; } /** --- 390,399 ---- * @return the current graph */ ! public FilteredGraph getFilteredGraph() { ! return filteredGraph; ! } ! ! public Graph getSourceGraph() { ! return filteredGraph.getSource(); } /** *************** *** 394,400 **** * @param graph the new graph */ ! public void setGraph(Graph graph) { ! ! Graph oldGraph = this.graph; if (oldGraph != null) { oldGraph.removeGraphListener(graphListener); --- 402,416 ---- * @param graph the new graph */ ! public void setSourceGraph(Graph graph) { ! if (filteredGraph == null) { ! filteredGraph = new FilteredGraph(graph); ! filteredGraph.addGraphListener(graphListener); ! filteredGraph.addGraphListener(this); ! } ! else { ! filteredGraph.setSource(graph); ! } ! selection = new DefaultSelectionModel(filteredGraph); ! /*Graph oldGraph = filteredGraph.getSource(); if (oldGraph != null) { oldGraph.removeGraphListener(graphListener); *************** *** 402,415 **** } ! this.graph = graph; if (graph != null) { graph.addGraphListener(graphListener); graph.addGraphListener(this); ! } repaint(); ! selection = new DefaultSelectionModel(graph); ! firePropertyChange("graph",oldGraph,graph); //graph.addGraphListener(this); } --- 418,443 ---- } ! this.filteredGraph = graph; if (graph != null) { graph.addGraphListener(graphListener); graph.addGraphListener(this); ! }*/ repaint(); ! //selection = new DefaultSelectionModel(graph); ! //firePropertyChange("graph",oldGraph,graph); //graph.addGraphListener(this); + } + + public void updateSettingsFromGraph(Graph graph) { + configurations.clear(); + + for (Iterator nodes = graph.getNodes().iterator(); nodes.hasNext();) { + Node node = (Node) nodes.next(); + if (node.hasType(NS.graphl + "Configuration")) { + configurations.add(node); + node.setProperty(NS.graphl + "active","false"); + } + } } *************** *** 422,427 **** */ public Node getNodeAtPoint(Point point) { ! synchronized (graph) { ! List nodes=graph.getNodes(); ListIterator iterator=nodes.listIterator(nodes.size()); while (iterator.hasPrevious()) { --- 450,455 ---- */ public Node getNodeAtPoint(Point point) { ! synchronized (filteredGraph) { ! List nodes=filteredGraph.getNodes(); ListIterator iterator=nodes.listIterator(nodes.size()); while (iterator.hasPrevious()) { *************** *** 441,448 **** */ public Set getNodesInRectangle(Rectangle rectangle) { ! synchronized (graph) { Set nodesInRectangle=new HashSet(); Rectangle nodeRectangle=new Rectangle(); ! Iterator nodes=graph.getNodes().iterator(); while (nodes.hasNext()) { Node node=(Node)nodes.next(); --- 469,476 ---- */ public Set getNodesInRectangle(Rectangle rectangle) { ! synchronized (filteredGraph) { Set nodesInRectangle=new HashSet(); Rectangle nodeRectangle=new Rectangle(); ! Iterator nodes=filteredGraph.getNodes().iterator(); while (nodes.hasNext()) { Node node=(Node)nodes.next(); *************** *** 463,468 **** Edge nearestEdge=null; double minDistance=4; ! synchronized (graph) { ! List edges=graph.getEdges(); ListIterator iterator=edges.listIterator(edges.size()); while (iterator.hasPrevious()) { --- 491,496 ---- Edge nearestEdge=null; double minDistance=4; ! synchronized (filteredGraph) { ! List edges=filteredGraph.getEdges(); ListIterator iterator=edges.listIterator(edges.size()); while (iterator.hasPrevious()) { *************** *** 767,795 **** } - private Graph settingsGraph = null; /** A List with all configuration nodes in the settings graph */ private List configurations = new ArrayList(); private Node currentConfiguration = null; - - public void setConfigurationGraph(Graph settingsGraph) { - - this.settingsGraph = settingsGraph; - - Node defaultConfiguration = null; - - for (Iterator nodes = settingsGraph.getNodes().iterator(); nodes.hasNext();) { - Node node = (Node) nodes.next(); - if (node.hasType(NS.graphl + "Configuration")) { - configurations.add(node); - node.setProperty(NS.graphl + "active","false"); - } - } - - } - - public Graph getConfigurationGraph() { - return settingsGraph; - } public Collection getConfigurations() { --- 795,802 ---- *************** *** 806,814 **** } currentConfiguration = configuration; ! setFacetRegistry(new GraphFacetRegistry(settingsGraph,configuration)); setVocabularies(configuration.getFirstNeighbour(NS.graphl + "vocabularies",true)); configuration.setProperty(NS.graphl + "active","true"); setComment(configuration.getProperty(NS.graphl + "comment")); ! graph.notifyLayoutUpdated(); } /** --- 813,821 ---- } currentConfiguration = configuration; ! setFacetRegistry(new GraphFacetRegistry(getSourceGraph(),configuration)); setVocabularies(configuration.getFirstNeighbour(NS.graphl + "vocabularies",true)); configuration.setProperty(NS.graphl + "active","true"); setComment(configuration.getProperty(NS.graphl + "comment")); ! filteredGraph.notifyLayoutUpdated(); } /** *************** *** 830,832 **** --- 837,840 ---- return centerXF; } + } |
From: Flo L. <fl...@us...> - 2005-09-05 15:44:16
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14422/src/org/mediavirus/graphl/graph/filter Modified Files: FilteredGraph.java Log Message: corrected update behavior upon changes Index: FilteredGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/filter/FilteredGraph.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FilteredGraph.java 24 Aug 2005 16:06:33 -0000 1.2 --- FilteredGraph.java 5 Sep 2005 15:44:07 -0000 1.3 *************** *** 16,19 **** --- 16,20 ---- import org.mediavirus.graphl.graph.GraphListener; import org.mediavirus.graphl.graph.Node; + import org.mediavirus.graphl.vocabulary.NS; /** *************** *** 38,45 **** --- 39,48 ---- public void addFilter(GraphFilter filter) { filters.add(filter); + update(); } public void removeFilter(GraphFilter filter) { filters.remove(filter); + update(); } *************** *** 47,51 **** sourceGraph = graph; graph.addGraphListener(this); ! graphContentsChanged(graph); } --- 50,54 ---- sourceGraph = graph; graph.addGraphListener(this); ! update(); } *************** *** 72,85 **** */ public void graphContentsChanged(Graph graph) { cachedEdges.clear(); cachedNodes.clear(); ! Collection filteredEdges = filterEdges(graph.getEdges()); if (filteredEdges != null) cachedEdges.addAll(filteredEdges); ! Collection filteredNodes = filterNodes(graph.getNodes()); if (filteredNodes != null) cachedNodes.addAll(filteredNodes); ! fireGraphContentsChanged(); } --- 75,94 ---- */ public void graphContentsChanged(Graph graph) { + if (graph == sourceGraph) { + update(); + } + } + + public void update() { cachedEdges.clear(); cachedNodes.clear(); ! Collection filteredEdges = filterEdges(sourceGraph.getEdges()); if (filteredEdges != null) cachedEdges.addAll(filteredEdges); ! Collection filteredNodes = filterNodes(sourceGraph.getNodes()); if (filteredNodes != null) cachedNodes.addAll(filteredNodes); ! fireGraphContentsChanged(); } *************** *** 116,119 **** --- 125,131 ---- for (Iterator edgesI = edges.iterator(); edgesI.hasNext();) { Edge edge = (Edge) edgesI.next(); + if (edge.getType().equals(NS.rdfs + "subClassOf") && edge.getTo().getId().equals("http://xmlns.com/wordnet/1.6/Person")) { + System.out.println("foo"); + } if (filterEdge(edge, sourceGraph)) filteredEdges.add(edge); } *************** *** 174,192 **** */ public void elementsRemoved(Graph graph, Collection nodes, Collection edges) { ! List removedNodes = new ArrayList(); ! List removedEdges = new ArrayList(); ! for (Iterator nodesI = nodes.iterator(); nodesI.hasNext();) { ! Node node = (Node) nodesI.next(); ! if (cachedNodes.contains(node)) { ! cachedNodes.remove(node); ! removedNodes.add(node); } } ! for (Iterator edgesI = edges.iterator(); edgesI.hasNext();) { ! Edge edge = (Edge) edgesI.next(); ! if (cachedEdges.contains(edge)) { ! cachedEdges.remove(edge); ! removedEdges.add(edge); } } --- 186,210 ---- */ public void elementsRemoved(Graph graph, Collection nodes, Collection edges) { ! List removedNodes = null; ! List removedEdges = null; ! if (nodes != null) { ! removedNodes = new ArrayList(); ! for (Iterator nodesI = nodes.iterator(); nodesI.hasNext();) { ! Node node = (Node) nodesI.next(); ! if (cachedNodes.contains(node)) { ! cachedNodes.remove(node); ! removedNodes.add(node); ! } } } ! if (edges != null) { ! removedEdges = new ArrayList(); ! for (Iterator edgesI = edges.iterator(); edgesI.hasNext();) { ! Edge edge = (Edge) edgesI.next(); ! if (cachedEdges.contains(edge)) { ! cachedEdges.remove(edge); ! removedEdges.add(edge); ! } } } |
From: Flo L. <fl...@us...> - 2005-09-05 15:43:21
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14220/src/org/mediavirus/graphl/graph/filter Modified Files: SourceFilter.java Log Message: added convenience methods and constructor Index: SourceFilter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/filter/SourceFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SourceFilter.java 24 Aug 2005 16:08:04 -0000 1.1 --- SourceFilter.java 5 Sep 2005 15:43:13 -0000 1.2 *************** *** 25,28 **** --- 25,36 ---- protected boolean allMustMatch = true; + public SourceFilter() { + + } + + public SourceFilter(boolean rejectSources, boolean allMustMatch) { + this.rejectSources = rejectSources; + this.allMustMatch = allMustMatch; + } /** *************** *** 101,103 **** --- 109,123 ---- } + /** + * @return Returns the allMustMatch. + */ + public boolean isAllMustMatch() { + return allMustMatch; + } + /** + * @param allMustMatch The allMustMatch to set. + */ + public void setAllMustMatch(boolean allMustMatch) { + this.allMustMatch = allMustMatch; + } } |
From: Flo L. <fl...@us...> - 2005-09-05 15:42:29
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14014/src/org/mediavirus/graphl/graph Modified Files: Node.java Log Message: added invertPin() method to update node if an edge is inverted Index: Node.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/Node.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Node.java 29 Dec 2004 14:31:33 -0000 1.11 --- Node.java 5 Sep 2005 15:42:17 -0000 1.12 *************** *** 102,105 **** --- 102,107 ---- */ public void setCurrentLayouter(NodeLayouter layouter); + + void invertPin(Edge edge); } |
From: Flo L. <fl...@us...> - 2005-09-05 15:41:32
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13810/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFNode.java Log Message: removed getLabel() method Index: RDFNode.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFNode.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RDFNode.java 24 Aug 2005 16:10:43 -0000 1.9 --- RDFNode.java 5 Sep 2005 15:41:23 -0000 1.10 *************** *** 12,17 **** import org.mediavirus.graphl.graph.DefaultNode; import org.mediavirus.graphl.graph.Node; - import org.mediavirus.graphl.vocabulary.NS; - import org.mediavirus.util.ParseUtils; /** --- 12,15 ---- *************** *** 49,63 **** } - // TODO (2, 2h) label generation mechanism has to be hooked up here - public String getLabel() { - String label = getProperty(NS.graphl + "label"); - if ( label != null) return label; - else { - label = ParseUtils.guessName(getId()); - } - if (label != null) return label; - else return ""; - } - public String getType() { Node n = getFirstNeighbour("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", true); --- 47,50 ---- |
From: Flo L. <fl...@us...> - 2005-09-05 15:40:17
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13589/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFGraph.java Log Message: added static method to write arbitrary graph to RDF Index: RDFGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFGraph.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RDFGraph.java 24 Aug 2005 16:10:22 -0000 1.10 --- RDFGraph.java 5 Sep 2005 15:40:08 -0000 1.11 *************** *** 21,24 **** --- 21,25 ---- import org.mediavirus.graphl.graph.DefaultGraph; import org.mediavirus.graphl.graph.Edge; + import org.mediavirus.graphl.graph.Graph; import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.vocabulary.NS; *************** *** 52,57 **** return (RDFNode)allNodes.get(id); } ! ! public void writeToRDF(OutputStream out) throws IOException { RDFWriter writer = new RDFWriter(); --- 53,58 ---- return (RDFNode)allNodes.get(id); } ! ! public static void writeToRDF(Graph graph, OutputStream out, String baseURL) throws IOException { RDFWriter writer = new RDFWriter(); *************** *** 64,67 **** --- 65,72 ---- writer.addNamespacePrefix("map","http://fabl.net/vocabularies/geography/map/1.1/"); writer.addNamespacePrefix("geo","http://www.w3.org/2003/01/geo/wgs84_pos#"); + writer.addNamespacePrefix("dc","http://purl.org/dc/elements/1.1/"); + writer.addNamespacePrefix("foo","http://www.mediavirus.org/foo#"); + writer.addNamespacePrefix("vs","http://www.w3.org/2003/06/sw-vocab-status/ns#"); + writer.addNamespacePrefix("wot","http://xmlns.com/wot/0.1/"); writer.prepareNamespaceCollection(); *************** *** 74,77 **** --- 79,86 ---- writer.collectNamespace("http://fabl.net/vocabularies/geography/map/1.1/"); writer.collectNamespace("http://www.w3.org/2003/01/geo/wgs84_pos#"); + writer.collectNamespace("http://purl.org/dc/elements/1.1/"); + writer.collectNamespace("http://www.mediavirus.org/foo#"); + writer.collectNamespace("http://www.w3.org/2003/06/sw-vocab-status/ns#"); + writer.collectNamespace("http://xmlns.com/wot/0.1/"); OutputStreamWriter owriter = new OutputStreamWriter(out); *************** *** 79,94 **** writer.startRDFContents(); ! List allNodes = getNodes(); for (Iterator iter = allNodes.iterator(); iter.hasNext();) { ! RDFNode node = (RDFNode) iter.next(); for (Iterator attrs = node.getProperties().keySet().iterator(); attrs.hasNext();) { String attr = (String) attrs.next(); ! writer.writeStatement(node.getId(), attr, node.getProperty(attr), null, null, true); } - //writer.writeStatement(node.getId(), NS.graphl + "canvasPosition", node.getCenterX() + ":" + node.getCenterY(), null, null, true); List nodeEdges = node.getEdgesFrom(); for (Iterator edgeIter = nodeEdges.iterator(); edgeIter.hasNext();) { ! RDFEdge edge = (RDFEdge) edgeIter.next(); ! writer.writeStatement(node.getId(), edge.getType(), ((RDFNode)edge.getTo()).getId(), null, null, false); } } --- 88,117 ---- writer.startRDFContents(); ! List allNodes = graph.getNodes(); ! List allEdges = graph.getEdges(); ! for (Iterator iter = allNodes.iterator(); iter.hasNext();) { ! Node node = (Node) iter.next(); ! ! String id = node.getId(); ! if ((baseURL != null) && (id.startsWith(baseURL)) && (id.lastIndexOf('#')>-1)) { ! id = id.substring(id.lastIndexOf('#')); ! } ! for (Iterator attrs = node.getProperties().keySet().iterator(); attrs.hasNext();) { String attr = (String) attrs.next(); ! writer.writeStatement(id, attr, node.getProperty(attr), null, null, true); } List nodeEdges = node.getEdgesFrom(); for (Iterator edgeIter = nodeEdges.iterator(); edgeIter.hasNext();) { ! Edge edge = (Edge) edgeIter.next(); ! // TODO (3) this would be a reason to have a FilteredNode class that returns only filtered edges... ! if (allEdges.contains(edge)) { ! String toId = edge.getTo().getId(); ! if ((baseURL != null) && (toId.startsWith(baseURL)) && (toId.lastIndexOf('#')>-1)) { ! toId = toId.substring(toId.lastIndexOf('#')); ! } ! writer.writeStatement(id, edge.getType(), toId, null, null, false); ! } } } *************** *** 96,99 **** --- 119,127 ---- writer.finishRDFContents(); writer.cleanUp(); + + } + + public void writeToRDF(OutputStream out, String baseURL) throws IOException { + writeToRDF(this, out, baseURL); } *************** *** 107,110 **** --- 135,144 ---- sourceNode = getNodeOrNew(loadingURL.toString()); + + if (sourceNode.getNeighbours(NS.graphl + "definedIn", true).size() == 0) { + Edge edge = createEdge(sourceNode, sourceNode); + edge.setSource(NS.graphl + "SYSTEM"); + edge.setType(NS.graphl + "definedIn"); + } InputSource input = new InputSource(new FileReader(f)); *************** *** 121,124 **** --- 155,164 ---- sourceNode = getNodeOrNew(loadingURL.toString()); + if (sourceNode.getNeighbours(NS.graphl + "definedIn", true).size() == 0) { + Edge edge = createEdge(sourceNode, sourceNode); + edge.setSource(NS.graphl + "SYSTEM"); + edge.setType(NS.graphl + "definedIn"); + } + InputSource input; try { *************** *** 287,295 **** public void statementWithLiteralValue(String subject, String predicate, String object, String language, String datatype) throws SAXException { ! // TODO (2): for incremental loading, check if these things are already set ! ! //if (predicate.equals(NS.graphl + "connectedTo")) { ! // get / create node with label subject ! if (loadingURL != null) { try { --- 327,331 ---- public void statementWithLiteralValue(String subject, String predicate, String object, String language, String datatype) throws SAXException { ! // get absolute URL for subject if (loadingURL != null) { try { |
From: Flo L. <fl...@us...> - 2005-09-05 15:38:55
|
Update of /cvsroot/graphl/graphl/graphs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13311/graphs Modified Files: test.rdf Log Message: test file Index: test.rdf =================================================================== RCS file: /cvsroot/graphl/graphl/graphs/test.rdf,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test.rdf 21 Aug 2004 22:26:36 -0000 1.5 --- test.rdf 5 Sep 2005 15:38:45 -0000 1.6 *************** *** 2,21 **** <!DOCTYPE rdf:RDF [ <!ENTITY graphl 'http://www.mediavirus.org/graphl#'> <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'> ]> <rdf:RDF xml:base="" xmlns:graphl="&graphl;" ! xmlns:rdf="&rdf;"> ! <rdf:Gaga rdf:about="node0" ! graphl:hasLabel="Node 0" ! graphl:canvasPosition="-74.26063988745234:-10.214864217370325"> ! <graphl:connectedTo rdf:resource="node1"/> ! </rdf:Gaga> ! <rdf:Gaga rdf:about="node1" ! graphl:hasLabel="Node 1" ! graphl:canvasPosition="-150.70440130568647:-62.88553683865669"> ! </rdf:Gaga> </rdf:RDF> --- 2,57 ---- <!DOCTYPE rdf:RDF [ <!ENTITY graphl 'http://www.mediavirus.org/graphl#'> + <!ENTITY foaf 'http://xmlns.com/foaf/0.1/'> + <!ENTITY foo 'http://www.mediavirus.org/foo#'> <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'> + <!ENTITY map 'http://fabl.net/vocabularies/geography/map/1.1/'> + <!ENTITY owl 'http://www.w3.org/2002/07/owl#'> + <!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'> + <!ENTITY vs 'http://www.w3.org/2003/06/sw-vocab-status/ns#'> + <!ENTITY wot 'http://xmlns.com/wot/0.1/'> + <!ENTITY geo 'http://www.w3.org/2003/01/geo/wgs84_pos#'> + <!ENTITY dc 'http://purl.org/dc/elements/1.1/'> ]> <rdf:RDF xml:base="" xmlns:graphl="&graphl;" ! xmlns:foaf="&foaf;" ! xmlns:foo="&foo;" ! xmlns:rdf="&rdf;" ! xmlns:map="↦" ! xmlns:owl="&owl;" ! xmlns:rdfs="&rdfs;" ! xmlns:vs="&vs;" ! xmlns:wot="&wot;" ! xmlns:geo="&geo;" ! xmlns:dc="&dc;"> ! <rdf:Description rdf:about="&foaf;Person" ! rdfs:comment="A person." ! vs:term_status="testing" ! rdfs:label="Person"/> ! <foaf:Person rdf:ID="genid1" ! foaf:firstName="Patrizia" ! foaf:gender="female" ! foaf:name="Padme Pistazie" ! foaf:surname="Wiesner" ! foaf:nick="padme"> ! <foaf:knows rdf:resource="#genid2"/> ! <foaf:knows rdf:resource="#genid4"/> ! <foaf:knows rdf:resource="#genid5"/> ! <graphl:connectedTo rdf:resource="#genid0"/> ! </foaf:Person> ! <foaf:Person rdf:ID="genid2" ! foaf:name="Sue"> ! <foaf:knows rdf:resource="#genid3"/> ! </foaf:Person> ! <foaf:Person rdf:ID="genid3" ! foaf:name="Axel Goldmann"/> ! <foaf:Person rdf:ID="genid4" ! foaf:name="Flo"/> ! <foaf:Person rdf:ID="genid5" ! foaf:name="Flo Ledermann"/> ! <rdf:Description rdf:ID="genid0" ! foaf:name="a"/> </rdf:RDF> |
From: Flo L. <fl...@us...> - 2005-08-24 16:13:05
|
Update of /cvsroot/graphl/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7045 Modified Files: changelog.txt Log Message: updated changelog Index: changelog.txt =================================================================== RCS file: /cvsroot/graphl/graphl/changelog.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** changelog.txt 17 Aug 2005 15:52:53 -0000 1.14 --- changelog.txt 24 Aug 2005 16:12:56 -0000 1.15 *************** *** 2,5 **** --- 2,16 ---- ================== + 2005-08-24, f/0: + - FEATURE: files are now loaded in addition to existing graph + - FEATURE: minor adjustments to layout algorithm + - FEATURE: added SourceFilter that filters nodes depending on their origin + - BUG: FilteredGraph now delivers consistent graphs + - BUG: fixed assignment of id's to nodes (now using full URL) + - BUG: fixed InPlaceTextFieldEditor + - BUG: fixed context menu popup upon creation of new node + - CODE: added addElements() method to graph interface + + 2005-08-17, f/0: - FEATURE: added navigator thread for update-exhibition, disabled in normal operation |
From: Flo L. <fl...@us...> - 2005-08-24 16:12:49
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6988/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: fixed context menu popup upon creation of new node Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GraphlManipulator.java 17 Aug 2005 15:52:55 -0000 1.10 --- GraphlManipulator.java 24 Aug 2005 16:12:41 -0000 1.11 *************** *** 136,139 **** --- 136,156 ---- public void resourceChanged(String resource) { newNode.setType(resource); + TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, newNode, new NodeEditingController() { + + public Object editingStarted(Node node) { + return node.getProperty(NS.foaf + "name"); + } + + public boolean editingFinished(Node node, Object value) { + if (!((String)value).equals("")) { + ((RDFNode)node).setProperty(NS.foaf + "name",(String)value); + } + return true; + } + + public void editingAborted(Node node) { + } + } ); + editor.startEditing(); graphPane.getGraph().notifyPropertyChanged(); graphPane.repaint(); *************** *** 150,153 **** --- 167,171 ---- TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, clickNode, this); editor.startEditing(); + graphPane.repaint(); } else if (clickEdge != null) { *************** *** 158,161 **** --- 176,180 ---- clickEdge.invert(); graphPane.getGraph().notifyLayoutUpdated(); + graphPane.repaint(); } } *************** *** 173,176 **** --- 192,196 ---- else { graphPane.getSelection().addNode(clickNode); + System.out.println(clickNode.getType()); } graphPane.getGraph().notifyLayoutUpdated(); *************** *** 227,231 **** // we also allow multiple edges between two nodes! RDFEdge edge = new RDFEdge(edgeNode, overNode); ! ((DefaultGraph)graphPane.getGraph()).addElements(null, Collections.singleton(edge)); } else if ( overNode!=edgeNode ) { --- 247,251 ---- // we also allow multiple edges between two nodes! RDFEdge edge = new RDFEdge(edgeNode, overNode); ! graphPane.getGraph().addElements(null, Collections.singleton(edge)); } else if ( overNode!=edgeNode ) { *************** *** 235,238 **** --- 255,259 ---- Point d = new Point(); graphPane.screenToGraphPoint(dragStart,d); + // TODO (3) length should be mapped to arbitrary property! ((DefaultEdge)edge).setLength(dragStart.distance(d)); ((DefaultGraph)graphPane.getGraph()).addElements(Collections.singleton(newNode), Collections.singleton(edge)); *************** *** 320,329 **** public Object editingStarted(Node node) { ! return ((RDFNode)node).getLabel(); } public boolean editingFinished(Node node, Object value) { if (!((String)value).equals("")) { ! ((RDFNode)node).setProperty(NS.graphl + "label",(String)value); } return true; --- 341,350 ---- public Object editingStarted(Node node) { ! return node.getProperty(NS.foaf + "name"); } public boolean editingFinished(Node node, Object value) { if (!((String)value).equals("")) { ! ((RDFNode)node).setProperty(NS.foaf + "name",(String)value); } return true; |
From: Flo L. <fl...@us...> - 2005-08-24 16:11:58
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6879/src/org/mediavirus/graphl/graph Modified Files: Graph.java Log Message: added addElements() method to graph interface Index: Graph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/Graph.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Graph.java 17 Aug 2005 15:52:50 -0000 1.5 --- Graph.java 24 Aug 2005 16:11:50 -0000 1.6 *************** *** 1,4 **** --- 1,5 ---- package org.mediavirus.graphl.graph; + import java.util.Collection; import java.util.List; *************** *** 47,50 **** --- 48,53 ---- public Edge createEdge(Node from, Node to); + + public void addElements(Collection nodes, Collection edges); } |
From: Flo L. <fl...@us...> - 2005-08-24 16:11:23
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6541/src/org/mediavirus/graphl/gui Modified Files: TextFieldInPlaceNodeEditor.java InPlaceNodeEditor.java Log Message: fixed InPlaceTextFieldEditor Index: TextFieldInPlaceNodeEditor.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/TextFieldInPlaceNodeEditor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TextFieldInPlaceNodeEditor.java 21 Aug 2004 22:31:00 -0000 1.2 --- TextFieldInPlaceNodeEditor.java 24 Aug 2005 16:11:15 -0000 1.3 *************** *** 73,76 **** --- 73,78 ---- Rectangle nodeBounds=new Rectangle(); m_graphPane.getNodeScreenBounds(m_node,nodeBounds); + if (nodeBounds.width < 150) nodeBounds.width = 100; + if (nodeBounds.height < 15) nodeBounds.height = 15; m_component.setLocation(nodeBounds.x-4,nodeBounds.y-4); m_component.setSize(nodeBounds.width+8,nodeBounds.height+8); Index: InPlaceNodeEditor.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/InPlaceNodeEditor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InPlaceNodeEditor.java 21 Aug 2004 22:31:00 -0000 1.2 --- InPlaceNodeEditor.java 24 Aug 2005 16:11:15 -0000 1.3 *************** *** 31,35 **** protected Object m_initialValue; ! public InPlaceNodeEditor(GraphlPane graphPane,Node node,NodeEditingController nodeEditingController) { m_graphPane=graphPane; m_node=node; --- 31,35 ---- protected Object m_initialValue; ! public InPlaceNodeEditor(GraphlPane graphPane, Node node, NodeEditingController nodeEditingController) { m_graphPane=graphPane; m_node=node; *************** *** 113,117 **** * @param edges the edges added (may be <code>null</code>) */ ! public void elementsAdded(Graph graph,Collection nodes,Collection edges) { } /** --- 113,117 ---- * @param edges the edges added (may be <code>null</code>) */ ! public void elementsAdded(Graph graph, Collection nodes, Collection edges) { } /** *************** *** 122,126 **** * @param edges the edges added (may be <code>null</code>) */ ! public void elementsRemoved(final Graph graph,final Collection nodes,final Collection edges) { if (SwingUtilities.isEventDispatchThread()) elementsRemovedInternal(graph,nodes,edges); --- 122,126 ---- * @param edges the edges added (may be <code>null</code>) */ ! public void elementsRemoved(final Graph graph, final Collection nodes, final Collection edges) { if (SwingUtilities.isEventDispatchThread()) elementsRemovedInternal(graph,nodes,edges); *************** *** 139,143 **** * @param edges the edges added (may be <code>null</code>) */ ! protected void elementsRemovedInternal(Graph graph,Collection nodes,Collection edges) { if (nodes!=null) { Iterator iterator=nodes.iterator(); --- 139,143 ---- * @param edges the edges added (may be <code>null</code>) */ ! protected void elementsRemovedInternal(Graph graph, Collection nodes, Collection edges) { if (nodes!=null) { Iterator iterator=nodes.iterator(); |
From: Flo L. <fl...@us...> - 2005-08-24 16:10:52
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6123/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFNode.java Log Message: code cleanup Index: RDFNode.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFNode.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RDFNode.java 17 Aug 2005 15:52:53 -0000 1.8 --- RDFNode.java 24 Aug 2005 16:10:43 -0000 1.9 *************** *** 61,79 **** public String getType() { ! Iterator edges = getEdgesFrom().iterator(); ! while (edges.hasNext()) { ! RDFEdge e = (RDFEdge)edges.next(); ! if (e.getType() == "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") return ((RDFNode)e.getTo()).getId(); ! } ! return null; } public boolean hasType(String type) { ! Iterator edges = getEdgesFrom().iterator(); ! while (edges.hasNext()) { ! RDFEdge e = (RDFEdge)edges.next(); ! if (e.getType() == "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") { ! if (((RDFNode)e.getTo()).getId().equals(type)) return true; ! } } return false; --- 61,74 ---- public String getType() { ! Node n = getFirstNeighbour("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", true); ! if (n != null) return n.getId(); ! else return null; } public boolean hasType(String type) { ! Iterator types = getNeighbours("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", true).iterator(); ! while (types.hasNext()) { ! Node n = (Node)types.next(); ! if (n.getId().equals(type)) return true; } return false; |
From: Flo L. <fl...@us...> - 2005-08-24 16:10:30
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6025/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFGraph.java Log Message: fixed assignment of id's to nodes (now using full URL) Index: RDFGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFGraph.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RDFGraph.java 17 Aug 2005 15:52:53 -0000 1.9 --- RDFGraph.java 24 Aug 2005 16:10:22 -0000 1.10 *************** *** 99,102 **** --- 99,103 ---- public void readFromFile(String filename) throws IOException { + System.out.println("reading file " + filename); File f = new File(filename); try { *************** *** 171,174 **** --- 172,191 ---- //if (predicate.equals(NS.graphl + "connectedTo")) { // get / create node with label subject + + if (loadingURL != null) { + try { + subject = new URL(loadingURL, subject).toString(); + } + catch (MalformedURLException muex) { + // do nothing + } + try { + object = new URL(loadingURL, object).toString(); + } + catch (MalformedURLException muex) { + // do nothing + } + } + Node snode; Node onode; *************** *** 198,204 **** if (predicate.equals("http://www.w3.org/2002/07/owl#imports")) { - System.out.println("#### " + object); try { URL oldBase = loadingURL; URL importURL = new URL(loadingURL, object); System.out.println("importing " + importURL.toString() + " ... "); --- 215,221 ---- if (predicate.equals("http://www.w3.org/2002/07/owl#imports")) { try { URL oldBase = loadingURL; + Node oldSource = sourceNode; URL importURL = new URL(loadingURL, object); System.out.println("importing " + importURL.toString() + " ... "); *************** *** 206,209 **** --- 223,227 ---- // restore original base url loadingURL = oldBase; + sourceNode = oldSource; } catch (MalformedURLException muex) { *************** *** 271,296 **** // TODO (2): for incremental loading, check if these things are already set ! if (predicate.equals(NS.graphl + "canvasPosition")) { ! RDFNode snode = getNodeById(subject); ! if (snode != null){ ! double x = Double.parseDouble(object.substring(0,object.indexOf(':'))); ! double y = Double.parseDouble(object.substring(object.indexOf(':')+1)); ! snode.setCenter(x,y); ! } ! } ! else { ! //if (predicate.equals(NS.graphl + "connectedTo")) { ! // get / create node with label subject ! Node snode; try { ! snode = getNodeOrNew(subject); ! snode.setProperty(predicate, object); ! if (DEBUG) System.out.println("created property " + subject + ", " + predicate + ", " + object); } ! catch (Exception ex) { ! if (DEBUG) System.out.println("Error while reading triple: " + subject + ", " + predicate + ", " + object); ! // ex.printStackTrace(); } } } --- 289,313 ---- // TODO (2): for incremental loading, check if these things are already set ! //if (predicate.equals(NS.graphl + "connectedTo")) { ! // get / create node with label subject ! ! if (loadingURL != null) { try { ! subject = new URL(loadingURL, subject).toString(); } ! catch (MalformedURLException muex) { ! // do nothing } } + + Node snode; + try { + snode = getNodeOrNew(subject); + snode.setProperty(predicate, object); + if (DEBUG) System.out.println("created property " + subject + ", " + predicate + ", " + object); + } + catch (Exception ex) { + if (DEBUG) System.out.println("Error while reading triple: " + subject + ", " + predicate + ", " + object); + } } |
From: Flo L. <fl...@us...> - 2005-08-24 16:09:37
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5730/src/org/mediavirus/graphl Modified Files: GraphlApplication.java Log Message: files are now loaded in addition to existing graph Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** GraphlApplication.java 17 Aug 2005 15:52:51 -0000 1.19 --- GraphlApplication.java 24 Aug 2005 16:09:30 -0000 1.20 *************** *** 34,38 **** import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.graph.filter.FilteredGraph; ! import org.mediavirus.graphl.graph.filter.TestFilter; import org.mediavirus.graphl.graph.rdf.RDFGraph; import org.mediavirus.graphl.gui.GenericDialog; --- 34,38 ---- import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.graph.filter.FilteredGraph; ! import org.mediavirus.graphl.graph.filter.SourceFilter; import org.mediavirus.graphl.graph.rdf.RDFGraph; import org.mediavirus.graphl.gui.GenericDialog; *************** *** 97,101 **** FilteredGraph fgraph = new FilteredGraph(new RDFGraph()); ! fgraph.addFilter(new TestFilter()); mainPanel = new GraphlPanel(fgraph); --- 97,106 ---- FilteredGraph fgraph = new FilteredGraph(new RDFGraph()); ! SourceFilter filter = new SourceFilter(); ! 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"); ! fgraph.addFilter(filter); mainPanel = new GraphlPanel(fgraph); *************** *** 402,406 **** mainPanel.getGraphPane().pauseLayouter(); ! mainPanel.getGraph().clear(); mainPanel.getGraph().readFromFile(file.getAbsolutePath()); --- 407,411 ---- mainPanel.getGraphPane().pauseLayouter(); ! //mainPanel.getGraph().clear(); mainPanel.getGraph().readFromFile(file.getAbsolutePath()); |
From: Flo L. <fl...@us...> - 2005-08-24 16:09:07
|
Update of /cvsroot/graphl/graphl/graphs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5515/graphs Added Files: .cvsignore foaf-flo.rdf Removed Files: foaf-owl.rdf foaf.rdf Log Message: renamed flo's foaf file, removed redundant foaf rdfs --- NEW FILE: foaf-flo.rdf --- <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE rdf:RDF [ <!ENTITY graphl 'http://www.mediavirus.org/graphl#'> <!ENTITY foaf 'http://xmlns.com/foaf/0.1/'> <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'> <!ENTITY map 'http://fabl.net/vocabularies/geography/map/1.1/'> <!ENTITY owl 'http://www.w3.org/2002/07/owl#'> <!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'> <!ENTITY geo 'http://www.w3.org/2003/01/geo/wgs84_pos#'> ]> <rdf:RDF xml:base="" xmlns:graphl="&graphl;" xmlns:foaf="&foaf;" xmlns:rdf="&rdf;" xmlns:map="↦" xmlns:owl="&owl;" xmlns:rdfs="&rdfs;" xmlns:geo="&geo;"> <foaf:Person rdf:ID="genid1" foaf:firstName="Florian" foaf:myersBriggs="INFJ" foaf:gender="male" foaf:name="Flo Ledermann" foaf:surname="Ledermann" foaf:jabberID="fl...@wa..." foaf:nick="f/0"> <foaf:mbox rdf:resource="mailto:fl...@su..."/> <foaf:mbox rdf:resource="mailto:led...@im..."/> <foaf:depiction rdf:resource="http://www.ims.tuwien.ac.at/~flo/images/flo.jpg"/> <foaf:homepage rdf:resource="http://www.mediavirus.org/f/0"/> <foaf:workplaceHomepage rdf:resource="http://www.ims.tuwien.ac.at/"/> <foaf:workInfoHomepage rdf:resource="http://www.ims.tuwien.ac.at/~flo"/> <foaf:interest rdf:resource="#genid2"/> <foaf:interest rdf:resource="#genid3"/> <foaf:pastProject rdf:resource="#genid4"/> <foaf:interest rdf:resource="#genid5"/> <foaf:pastProject rdf:resource="#genid6"/> <foaf:pastProject rdf:resource="#genid7"/> <foaf:pastProject rdf:resource="#genid8"/> <foaf:pastProject rdf:resource="#genid9"/> <foaf:pastProject rdf:resource="#genid10"/> <foaf:knows rdf:resource="#genid11"/> <foaf:knows rdf:resource="#genid12"/> <foaf:knows rdf:resource="#genid13"/> <foaf:knows rdf:resource="#genid15"/> <foaf:knows rdf:resource="#genid16"/> <foaf:knows rdf:resource="#genid17"/> <foaf:knows rdf:resource="#genid18"/> <foaf:knows rdf:resource="#genid19"/> <foaf:knows rdf:resource="#genid20"/> <foaf:knows rdf:resource="#genid1"/> <foaf:knows rdf:resource="#genid1"/> </foaf:Person> <foaf:Image rdf:about="http://www.ims.tuwien.ac.at/~flo/images/flo.jpg"/> <foaf:Document rdf:about="http://www.mediavirus.org/f/0"/> <foaf:Document rdf:about="http://www.ims.tuwien.ac.at/"/> <foaf:Document rdf:about="http://www.ims.tuwien.ac.at/~flo"/> <foaf:Project rdf:ID="genid2" foaf:name="Mozilla"> <foaf:homepage rdf:resource="http://www.mozilla.org/"/> </foaf:Project> <foaf:Project rdf:ID="genid3" foaf:name="FOAF"> <foaf:homepage rdf:resource="http://rdfweb.org/"/> </foaf:Project> <foaf:Project rdf:ID="genid4" foaf:name="Studierstube"> <foaf:homepage rdf:resource="http://www.studierstube.org/"/> </foaf:Project> <foaf:Project rdf:ID="genid5" foaf:name="Wind Machines"> <foaf:homepage rdf:resource="http://www.greeleynet.com/~cmorrison/WindMachine.html"/> </foaf:Project> <foaf:Project rdf:ID="genid6" foaf:name="APRIL"> <foaf:homepage rdf:resource="http://www.studierstube.org/APRIL/"/> </foaf:Project> <foaf:Project rdf:ID="genid7" foaf:name="The Virtual Showcase"> <foaf:homepage rdf:resource="http://www.studierstube.org/virtualshowcase/"/> </foaf:Project> <foaf:Project rdf:ID="genid8" foaf:name="mprox"> <foaf:homepage rdf:resource="http://mprox.subnet.at/"/> </foaf:Project> <foaf:Project rdf:ID="genid9" foaf:name="Mudfuzz"> <foaf:homepage rdf:resource="http://www.mudfuzz.com/"/> </foaf:Project> <foaf:Project rdf:ID="genid10" foaf:name="subnet"> <foaf:homepage rdf:resource="http://www.subnet.at/"/> </foaf:Project> <foaf:Person rdf:ID="genid11" foaf:name="Axel Goldmann"/> <foaf:Person rdf:ID="genid12" foaf:name="Ruediger Suppin"/> <foaf:Person rdf:ID="genid13" foaf:name="Bruno Randolf"> <foaf:pastProject rdf:resource="#genid10"/> <foaf:pastProject rdf:resource="#genid8"/> </foaf:Person> <foaf:Person rdf:ID="genid15" foaf:name="Ruth Ettl"/> <foaf:Person rdf:ID="genid16" foaf:name="Josh Benda"> <foaf:knows rdf:resource="#genid11"/> <foaf:pastProject rdf:resource="#genid9"/> </foaf:Person> <foaf:Person rdf:ID="genid17" foaf:name="David Baum"> <foaf:knows rdf:resource="#genid12"/> </foaf:Person> <foaf:Person rdf:ID="genid18" foaf:name="Tamer Fahmy"> <foaf:knows rdf:resource="#genid20"/> <foaf:currentProject rdf:resource="#genid4"/> </foaf:Person> <foaf:Person rdf:ID="genid19" foaf:name="Michael Kalkusch"> <foaf:knows rdf:resource="#genid18"/> </foaf:Person> <foaf:Person rdf:ID="genid20" foaf:name="Gerhard Reitmayr"> <foaf:workplaceHomepage rdf:resource="http://www.ims.tuwien.ac.at/"/> <foaf:currentProject rdf:resource="#genid4"/> </foaf:Person> <foaf:Document rdf:about="http://www.mozilla.org/"/> <foaf:Document rdf:about="http://rdfweb.org/"/> <foaf:Document rdf:about="http://www.studierstube.org/"/> <foaf:Document rdf:about="http://www.greeleynet.com/~cmorrison/WindMachine.html"/> <foaf:Document rdf:about="http://www.studierstube.org/APRIL/"/> <foaf:Document rdf:about="http://www.studierstube.org/virtualshowcase/"/> <foaf:Document rdf:about="http://mprox.subnet.at/"/> <foaf:Document rdf:about="http://www.mudfuzz.com/"/> <foaf:Document rdf:about="http://www.subnet.at/"/> </rdf:RDF> --- NEW FILE: .cvsignore --- foaf-padme.rdf --- foaf.rdf DELETED --- --- foaf-owl.rdf DELETED --- |
From: Flo L. <fl...@us...> - 2005-08-24 16:08:15
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4993/src/org/mediavirus/graphl/graph/filter Added Files: SourceFilter.java Removed Files: TestFilter.java Log Message: added SourceFilter that filters nodes depending on their origin --- NEW FILE: SourceFilter.java --- /* * Created on 24.08.2005 */ package org.mediavirus.graphl.graph.filter; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import org.mediavirus.graphl.graph.Edge; import org.mediavirus.graphl.graph.Graph; import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.vocabulary.NS; /** * @author flo */ public class SourceFilter implements GraphFilter { protected List sources = new LinkedList(); protected boolean rejectSources = true; protected boolean allMustMatch = true; /** * @see org.mediavirus.graphl.graph.filter.GraphFilter#acceptNode(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.graph.Graph) */ public boolean acceptNode(Node node, Graph graph) { boolean result = rejectSources; for (Iterator nodesI = node.getNeighbours(NS.graphl + "definedIn", true).iterator(); nodesI.hasNext();) { Node source = (Node) nodesI.next(); boolean match = false; for (Iterator sourcesI = sources.iterator(); sourcesI.hasNext();) { String url = (String) sourcesI.next(); if (source.getId().equals(url)){ match = true; break; } } if (match) { if (!allMustMatch) { return !rejectSources; } else { result = !rejectSources; } } else { if (allMustMatch) return rejectSources; } } return result; } /** * @see org.mediavirus.graphl.graph.filter.GraphFilter#acceptEdge(org.mediavirus.graphl.graph.Edge, org.mediavirus.graphl.graph.Graph) */ public boolean acceptEdge(Edge edge, Graph graph) { boolean match = false; for (Iterator sourcesI = sources.iterator(); sourcesI.hasNext();) { String url = (String) sourcesI.next(); if (url.equals(edge.getSource())){ match = true; break; } } if (match) { return !rejectSources; } else { return rejectSources; } } public boolean isRejectSources() { return rejectSources; } public void setRejectSources(boolean rejectSources) { this.rejectSources = rejectSources; } public void addSource(String url) { sources.add(url); } public void removeSource(String url) { sources.remove(url); } public Collection getSources() { return sources; } } --- TestFilter.java DELETED --- |
From: Flo L. <fl...@us...> - 2005-08-24 16:06:41
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4236/src/org/mediavirus/graphl/graph/filter Modified Files: FilteredGraph.java Log Message: filteredGraph now delivers consistent graphs Index: FilteredGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/filter/FilteredGraph.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FilteredGraph.java 17 Aug 2005 15:52:51 -0000 1.1 --- FilteredGraph.java 24 Aug 2005 16:06:33 -0000 1.2 *************** *** 89,98 **** public void elementsAdded(Graph graph, Collection nodes, Collection edges) { Collection filteredEdges = filterEdges(edges); - if (filteredEdges != null) cachedEdges.addAll(filteredEdges); ! Collection filteredNodes = filterNodes(nodes); if (filteredNodes != null) cachedNodes.addAll(filteredNodes); ! fireElementsAdded(filteredNodes, filteredEdges); } --- 89,108 ---- public void elementsAdded(Graph graph, Collection nodes, Collection edges) { + Collection filteredNodes = filterNodes(nodes); Collection filteredEdges = filterEdges(edges); ! if (filteredEdges != null) { ! cachedEdges.addAll(filteredEdges); ! ! if (filteredNodes == null) filteredNodes = new ArrayList(); ! for (Iterator edgesI = filteredEdges.iterator(); edgesI.hasNext();) { ! Edge edge = (Edge) edgesI.next(); ! if (! filteredNodes.contains(edge.getFrom())) filteredNodes.add(edge.getFrom()); ! if (! filteredNodes.contains(edge.getTo())) filteredNodes.add(edge.getTo()); ! } ! } ! if (filteredNodes != null) cachedNodes.addAll(filteredNodes); ! fireElementsAdded(filteredNodes, filteredEdges); } *************** *** 220,222 **** --- 230,235 ---- } + public void addElements(Collection nodes, Collection edges) { + sourceGraph.addElements(nodes, edges); + } } |