graphl-cvs Mailing List for Graphl - Hybrid graph visualization tool (Page 9)
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...> - 2004-10-19 16:17:52
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17517/src/org/mediavirus/graphl/gui Modified Files: NodeContextMenu.java CustomTypePanel.java EdgeContextMenu.java Log Message: - FEATURE further commandline options to remove controls and menubar - FEATURE load url from commandline - FEATURE refresh every n seconds commandline option - FEATURE affine coordinate transformation for geo positioning on a map - FEATURE removed length property of edge, replaced by generic length calculation from any property in springEdgeLayouter - FEATURE configurable stroke for BoxNodePainter, ShapeNodePainter - FEATURE replaced rdfutils function by own implementation in ParseUtils Index: EdgeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/EdgeContextMenu.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** EdgeContextMenu.java 14 Oct 2004 13:03:02 -0000 1.12 --- EdgeContextMenu.java 19 Oct 2004 16:17:06 -0000 1.13 *************** *** 24,27 **** --- 24,28 ---- import org.mediavirus.graphl.vocabulary.ResourceMenu; import org.mediavirus.graphl.vocabulary.Vocabulary; + import org.mediavirus.util.ParseUtils; import edu.unika.aifb.rdf.api.util.RDFUtil; *************** *** 158,162 **** for (Iterator iter = types.iterator(); iter.hasNext();) { String descriptor = (String) iter.next(); ! JRadioButtonMenuItem item = new JRadioButtonMenuItem(RDFUtil.guessName(descriptor)); if ((currentEdge.getType() != null) && (currentEdge.getType().equals(descriptor))) { item.setSelected(true); --- 159,163 ---- for (Iterator iter = types.iterator(); iter.hasNext();) { String descriptor = (String) iter.next(); ! JRadioButtonMenuItem item = new JRadioButtonMenuItem(ParseUtils.guessName(descriptor)); if ((currentEdge.getType() != null) && (currentEdge.getType().equals(descriptor))) { item.setSelected(true); *************** *** 184,188 **** if (hasCustomType) { ! otherTypeMenuItem.setText("Other (" + RDFUtil.guessName(edge.getType()) + ") ..."); otherTypeMenuItem.setSelected(true); } --- 185,189 ---- if (hasCustomType) { ! otherTypeMenuItem.setText("Other (" + ParseUtils.guessName(edge.getType()) + ") ..."); otherTypeMenuItem.setSelected(true); } Index: NodeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/NodeContextMenu.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NodeContextMenu.java 14 Oct 2004 13:03:02 -0000 1.13 --- NodeContextMenu.java 19 Oct 2004 16:17:00 -0000 1.14 *************** *** 24,27 **** --- 24,28 ---- import org.mediavirus.graphl.vocabulary.ResourceMenu; import org.mediavirus.graphl.vocabulary.Vocabulary; + import org.mediavirus.util.ParseUtils; import edu.unika.aifb.rdf.api.util.RDFUtil; *************** *** 159,163 **** for (Iterator iter = types.iterator(); iter.hasNext();) { String descriptor = (String) iter.next(); ! JRadioButtonMenuItem item = new JRadioButtonMenuItem(RDFUtil.guessName(descriptor)); if ((currentNode.getType() != null) && (currentNode.getType().equals(descriptor))) { item.setSelected(true); --- 160,164 ---- for (Iterator iter = types.iterator(); iter.hasNext();) { String descriptor = (String) iter.next(); ! JRadioButtonMenuItem item = new JRadioButtonMenuItem(ParseUtils.guessName(descriptor)); if ((currentNode.getType() != null) && (currentNode.getType().equals(descriptor))) { item.setSelected(true); *************** *** 185,189 **** if (hasCustomType) { ! otherTypeMenuItem.setText("Other (" + RDFUtil.guessName(node.getType()) + ") ..."); otherTypeMenuItem.setSelected(true); } --- 186,190 ---- if (hasCustomType) { ! otherTypeMenuItem.setText("Other (" + ParseUtils.guessName(node.getType()) + ") ..."); otherTypeMenuItem.setSelected(true); } Index: CustomTypePanel.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/CustomTypePanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CustomTypePanel.java 4 Oct 2004 10:21:02 -0000 1.2 --- CustomTypePanel.java 19 Oct 2004 16:17:06 -0000 1.3 *************** *** 18,21 **** --- 18,22 ---- import org.mediavirus.graphl.graph.GraphElement; + import org.mediavirus.util.ParseUtils; import edu.unika.aifb.rdf.api.util.RDFUtil; *************** *** 139,143 **** String title; if ((graphElement != null) && (graphElement.getType() != null)) { ! title = "Edit Edge Type: " + RDFUtil.guessName(graphElement.getType()); } else { --- 140,144 ---- String title; if ((graphElement != null) && (graphElement.getType() != null)) { ! title = "Edit Edge Type: " + ParseUtils.guessName(graphElement.getType()); } else { *************** *** 154,159 **** this.graphElement = graphElement; if (graphElement.getType() != null) { ! getTypeField().setText(RDFUtil.guessName(graphElement.getType())); ! getNamespaceBox().addItem(RDFUtil.guessNamespace(graphElement.getType())); } } --- 155,160 ---- this.graphElement = graphElement; if (graphElement.getType() != null) { ! getTypeField().setText(ParseUtils.guessName(graphElement.getType())); ! getNamespaceBox().addItem(ParseUtils.guessNamespace(graphElement.getType())); } } |
|
From: Flo L. <fl...@us...> - 2004-10-19 16:17:52
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17517/src/org/mediavirus/graphl/layout Modified Files: AbsoluteNodeLayouterController.java SpringEdgeLayouter.java AbsoluteNodeLayouter.java Added Files: SpringEdgeLayouterBeanInfo.java Log Message: - FEATURE further commandline options to remove controls and menubar - FEATURE load url from commandline - FEATURE refresh every n seconds commandline option - FEATURE affine coordinate transformation for geo positioning on a map - FEATURE removed length property of edge, replaced by generic length calculation from any property in springEdgeLayouter - FEATURE configurable stroke for BoxNodePainter, ShapeNodePainter - FEATURE replaced rdfutils function by own implementation in ParseUtils Index: AbsoluteNodeLayouterController.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/AbsoluteNodeLayouterController.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbsoluteNodeLayouterController.java 4 Oct 2004 10:21:01 -0000 1.3 --- AbsoluteNodeLayouterController.java 19 Oct 2004 16:16:58 -0000 1.4 *************** *** 316,320 **** propertyButton.setEnabled(true); cbGroup.add(propertyButton); ! propertyButton.addActionListener(this); } return propertyButton; --- 316,320 ---- propertyButton.setEnabled(true); cbGroup.add(propertyButton); ! //propertyButton.addActionListener(this); } return propertyButton; *************** *** 385,388 **** --- 385,390 ---- propertyBox = new JComboBox(); propertyBox.setEditable(true); + propertyBox.addActionListener(this); + } return propertyBox; --- NEW FILE: SpringEdgeLayouterBeanInfo.java --- /* * Created on 16.10.2004 by flo */ package org.mediavirus.graphl.layout; import java.beans.BeanDescriptor; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.beans.SimpleBeanInfo; /** * @author flo * created: 16.10.2004 16:37:33 */ public class SpringEdgeLayouterBeanInfo extends SimpleBeanInfo { private final static Class beanClass = SpringEdgeLayouter.class; public BeanDescriptor getBeanDescriptor() { return new BeanDescriptor(beanClass); } public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor rv[] = { new PropertyDescriptor("defaultLength", beanClass), new PropertyDescriptor("lengthProperty", beanClass), new PropertyDescriptor("lengthFactor", beanClass), new PropertyDescriptor("rigidity", beanClass) }; return rv; } catch (IntrospectionException e) { throw new Error(e.toString()); } } } Index: AbsoluteNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/AbsoluteNodeLayouter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbsoluteNodeLayouter.java 14 Oct 2004 13:02:58 -0000 1.6 --- AbsoluteNodeLayouter.java 19 Oct 2004 16:16:58 -0000 1.7 *************** *** 13,16 **** --- 13,17 ---- import org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager; import org.mediavirus.graphl.view.AbstractFacet; + import org.mediavirus.util.ParseUtils; /** *************** *** 96,101 **** } } ! return new Point2D.Float(lat, lon); } --- 97,115 ---- } } + + Node n = node.getFirstNeighbour("http://www.funkfeuer.at/vocab#map", true); + if (n != null) { + n = n.getFirstNeighbour("http://www.funkfeuer.at/vocab#transformation", true); + if (n != null) { + str = n.getProperty("http://www.funkfeuer.at/vocab#matrix3"); + float[] mat = ParseUtils.parseMatrix(str); + float x = lon * mat[0] + lat * mat[1] + mat[2]; + float y = lon * mat[3] + lat * mat[4] + mat[5]; + lon = x; + lat = y; + } + } ! return new Point2D.Float(lon, lat); } Index: SpringEdgeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/SpringEdgeLayouter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SpringEdgeLayouter.java 4 Oct 2004 10:21:01 -0000 1.6 --- SpringEdgeLayouter.java 19 Oct 2004 16:16:58 -0000 1.7 *************** *** 19,24 **** public class SpringEdgeLayouter extends AbstractFacet implements EdgeLayouter { /** The rigidity has the same effect as the damper, except that it is a constant. */ ! protected double rigidity=1; /* --- 19,29 ---- public class SpringEdgeLayouter extends AbstractFacet implements EdgeLayouter { + float defaultLength = 40.0f; + String lengthProperty = null; + + float lengthFactor = 1.0f; + /** The rigidity has the same effect as the damper, except that it is a constant. */ ! float rigidity = 1.0f; /* *************** *** 33,36 **** --- 38,53 ---- */ public void performLayoutStep(Edge edge, GraphManager manager) { + float length = defaultLength; + if (lengthProperty != null) { + String str = edge.getProperty(lengthProperty); + if (str != null) { + try { + length = Float.parseFloat(str); + } + catch (NumberFormatException nfex) { + // do nothing + } + } + } Node from=edge.getFrom(); Node to=edge.getTo(); *************** *** 38,42 **** double deltaY=to.getCenterY()-from.getCenterY(); double currentLength=Math.sqrt(deltaX*deltaX+deltaY*deltaY); ! double factor=rigidity*currentLength/(edge.getLength()*100.0); double dx=deltaX*factor; double dy=deltaY*factor; --- 55,59 ---- double deltaY=to.getCenterY()-from.getCenterY(); double currentLength=Math.sqrt(deltaX*deltaX+deltaY*deltaY); ! double factor=rigidity*currentLength/(length*100.0f*lengthFactor); double dx=deltaX*factor; double dy=deltaY*factor; *************** *** 63,74 **** */ public boolean hasVisualController() { ! return false; ! } ! ! /* ! * Overrides @see org.mediavirus.graphl.Facet#getVisualController() ! */ ! public JComponent getVisualController() { ! return null; } --- 80,84 ---- */ public boolean hasVisualController() { ! return true; } *************** *** 84,93 **** */ public Object clone() { ! return new SpringEdgeLayouter(); } public String getName() { return "Spring"; } } --- 94,181 ---- */ public Object clone() { ! SpringEdgeLayouter l = new SpringEdgeLayouter(); ! l.setDefaultLength(defaultLength); ! l.setLengthFactor(lengthFactor); ! l.setLengthProperty(lengthProperty); ! l.setRigidity(rigidity); ! return l; } + + + /** + * @see org.mediavirus.graphl.view.Facet#setConfigurationNode(org.mediavirus.graphl.graph.Node) + */ + + public void setConfigurationNode(Node node) { + String str = node.getProperty("http://www.mediavirus.org/graphl#lengthFactor"); + if (str != null) { + setLengthFactor(Float.parseFloat(str)); + } + str = node.getProperty("http://www.mediavirus.org/graphl#lengthProperty"); + if ( str != null) { + setLengthProperty(str); + } + str = node.getProperty("http://www.mediavirus.org/graphl#defaultLength"); + if (str != null) { + setDefaultLength(Float.parseFloat(str)); + } + str = node.getProperty("http://www.mediavirus.org/graphl#rigidity"); + if (str != null) { + setRigidity(Float.parseFloat(str)); + } + } + public String getName() { return "Spring"; } + /** + * @return Returns the defaultLength. + */ + public float getDefaultLength() { + return defaultLength; + } + /** + * @param defaultLength The defaultLength to set. + */ + public void setDefaultLength(float defaultLength) { + this.defaultLength = defaultLength; + } + /** + * @return Returns the lengthFactor. + */ + public float getLengthFactor() { + return lengthFactor; + } + /** + * @param lengthFactor The lengthFactor to set. + */ + public void setLengthFactor(float lengthFactor) { + this.lengthFactor = lengthFactor; + } + /** + * @return Returns the lengthProperty. + */ + public String getLengthProperty() { + return lengthProperty; + } + /** + * @param lengthProperty The lengthProperty to set. + */ + public void setLengthProperty(String lengthProperty) { + this.lengthProperty = lengthProperty; + } + /** + * @return Returns the rigidity. + */ + public float getRigidity() { + return rigidity; + } + /** + * @param rigidity The rigidity to set. + */ + public void setRigidity(float rigidity) { + this.rigidity = rigidity; + } } |
|
From: Flo L. <fl...@us...> - 2004-10-19 16:17:50
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17517/src/org/mediavirus/graphl/vocabulary Modified Files: SimpleVocabularyRegistry.java Log Message: - FEATURE further commandline options to remove controls and menubar - FEATURE load url from commandline - FEATURE refresh every n seconds commandline option - FEATURE affine coordinate transformation for geo positioning on a map - FEATURE removed length property of edge, replaced by generic length calculation from any property in springEdgeLayouter - FEATURE configurable stroke for BoxNodePainter, ShapeNodePainter - FEATURE replaced rdfutils function by own implementation in ParseUtils Index: SimpleVocabularyRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary/SimpleVocabularyRegistry.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleVocabularyRegistry.java 14 Oct 2004 13:03:05 -0000 1.3 --- SimpleVocabularyRegistry.java 19 Oct 2004 16:17:07 -0000 1.4 *************** *** 9,12 **** --- 9,14 ---- import java.util.Vector; + import org.mediavirus.util.ParseUtils; + import edu.unika.aifb.rdf.api.util.RDFUtil; *************** *** 53,62 **** */ public String compactNamespace(String uri) { ! String prefix = RDFUtil.guessNamespace(uri); if (prefix == null) return uri; for (Iterator iter = registeredVocabularies.iterator(); iter.hasNext();) { Vocabulary vocab = (Vocabulary) iter.next(); if (vocab.getNamespace().equals(prefix)) { ! return vocab.getDefaultNamespacePrefix() + ":" + RDFUtil.guessName(uri); } } --- 55,64 ---- */ public String compactNamespace(String uri) { ! String prefix = ParseUtils.guessNamespace(uri); if (prefix == null) return uri; for (Iterator iter = registeredVocabularies.iterator(); iter.hasNext();) { Vocabulary vocab = (Vocabulary) iter.next(); if (vocab.getNamespace().equals(prefix)) { ! return vocab.getDefaultNamespacePrefix() + ":" + ParseUtils.guessName(uri); } } |
|
From: Flo L. <fl...@us...> - 2004-10-19 16:17:48
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17517/src/org/mediavirus/graphl/view Modified Files: LabelGenerator.java Log Message: - FEATURE further commandline options to remove controls and menubar - FEATURE load url from commandline - FEATURE refresh every n seconds commandline option - FEATURE affine coordinate transformation for geo positioning on a map - FEATURE removed length property of edge, replaced by generic length calculation from any property in springEdgeLayouter - FEATURE configurable stroke for BoxNodePainter, ShapeNodePainter - FEATURE replaced rdfutils function by own implementation in ParseUtils Index: LabelGenerator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/LabelGenerator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** LabelGenerator.java 14 Oct 2004 13:03:02 -0000 1.7 --- LabelGenerator.java 19 Oct 2004 16:17:07 -0000 1.8 *************** *** 12,15 **** --- 12,16 ---- import org.mediavirus.graphl.graph.Edge; import org.mediavirus.graphl.graph.Node; + import org.mediavirus.util.ParseUtils; import edu.unika.aifb.rdf.api.util.RDFUtil; *************** *** 72,76 **** if (value != null && guessName) { ! return RDFUtil.guessName(value); } else { --- 73,77 ---- if (value != null && guessName) { ! return ParseUtils.guessName(value); } else { *************** *** 101,105 **** if (guessName) { ! return RDFUtil.guessName(value); } else { --- 102,106 ---- if (guessName) { ! return ParseUtils.guessName(value); } else { |
|
From: Flo L. <fl...@us...> - 2004-10-19 16:17:45
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17517/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFNode.java RDFGraph.java Log Message: - FEATURE further commandline options to remove controls and menubar - FEATURE load url from commandline - FEATURE refresh every n seconds commandline option - FEATURE affine coordinate transformation for geo positioning on a map - FEATURE removed length property of edge, replaced by generic length calculation from any property in springEdgeLayouter - FEATURE configurable stroke for BoxNodePainter, ShapeNodePainter - FEATURE replaced rdfutils function by own implementation in ParseUtils Index: RDFNode.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFNode.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RDFNode.java 14 Oct 2004 13:03:05 -0000 1.4 --- RDFNode.java 19 Oct 2004 16:16:58 -0000 1.5 *************** *** 11,14 **** --- 11,15 ---- import org.mediavirus.graphl.graph.DefaultNode; import org.mediavirus.graphl.graph.Node; + import org.mediavirus.util.ParseUtils; import edu.unika.aifb.rdf.api.util.RDFUtil; *************** *** 53,57 **** if ( label != null) return label; else { ! label = RDFUtil.guessName(getId()); } if (label != null) return label; --- 54,58 ---- if ( label != null) return label; else { ! label = ParseUtils.guessName(getId()); } if (label != null) return label; Index: RDFGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFGraph.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RDFGraph.java 14 Oct 2004 13:03:05 -0000 1.4 --- RDFGraph.java 19 Oct 2004 16:16:59 -0000 1.5 *************** *** 61,66 **** for (Iterator iter = allNodes.iterator(); iter.hasNext();) { RDFNode node = (RDFNode) iter.next(); - //writer.writeStatement(node.getId(), "http://www.mediavirus.org/graphl#hasLabel", node.getLabel(), null, null, true); - //if (node.getComment() != null) writer.writeStatement(node.getId(), "http://www.mediavirus.org/graphl#hasComment", node.getComment(), null, null, true); writer.writeStatement(node.getId(), "http://www.mediavirus.org/graphl#canvasPosition", node.getCenterX() + ":" + node.getCenterY(), null, null, true); List nodeEdges = node.getEdgesFrom(); --- 61,64 ---- |
|
From: Flo L. <fl...@us...> - 2004-10-19 16:17:37
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17517/src/org/mediavirus/util Modified Files: ParseUtils.java Log Message: - FEATURE further commandline options to remove controls and menubar - FEATURE load url from commandline - FEATURE refresh every n seconds commandline option - FEATURE affine coordinate transformation for geo positioning on a map - FEATURE removed length property of edge, replaced by generic length calculation from any property in springEdgeLayouter - FEATURE configurable stroke for BoxNodePainter, ShapeNodePainter - FEATURE replaced rdfutils function by own implementation in ParseUtils Index: ParseUtils.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/util/ParseUtils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ParseUtils.java 14 Oct 2004 13:03:04 -0000 1.2 --- ParseUtils.java 19 Oct 2004 16:17:09 -0000 1.3 *************** *** 80,83 **** --- 80,128 ---- return Font.decode(spec); } + + public static String guessName(String uri) { + int l = getNamespaceEnd(uri); + return l > 0 ? uri.substring(getNamespaceEnd(uri)) : uri; + } + + public static String guessNamespace(String uri){ + int l = getNamespaceEnd(uri); + return l > 1 ? uri.substring(0, l) : ""; + + } + + /** + * Position of the namespace end + */ + static int getNamespaceEnd(String uri) { + int l = uri.length()-1; + if (l<0) return -1; + do { + char c = uri.charAt(l); + if(c == '#' || c == ':' || c == '/') + break; + l--; + } while (l >= 0); + l++; + return l; + } + + /** + * @param str + * @return + */ + public static float[] parseMatrix(String str) { + StringTokenizer tok = new StringTokenizer(str); + float[] mat = {1, 0, 0, 0, 1, 0, 0, 0, 1}; + int i = 0; + while (tok.hasMoreTokens()) { + String t = tok.nextToken(); + mat[i] = Float.parseFloat(t); + if (i==9) break; + i++; + } + return mat; + } + } |
|
From: Flo L. <fl...@us...> - 2004-10-19 16:17:37
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17517/src/org/mediavirus/graphl Modified Files: GraphlApplication.java GraphlPanel.java Log Message: - FEATURE further commandline options to remove controls and menubar - FEATURE load url from commandline - FEATURE refresh every n seconds commandline option - FEATURE affine coordinate transformation for geo positioning on a map - FEATURE removed length property of edge, replaced by generic length calculation from any property in springEdgeLayouter - FEATURE configurable stroke for BoxNodePainter, ShapeNodePainter - FEATURE replaced rdfutils function by own implementation in ParseUtils Index: GraphlPanel.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPanel.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** GraphlPanel.java 14 Oct 2004 13:03:04 -0000 1.15 --- GraphlPanel.java 19 Oct 2004 16:17:08 -0000 1.16 *************** *** 74,79 **** add(getTopPanel(), BorderLayout.NORTH); - getTopPanel().setVisible(false); - } --- 74,77 ---- *************** *** 436,438 **** --- 434,443 ---- } + /** + * @param visible + */ + public void setControlsVisible(boolean visible) { + getTopPanel().setVisible(visible); + } + } // @jve:decl-index=0:visual-constraint="10,10" Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** GraphlApplication.java 14 Oct 2004 19:21:51 -0000 1.11 --- GraphlApplication.java 19 Oct 2004 16:17:08 -0000 1.12 *************** *** 62,69 **** private File currentFile; private int sleeptime; - private URL rdfurl; private boolean doReload; --- 62,69 ---- private File currentFile; + private URL currentURL; private int sleeptime; private boolean doReload; *************** *** 209,213 **** if (p.getURLString() != null) { try { ! rdfurl = new URL(p.getURLString()); if (p.getDoReload()) { doReload = true; --- 209,213 ---- if (p.getURLString() != null) { try { ! currentURL = new URL(p.getURLString()); if (p.getDoReload()) { doReload = true; *************** *** 218,222 **** try { sleep(sleeptime); ! ((RDFGraph)mainPanel.getGraph()).readFromURL(rdfurl); } catch (InterruptedException e) { --- 218,222 ---- try { sleep(sleeptime); ! reload(); } catch (InterruptedException e) { *************** *** 227,231 **** t.start(); } ! ((RDFGraph)mainPanel.getGraph()).readFromURL(rdfurl); } catch (MalformedURLException e) { --- 227,231 ---- t.start(); } ! loadURL(currentURL); } catch (MalformedURLException e) { *************** *** 386,390 **** --- 386,415 ---- } + + public void loadURL(URL url) { + if (url != null) { + mainPanel.getGraphPane().pauseLayouter(); + mainPanel.getGraph().clear(); + mainPanel.getGraph().readFromURL(url); + setTitle("Graphl - " + url.getFile()); + currentURL = url; + mainPanel.getGraphPane().resumeLayouter(); + } + } + 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()); + } + } + } + public void loadSettings(String filename) throws IOException { settings.clear(); *************** *** 409,413 **** int[] size = {1024, 768}; int[] pos = {0,0}; ! boolean decorations = true; String filename = DEFAULT_FILE; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; --- 434,441 ---- int[] size = {1024, 768}; int[] pos = {0,0}; ! int refresh=-1; ! boolean decorations = true, ! controls = true, ! menubar = true; String filename = DEFAULT_FILE; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; *************** *** 425,431 **** --- 453,468 ---- if (args[i].equals("decorations=off")) decorations = false; } + else if (args[i].startsWith("controls=")) { + if (args[i].equals("controls=off")) controls = false; + } + else if (args[i].startsWith("menubar=")) { + if (args[i].equals("menubar=off")) menubar = false; + } else if (args[i].startsWith("config=")) { configfile = args[i].substring(7); } + else if (args[i].startsWith("refresh=")) { + refresh = Integer.parseInt(args[i].substring(8)); + } else if (i == args.length-1) { filename = args[i]; *************** *** 439,442 **** --- 476,481 ---- app.setLocation(pos[0], pos[1]); app.setUndecorated(!decorations); + app.setControlsVisible(controls); + app.setMenubarVisible(menubar); app.show(); *************** *** 444,448 **** app.loadSettings(configfile); if (filename != null) { ! app.loadFile(new File(filename)); } } --- 483,496 ---- app.loadSettings(configfile); if (filename != null) { ! try { ! URL url = new URL(filename); ! app.loadURL(url); ! } ! catch (MalformedURLException muex) { ! app.loadFile(new File(filename)); ! } ! if (refresh > 0) { ! app.scheduleRefresh(refresh * 1000); ! } } } *************** *** 452,455 **** --- 500,538 ---- } + /** + * @param visible + */ + private void setMenubarVisible(boolean visible) { + menuBar.setVisible(visible); + } + + /** + * @param visible + */ + private void setControlsVisible(boolean visible) { + mainPanel.setControlsVisible(visible); + } + + /** + * @param i + */ + private void scheduleRefresh(int duration) { + doReload = true; + sleeptime = duration; + Thread t = new Thread() { + public void run() { + while (doReload) { + try { + sleep(sleeptime); + reload(); + } + catch (InterruptedException e) { + } + } + } + }; + t.start(); + } + public static void usage(boolean exit){ System.out.println("-------------------------------------------------------------------"); *************** *** 459,464 **** System.out.println("-------------------------------------------------------------------"); System.out.println("usage:"); ! System.out.println("graphl [size=<width>,<height>] [pos=<x>,<y>] [decorations={on|off}]\n" + ! " [config=<filename.rdf>] [<filename.rdf>]"); System.out.println("-------------------------------------------------------------------"); if (exit) System.exit(0); --- 542,549 ---- System.out.println("-------------------------------------------------------------------"); System.out.println("usage:"); ! System.out.println("graphl [size=<width>,<height>] [pos=<x>,<y>] [config=<filename.rdf>]\n" + ! " [refresh=<seconds>] [decorations={on|off}]\n" + ! " [controls={on|off}] [menubar={on|off}]\n" + ! " [{<filename>|<url>}]"); System.out.println("-------------------------------------------------------------------"); if (exit) System.exit(0); |
|
From: Flo L. <fl...@us...> - 2004-10-19 16:17:36
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17517/src/org/mediavirus/graphl/painter Modified Files: ShapeNodePainter.java BoxNodePainter.java Log Message: - FEATURE further commandline options to remove controls and menubar - FEATURE load url from commandline - FEATURE refresh every n seconds commandline option - FEATURE affine coordinate transformation for geo positioning on a map - FEATURE removed length property of edge, replaced by generic length calculation from any property in springEdgeLayouter - FEATURE configurable stroke for BoxNodePainter, ShapeNodePainter - FEATURE replaced rdfutils function by own implementation in ParseUtils Index: BoxNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/BoxNodePainter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BoxNodePainter.java 14 Oct 2004 13:03:03 -0000 1.5 --- BoxNodePainter.java 19 Oct 2004 16:17:09 -0000 1.6 *************** *** 319,322 **** --- 319,325 ---- // no such neighbour found } + + Stroke stroke = ParseUtils.parseStroke(node.getProperty("http://www.mediavirus.org/graphl#borderStroke")); + if (stroke != null) setBorderStroke(stroke); } Index: ShapeNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ShapeNodePainter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ShapeNodePainter.java 5 Oct 2004 07:54:20 -0000 1.2 --- ShapeNodePainter.java 19 Oct 2004 16:17:09 -0000 1.3 *************** *** 5,8 **** --- 5,9 ---- package org.mediavirus.graphl.painter; + import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; *************** *** 10,13 **** --- 11,15 ---- import java.awt.Rectangle; import java.awt.Shape; + import java.awt.Stroke; import java.awt.geom.AffineTransform; import java.awt.geom.Ellipse2D; *************** *** 35,38 **** --- 37,41 ---- float size = 10.0f; Shape shape = null; + Stroke stroke = new BasicStroke(2.0f); Color borderColor = Color.BLACK; *************** *** 93,96 **** --- 96,100 ---- g.fill(shape); g.setColor(borderColor); + g.setStroke(stroke); g.draw(shape); g.setTransform(xf); *************** *** 131,134 **** --- 135,150 ---- /** + * @return Returns the stroke. + */ + public Stroke getStroke() { + return stroke; + } + /** + * @param stroke The stroke to set. + */ + public void setStroke(Stroke stroke) { + this.stroke = stroke; + } + /** * @return Returns the borderColor. */ *************** *** 190,193 **** --- 206,212 ---- } } + + Stroke stroke = ParseUtils.parseStroke(node.getProperty("http://www.mediavirus.org/graphl#stroke")); + if (stroke != null) setStroke(stroke); Color col = ParseUtils.parseColor(node.getProperty("http://www.mediavirus.org/graphl#borderColor")); |
|
From: Flo L. <fl...@us...> - 2004-10-19 16:10:33
|
Update of /cvsroot/graphl/graphl/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15770/config Modified Files: netznetz-config.rdf Log Message: some tweaking of the netznetz-config Index: netznetz-config.rdf =================================================================== RCS file: /cvsroot/graphl/graphl/config/netznetz-config.rdf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** netznetz-config.rdf 14 Oct 2004 13:03:06 -0000 1.1 --- netznetz-config.rdf 19 Oct 2004 16:10:23 -0000 1.2 *************** *** 149,153 **** graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" ! graphl:paintLabel="true" graphl:labelColor="#666666"/> </graphl:defaultEdgePainter> --- 149,153 ---- graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" ! graphl:paintLabel="false" graphl:labelColor="#666666"/> </graphl:defaultEdgePainter> *************** *** 169,173 **** graphl:javaClass="org.mediavirus.graphl.painter.BoxNodePainter" graphl:baseColor="#e0e0e0" ! graphl:borderColor="#990033" graphl:font="Verdana-14" graphl:borderStroke="2.0"> --- 169,173 ---- graphl:javaClass="org.mediavirus.graphl.painter.BoxNodePainter" graphl:baseColor="#e0e0e0" ! graphl:borderColor="#000000" graphl:font="Verdana-14" graphl:borderStroke="2.0"> *************** *** 189,195 **** </graphl:labelGenerator> <graphl:assignedToType> ! <rdfs:Class rdf:about="&foaf;Person"/> </graphl:assignedToType> <graphl:assignedToType> <rdfs:Class rdf:about="&foaf;Group"/> </graphl:assignedToType> --- 189,204 ---- </graphl:labelGenerator> <graphl:assignedToType> ! <rdfs:Class rdf:about="&foo;NGO"/> </graphl:assignedToType> <graphl:assignedToType> + <rdfs:Class rdf:about="&foo;Company"/> + </graphl:assignedToType> + <graphl:assignedToType> + <rdfs:Class rdf:about="&foo;School"/> + </graphl:assignedToType> + <!-- <graphl:assignedToType> + <rdfs:Class rdf:about="&foaf;Person"/> + </graphl:assignedToType>--> + <graphl:assignedToType> <rdfs:Class rdf:about="&foaf;Group"/> </graphl:assignedToType> *************** *** 205,208 **** --- 214,245 ---- </graphl:NodePainter> </rdf:li> + <rdf:li> + <graphl:NodePainter + graphl:javaClass="org.mediavirus.graphl.painter.BoxNodePainter" + graphl:baseColor="#e0e0e0" + graphl:borderColor="#990033" + graphl:font="Verdana-14" + graphl:borderStroke="1.0"> + <graphl:labelGenerator> + <graphl:LabelGenerator> + <graphl:labelFacets> + <rdf:List> + <rdf:first> + <graphl:LabelFacet + graphl:labelFacetType="Property" + graphl:labelFacetValue="&foaf;name"/> + </rdf:first> + <rdf:rest> + <rdf:nil/> + </rdf:rest> + </rdf:List> + </graphl:labelFacets> + </graphl:LabelGenerator> + </graphl:labelGenerator> + <graphl:assignedToType> + <rdfs:Class rdf:about="&foaf;Person"/> + </graphl:assignedToType> + </graphl:NodePainter> + </rdf:li> <rdf:li> <graphl:NodePainter *************** *** 395,399 **** graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" ! graphl:paintLabel="true" graphl:stroke="0.33" graphl:color="#000000" --- 432,436 ---- graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" ! graphl:paintLabel="false" graphl:stroke="0.33" graphl:color="#000000" *************** *** 413,452 **** </graphl:EdgePainter> </rdf:li> - <rdf:li> - <graphl:EdgePainter - graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" - graphl:paintArrow="false" - graphl:paintLabel="false" - graphl:stroke="1.0 5 5"> - <graphl:assignedToType> - <rdf:Property rdf:about="&rdfs;range"/> - </graphl:assignedToType> - </graphl:EdgePainter> - </rdf:li> - <rdf:li> - <graphl:EdgePainter - graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" - graphl:paintArrow="false" - graphl:paintLabel="false" - graphl:stroke="1.0"> - <graphl:assignedToType> - <rdf:Property rdf:about="&rdf;first"/> - </graphl:assignedToType> - <graphl:assignedToType> - <rdf:Property rdf:about="&graphl;connectedTo"/> - </graphl:assignedToType> - </graphl:EdgePainter> - </rdf:li> - <rdf:li> - <graphl:EdgePainter - graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" - graphl:paintArrow="true" - graphl:paintLabel="false" - graphl:stroke="1.0"> - <graphl:assignedToType> - <rdf:Property rdf:about="&rdf;rest"/> - </graphl:assignedToType> - </graphl:EdgePainter> - </rdf:li> </rdf:Bag> </graphl:assignedEdgePainters> --- 450,453 ---- *************** *** 469,472 **** --- 470,476 ---- <rdf:Property rdf:about="&owl;disjointWith"/> </graphl:assignedToType> + <graphl:assignedToType> + <rdf:Property rdf:about="&foaf;knows"/> + </graphl:assignedToType> </graphl:EdgeLayouter> </rdf:li> |
|
From: Flo L. <fl...@us...> - 2004-10-14 19:22:02
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11936/src/org/mediavirus/graphl Modified Files: GraphlApplication.java Log Message: do not load default file at startup Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GraphlApplication.java 14 Oct 2004 13:03:04 -0000 1.10 --- GraphlApplication.java 14 Oct 2004 19:21:51 -0000 1.11 *************** *** 410,414 **** int[] pos = {0,0}; boolean decorations = true; ! String filename = System.getProperty("user.dir") + DEFAULT_FILE; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; --- 410,414 ---- int[] pos = {0,0}; boolean decorations = true; ! String filename = DEFAULT_FILE; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; *************** *** 438,442 **** app.setSize(size[0], size[1]); app.setLocation(pos[0], pos[1]); - // TODO (3) provide own event handling (move, resize, close) to be able to remove decorations app.setUndecorated(!decorations); app.show(); --- 438,441 ---- |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:52
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/graphl/painter Modified Files: ImageNodePainter.java StraightLineEdgePainter.java LineEdgePainter.java BoxNodePainter.java StraightLineEdgePainterBeanInfo.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: LineEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/LineEdgePainter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LineEdgePainter.java 5 Oct 2004 07:54:20 -0000 1.5 --- LineEdgePainter.java 14 Oct 2004 13:03:03 -0000 1.6 *************** *** 35,39 **** Font font; Color color; ! Color textColor = Color.BLACK; LabelGenerator labelGenerator; --- 35,39 ---- Font font; Color color; ! Color labelColor = Color.BLACK; LabelGenerator labelGenerator; *************** *** 122,135 **** /** ! * @return Returns the textColor. */ ! public Color getTextColor() { ! return textColor; } /** ! * @param textColor The textColor to set. */ ! public void setTextColor(Color textColor) { ! this.textColor = textColor; } /** --- 122,135 ---- /** ! * @return Returns the labelColor. */ ! public Color getLabelColor() { ! return labelColor; } /** ! * @param labelColor The labelColor to set. */ ! public void setLabelColor(Color textColor) { ! this.labelColor = textColor; } /** *************** *** 230,233 **** --- 230,236 ---- if (col != null) setColor(col); + col = ParseUtils.parseColor(node.getProperty("http://www.mediavirus.org/graphl#labelColor")); + if (col != null) setLabelColor(col); + Stroke stroke = ParseUtils.parseStroke(node.getProperty("http://www.mediavirus.org/graphl#stroke")); if (stroke != null) setStroke(stroke); Index: BoxNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/BoxNodePainter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BoxNodePainter.java 4 Oct 2004 10:21:03 -0000 1.4 --- BoxNodePainter.java 14 Oct 2004 13:03:03 -0000 1.5 *************** *** 108,112 **** Point point) { ! return node.getValue(); } --- 108,112 ---- Point point) { ! return node.getId(); } *************** *** 208,212 **** Color oldColor=g.getColor(); g.setColor(getBackgroundColor(highlighted, selected, false)); ! g.fillRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height); if (label!=null) { Font oldFont=g.getFont(); --- 208,214 ---- Color oldColor=g.getColor(); g.setColor(getBackgroundColor(highlighted, selected, false)); ! //TODO (1,0.5h) property for rounded rect ! //g.fillRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height); ! g.fillRoundRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height,8,8); if (label!=null) { Font oldFont=g.getFont(); *************** *** 217,221 **** } g.setColor(getBorderColor(highlighted, selected, false)); ! g.drawRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height); g.setColor(oldColor); } --- 219,224 ---- } g.setColor(getBorderColor(highlighted, selected, false)); ! //g.drawRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height); ! g.drawRoundRect(nodePoint.x-width/2,nodePoint.y-height/2,width,height,8,8); g.setColor(oldColor); } *************** *** 306,309 **** --- 309,315 ---- if (col != null) textColor = col; + Font font = ParseUtils.parseFont(node.getProperty("http://www.mediavirus.org/graphl#font")); + if (font != null) setFont(font); + try { Node labelGeneratorNode = (Node)node.getNeighbours("http://www.mediavirus.org/graphl#labelGenerator", true).get(0); Index: ImageNodePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/ImageNodePainter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ImageNodePainter.java 4 Oct 2004 10:21:03 -0000 1.4 --- ImageNodePainter.java 14 Oct 2004 13:03:03 -0000 1.5 *************** *** 88,92 **** if (href == null) { Node propertyNode = node.getFirstNeighbour(property, true); ! if (propertyNode != null) href = propertyNode.getValue(); } img = loadImage(baseURL, href); --- 88,92 ---- if (href == null) { Node propertyNode = node.getFirstNeighbour(property, true); ! if (propertyNode != null) href = propertyNode.getId(); } img = loadImage(baseURL, href); *************** *** 165,169 **** public String getToolTipText(GraphlPane graphPane, Node node, Point point) { ! return node.getValue(); } --- 165,169 ---- public String getToolTipText(GraphlPane graphPane, Node node, Point point) { ! return node.getId(); } Index: StraightLineEdgePainterBeanInfo.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/StraightLineEdgePainterBeanInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StraightLineEdgePainterBeanInfo.java 4 Oct 2004 10:21:03 -0000 1.1 --- StraightLineEdgePainterBeanInfo.java 14 Oct 2004 13:03:03 -0000 1.2 *************** *** 27,31 **** PropertyDescriptor rv[] = { new PropertyDescriptor("color", beanClass), ! new PropertyDescriptor("textColor", beanClass), new PropertyDescriptor("font", beanClass), new PropertyDescriptor("stroke", beanClass), --- 27,31 ---- PropertyDescriptor rv[] = { new PropertyDescriptor("color", beanClass), ! new PropertyDescriptor("labelColor", beanClass), new PropertyDescriptor("font", beanClass), new PropertyDescriptor("stroke", beanClass), Index: StraightLineEdgePainter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/painter/StraightLineEdgePainter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StraightLineEdgePainter.java 4 Oct 2004 10:21:03 -0000 1.3 --- StraightLineEdgePainter.java 14 Oct 2004 13:03:03 -0000 1.4 *************** *** 140,144 **** } if (isPaintLabel()){ ! g.setColor(getTextColor()); String label = labelGenerator.getLabel(edge); if (label != null){ --- 140,144 ---- } if (isPaintLabel()){ ! g.setColor(getLabelColor()); String label = labelGenerator.getLabel(edge); if (label != null){ *************** *** 254,258 **** public boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point) { if (isPaintLabel()) { ! String label = edge.getValue(); if (label != null){ Point from = graphPane.getScreenPointForNode(edge.getFrom()); --- 254,259 ---- public boolean isPointInLabel(GraphlPane graphPane, RDFEdge edge, Point point) { if (isPaintLabel()) { ! // TODO how to get the label string ! String label = edge.getLabel(); if (label != null){ Point from = graphPane.getScreenPointForNode(edge.getFrom()); |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:52
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/graphl/graph Modified Files: Edge.java GraphElement.java DefaultEdge.java ReificationNode.java DefaultNode.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: DefaultEdge.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/DefaultEdge.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DefaultEdge.java 4 Oct 2004 10:21:02 -0000 1.10 --- DefaultEdge.java 14 Oct 2004 13:03:02 -0000 1.11 *************** *** 27,30 **** --- 27,32 ---- EdgeLayouter layouter = null; + int zIndex = 1; + /** *************** *** 59,66 **** * @return the label of the node */ ! public String getValue() { return toString(); } /** * The length of an Edge is an abstract value, that can be used for layouting and rendering the edge. --- 61,80 ---- * @return the label of the node */ ! public String getLabel() { return toString(); } + /** + * @return Returns the zIndex. + */ + public int getZIndex() { + return zIndex; + } + /** + * @param index The zIndex to set. + */ + public void setZIndex(int index) { + zIndex = index; + } /** * The length of an Edge is an abstract value, that can be used for layouting and rendering the edge. Index: ReificationNode.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/ReificationNode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ReificationNode.java 4 Oct 2004 10:21:02 -0000 1.5 --- ReificationNode.java 14 Oct 2004 13:03:02 -0000 1.6 *************** *** 28,33 **** } ! public String getValue() { ! return statement.getValue(); } --- 28,33 ---- } ! public String getLabel() { ! return statement.getId(); } Index: Edge.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/Edge.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Edge.java 5 Oct 2004 07:54:19 -0000 1.9 --- Edge.java 14 Oct 2004 13:02:58 -0000 1.10 *************** *** 26,30 **** */ double getLength(); ! /** * @return The edge painter that is set for rendering this edge. --- 26,30 ---- */ double getLength(); ! /** * @return The edge painter that is set for rendering this edge. Index: DefaultNode.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/DefaultNode.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** DefaultNode.java 4 Oct 2004 10:21:02 -0000 1.12 --- DefaultNode.java 14 Oct 2004 13:03:02 -0000 1.13 *************** *** 25,28 **** --- 25,42 ---- protected double height = -1; + int zIndex = 1; + + /** + * @return Returns the zIndex. + */ + public int getZIndex() { + return zIndex; + } + /** + * @param index The zIndex to set. + */ + public void setZIndex(int index) { + zIndex = index; + } protected String id; *************** *** 98,102 **** * @return the label of this node */ ! public String getValue() { return toString(); } --- 112,116 ---- * @return the label of this node */ ! public String getLabel() { return toString(); } Index: GraphElement.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/GraphElement.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GraphElement.java 4 Oct 2004 10:21:02 -0000 1.5 --- GraphElement.java 14 Oct 2004 13:03:02 -0000 1.6 *************** *** 10,19 **** */ public interface GraphElement extends PropertySet { - /** - * Returns the value of this element. - * - * @return the value of the element - */ - String getValue(); String getId(); --- 10,13 ---- *************** *** 26,29 **** --- 20,35 ---- void setProperty(String name, String value); + + //TODO (2,1h) move this to ElementView + 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 |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:51
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/graphl/gui Modified Files: NodeContextMenu.java EdgeContextMenu.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: EdgeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/EdgeContextMenu.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** EdgeContextMenu.java 4 Oct 2004 10:21:02 -0000 1.11 --- EdgeContextMenu.java 14 Oct 2004 13:03:02 -0000 1.12 *************** *** 129,132 **** --- 129,138 ---- } + public void setVisible(boolean visible) { + super.setVisible(visible); + if (!visible) { + graphlPane.resumeLayouter(); + } + } private JMenu buildTypeSubMenu(Edge edge) { Index: NodeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/NodeContextMenu.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NodeContextMenu.java 4 Oct 2004 10:21:02 -0000 1.12 --- NodeContextMenu.java 14 Oct 2004 13:03:02 -0000 1.13 *************** *** 128,131 **** --- 128,138 ---- this.graphlPane = parent; } + + public void setVisible(boolean visible) { + super.setVisible(visible); + if (!visible) { + graphlPane.resumeLayouter(); + } + } |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:51
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/graphl Modified Files: GraphlApplication.java GraphlPane.java GraphlApplet.java GraphlPanel.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: GraphlPanel.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPanel.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GraphlPanel.java 4 Oct 2004 10:21:04 -0000 1.14 --- GraphlPanel.java 14 Oct 2004 13:03:04 -0000 1.15 *************** *** 27,32 **** import org.mediavirus.graphl.gui.GenericDialog; import org.mediavirus.graphl.interaction.GraphlManipulator; - import org.mediavirus.graphl.layout.GraphlLayoutStrategy; - import org.mediavirus.graphl.layout.Layouter; import org.mediavirus.graphl.painter.EdgePainter; import org.mediavirus.graphl.painter.NodePainter; --- 27,30 ---- *************** *** 53,58 **** JCheckBox layoutBox; - Layouter layouter; - private JSlider zoomSlider; private JComboBox nodePainterMenu; --- 51,54 ---- *************** *** 65,73 **** private JButton edgePainterConfigureButton = null; private JButton jButton = null; public GraphlPanel(){ initialize(); - - layouter = new Layouter(new GraphlLayoutStrategy(graphPane.getGraph(), graphPane.getFacetRegistry())); - layouter.start(); } --- 61,67 ---- private JButton edgePainterConfigureButton = null; private JButton jButton = null; + public GraphlPanel(){ initialize(); } *************** *** 80,83 **** --- 74,79 ---- add(getTopPanel(), BorderLayout.NORTH); + getTopPanel().setVisible(false); + } *************** *** 204,211 **** public void actionPerformed(ActionEvent e) { if (layoutBox.isSelected()) { ! layouter.start(); } else { ! layouter.stop(); } } --- 200,207 ---- public void actionPerformed(ActionEvent e) { if (layoutBox.isSelected()) { ! graphPane.startLayouter(); } else { ! graphPane.stopLayouter(); } } *************** *** 219,223 **** } ! private GraphlPane getGraphPane() { if (graphPane == null) { graphPane = new GraphlPane(); --- 215,219 ---- } ! public GraphlPane getGraphPane() { if (graphPane == null) { graphPane = new GraphlPane(); *************** *** 295,299 **** return edgePainterMenu; } ! public boolean nodeRemove(Node n) { return true; --- 291,295 ---- return edgePainterMenu; } ! public boolean nodeRemove(Node n) { return true; *************** *** 308,324 **** } - public void stopLayout() { - layouter.stop(); - } - - public void resumeLayout(){ - if (layoutBox.isSelected()) { - layouter.start(); - } - else { - layouter.stop(); - } - } - public RDFGraph getGraph() { return (RDFGraph) graphPane.getGraph(); --- 304,307 ---- Index: GraphlApplet.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplet.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GraphlApplet.java 4 Oct 2004 10:21:03 -0000 1.7 --- GraphlApplet.java 14 Oct 2004 13:03:04 -0000 1.8 *************** *** 206,210 **** super.start(); ! mainPanel.resumeLayout(); } --- 206,210 ---- super.start(); ! mainPanel.getGraphPane().resumeLayouter(); } *************** *** 215,219 **** super.stop(); ! mainPanel.stopLayout(); } --- 215,219 ---- super.stop(); ! mainPanel.getGraphPane().stopLayouter(); } Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GraphlApplication.java 5 Oct 2004 07:54:20 -0000 1.9 --- GraphlApplication.java 14 Oct 2004 13:03:04 -0000 1.10 *************** *** 46,49 **** --- 46,51 ---- */ public class GraphlApplication extends JFrame { + + public static final String DEFAULT_FILE = null; GraphlPanel mainPanel; *************** *** 252,256 **** } ! mainPanel.stopLayout(); mainPanel.getGraph().clear(); mainPanel.getGraph().resetDirty(); --- 254,258 ---- } ! mainPanel.getGraphPane().pauseLayouter(); mainPanel.getGraph().clear(); mainPanel.getGraph().resetDirty(); *************** *** 259,263 **** setTitle("Graphl - untitled"); ! mainPanel.resumeLayout(); } /** --- 261,265 ---- setTitle("Graphl - untitled"); ! mainPanel.getGraphPane().resumeLayouter(); } /** *************** *** 355,377 **** if (option == JFileChooser.APPROVE_OPTION) { - if (chooser.getSelectedFile() != null){ - currentFile = chooser.getSelectedFile(); - } - - mainPanel.stopLayout(); ! mainPanel.getGraph().clear(); ! try { ! mainPanel.getGraph().readFromFile(chooser.getSelectedFile().getAbsolutePath()); ! setTitle("Graphl - " + chooser.getSelectedFile().getName()); ! } catch (IOException ioex) { ioex.printStackTrace(); JOptionPane.showMessageDialog(this, "Error while loading file:\n" + ioex.getMessage(), "File Error", JOptionPane.ERROR_MESSAGE); } ! finally { ! mainPanel.resumeLayout(); ! } } } --- 357,388 ---- if (option == JFileChooser.APPROVE_OPTION) { ! try { ! loadFile(chooser.getSelectedFile()); ! } catch (IOException ioex) { ioex.printStackTrace(); JOptionPane.showMessageDialog(this, "Error while loading file:\n" + ioex.getMessage(), "File Error", JOptionPane.ERROR_MESSAGE); } ! ! } ! } ! ! public void loadFile(File f) throws IOException { ! try { ! if (f != null){ ! ! mainPanel.getGraphPane().pauseLayouter(); ! mainPanel.getGraph().clear(); ! ! mainPanel.getGraph().readFromFile(f.getAbsolutePath()); ! setTitle("Graphl - " + f.getName()); ! currentFile = f; ! } } + finally { + mainPanel.getGraphPane().resumeLayouter(); + } + } *************** *** 399,403 **** int[] pos = {0,0}; boolean decorations = true; ! String filename = System.getProperty("user.dir") + "/graphs/default.rdf"; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; --- 410,414 ---- int[] pos = {0,0}; boolean decorations = true; ! String filename = System.getProperty("user.dir") + DEFAULT_FILE; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; *************** *** 433,438 **** try { app.loadSettings(configfile); ! app.mainPanel.getGraph().readFromFile(filename); ! app.setTitle("Graphl - default.rdf"); } catch (IOException ioex) { --- 444,450 ---- try { app.loadSettings(configfile); ! if (filename != null) { ! app.loadFile(new File(filename)); ! } } catch (IOException ioex) { *************** *** 449,453 **** System.out.println("usage:"); System.out.println("graphl [size=<width>,<height>] [pos=<x>,<y>] [decorations={on|off}]\n" + ! " [settings=<filename.rdf>] [<filename.rdf>]"); System.out.println("-------------------------------------------------------------------"); if (exit) System.exit(0); --- 461,465 ---- System.out.println("usage:"); System.out.println("graphl [size=<width>,<height>] [pos=<x>,<y>] [decorations={on|off}]\n" + ! " [config=<filename.rdf>] [<filename.rdf>]"); System.out.println("-------------------------------------------------------------------"); if (exit) System.exit(0); Index: GraphlPane.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlPane.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GraphlPane.java 4 Oct 2004 10:21:03 -0000 1.12 --- GraphlPane.java 14 Oct 2004 13:03:04 -0000 1.13 *************** *** 40,57 **** import org.mediavirus.graphl.graph.rdf.RDFGraph; import org.mediavirus.graphl.interaction.Manipulator; ! import org.mediavirus.graphl.layout.AbsoluteNodeLayouter; ! import org.mediavirus.graphl.layout.NeutralEdgeLayouter; ! import org.mediavirus.graphl.layout.RepulsionNodeLayouter; ! import org.mediavirus.graphl.layout.SortedNodeLayouter; ! import org.mediavirus.graphl.layout.SpringEdgeLayouter; ! import org.mediavirus.graphl.layout.UnconstrainedNodeLayouter; ! import org.mediavirus.graphl.painter.BoxNodePainter; import org.mediavirus.graphl.painter.EdgePainter; - import org.mediavirus.graphl.painter.ImageNodePainter; - import org.mediavirus.graphl.painter.InvisibleEdgePainter; - import org.mediavirus.graphl.painter.InvisibleNodePainter; - import org.mediavirus.graphl.painter.ManhattanEdgePainter; import org.mediavirus.graphl.painter.NodePainter; - import org.mediavirus.graphl.painter.StraightLineEdgePainter; import org.mediavirus.graphl.selection.DefaultSelectionModel; import org.mediavirus.graphl.selection.SelectionModel; --- 40,47 ---- import org.mediavirus.graphl.graph.rdf.RDFGraph; import org.mediavirus.graphl.interaction.Manipulator; ! import org.mediavirus.graphl.layout.GraphlLayoutStrategy; ! import org.mediavirus.graphl.layout.Layouter; import org.mediavirus.graphl.painter.EdgePainter; import org.mediavirus.graphl.painter.NodePainter; import org.mediavirus.graphl.selection.DefaultSelectionModel; import org.mediavirus.graphl.selection.SelectionModel; *************** *** 71,78 **** private boolean autoRegisterTypes = true; AffineTransform transform = null; AffineTransform translationXF = null; AffineTransform scaleXF = null; ! private Point2D.Double translationPoint; FacetRegistry facetRegistry = new SimpleFacetRegistry(); --- 61,70 ---- private boolean autoRegisterTypes = true; + Layouter layouter; + AffineTransform transform = null; AffineTransform translationXF = null; AffineTransform scaleXF = null; ! private Point2D translationPoint = new Point2D.Double(0,0); FacetRegistry facetRegistry = new SimpleFacetRegistry(); *************** *** 82,86 **** protected Graph graph; /** The listener for the graph. */ ! protected GraphListener graphListner; /** The map of node positions. */ protected Map nodePositions; --- 74,78 ---- protected Graph graph; /** The listener for the graph. */ ! protected GraphListener graphListener; /** The map of node positions. */ protected Map nodePositions; *************** *** 89,96 **** /** The map of rigestered manipulators keyed by their name. */ protected Map manipulatorsByName; - private NodePainter defaultNodePainter; protected SelectionModel selection; /** * Creates a graph pane. --- 81,89 ---- /** The map of rigestered manipulators keyed by their name. */ protected Map manipulatorsByName; protected SelectionModel selection; + private boolean layouterRunning; + /** * Creates a graph pane. *************** *** 100,104 **** public GraphlPane(Graph graph) { super(null); ! graphListner=new GraphHandler(); nodePositions=new HashMap(); manipulators=new ArrayList(); --- 93,97 ---- public GraphlPane(Graph graph) { super(null); ! graphListener=new GraphHandler(); nodePositions=new HashMap(); manipulators=new ArrayList(); *************** *** 108,112 **** setBackground(Color.white); ToolTipManager.sharedInstance().registerComponent(this); - defaultNodePainter = new BoxNodePainter(); updateTransform(); --- 101,104 ---- *************** *** 114,119 **** graph.addGraphListener(this); ! setupDefaultPainters(); ! } public GraphlPane() { --- 106,113 ---- graph.addGraphListener(this); ! layouter = new Layouter(new GraphlLayoutStrategy(getGraph(), getFacetRegistry())); ! startLayouter(); ! //setupDefaultPainters(); ! } public GraphlPane() { *************** *** 145,174 **** */ ! private void setupDefaultPainters() { ! ! // register the available painter classes (for user selection) ! facetRegistry.registerEdgePainter(new StraightLineEdgePainter()); ! facetRegistry.registerEdgePainter(new ManhattanEdgePainter()); ! facetRegistry.registerEdgePainter(new InvisibleEdgePainter()); ! ! facetRegistry.registerNodePainter(new BoxNodePainter()); ! facetRegistry.registerNodePainter(new ImageNodePainter()); ! facetRegistry.registerNodePainter(new InvisibleNodePainter()); ! ! facetRegistry.registerEdgeLayouter(new SpringEdgeLayouter()); ! facetRegistry.registerEdgeLayouter(new NeutralEdgeLayouter()); ! ! facetRegistry.registerNodeLayouter(new UnconstrainedNodeLayouter()); ! facetRegistry.registerNodeLayouter(new RepulsionNodeLayouter()); ! facetRegistry.registerNodeLayouter(new AbsoluteNodeLayouter()); ! facetRegistry.registerNodeLayouter(new SortedNodeLayouter()); ! ! // set default painters ! facetRegistry.setDefaultEdgePainter(new StraightLineEdgePainter()); ! facetRegistry.setDefaultNodePainter(new BoxNodePainter()); ! facetRegistry.setDefaultEdgeLayouter(new SpringEdgeLayouter()); ! facetRegistry.setDefaultNodeLayouter(new RepulsionNodeLayouter()); ! ! } private void updateTransform() { --- 139,168 ---- */ ! // private void setupDefaultPainters() { ! // ! // // register the available painter classes (for user selection) ! // facetRegistry.registerEdgePainter(new StraightLineEdgePainter()); ! // facetRegistry.registerEdgePainter(new ManhattanEdgePainter()); ! // facetRegistry.registerEdgePainter(new InvisibleEdgePainter()); ! // ! // facetRegistry.registerNodePainter(new BoxNodePainter()); ! // facetRegistry.registerNodePainter(new ImageNodePainter()); ! // facetRegistry.registerNodePainter(new InvisibleNodePainter()); ! // ! // facetRegistry.registerEdgeLayouter(new SpringEdgeLayouter()); ! // facetRegistry.registerEdgeLayouter(new NeutralEdgeLayouter()); ! // ! // facetRegistry.registerNodeLayouter(new UnconstrainedNodeLayouter()); ! // facetRegistry.registerNodeLayouter(new RepulsionNodeLayouter()); ! // facetRegistry.registerNodeLayouter(new AbsoluteNodeLayouter()); ! // facetRegistry.registerNodeLayouter(new SortedNodeLayouter()); ! // ! // // set default painters ! // facetRegistry.setDefaultEdgePainter(new StraightLineEdgePainter()); ! // facetRegistry.setDefaultNodePainter(new BoxNodePainter()); ! // facetRegistry.setDefaultEdgeLayouter(new SpringEdgeLayouter()); ! // facetRegistry.setDefaultNodeLayouter(new RepulsionNodeLayouter()); ! // ! // } private void updateTransform() { *************** *** 206,229 **** if (graph!=null) synchronized (graph) { Rectangle bounds=new Rectangle(); ! long edgesStart=System.currentTimeMillis(); ! Iterator iterator=graph.getEdges().iterator(); ! while (iterator.hasNext()) { ! Edge edge=(Edge)iterator.next(); ! getEdgeScreenBounds(edge,bounds); ! if (clipRectangle.intersects(bounds)) ! paintEdge(g2,edge); ! } ! long edgesDur=System.currentTimeMillis()-edgesStart; ! long nodesStart=System.currentTimeMillis(); ! iterator=graph.getNodes().iterator(); ! while (iterator.hasNext()) { ! Node node=(Node)iterator.next(); ! getNodeScreenBounds(node,bounds); ! if (clipRectangle.intersects(bounds)) ! paintNode(g2,node); } for (int i=0;i<manipulators.size();i++) ((Manipulator)manipulators.get(i)).paint(g2); } } --- 200,245 ---- 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 + int nextZ = 0, curZ = 0; Rectangle bounds=new Rectangle(); ! Iterator iterator; ! long renderStartTime=System.currentTimeMillis(); ! while (nextZ < Integer.MAX_VALUE) { ! curZ = nextZ; ! nextZ = Integer.MAX_VALUE; ! iterator=graph.getEdges().iterator(); ! while (iterator.hasNext()) { ! Edge edge=(Edge)iterator.next(); ! int z = edge.getZIndex(); ! if (z == curZ) { ! getEdgeScreenBounds(edge,bounds); ! if (clipRectangle.intersects(bounds)) { ! paintEdge(g2,edge); ! } ! } ! else if (z>curZ && z<nextZ){ ! nextZ = z; ! } ! } ! iterator=graph.getNodes().iterator(); ! while (iterator.hasNext()) { ! Node node=(Node)iterator.next(); ! int z = node.getZIndex(); ! if (z == curZ) { ! getNodeScreenBounds(node,bounds); ! if (clipRectangle.intersects(bounds)) { ! paintNode(g2,node); ! } ! } ! else if (z>curZ && z<nextZ){ ! nextZ = z; ! } ! } ! // System.out.println("curZ: " + curZ + " nextZ: " + nextZ + " dur: " + (System.currentTimeMillis()-renderStartTime)); } for (int i=0;i<manipulators.size();i++) ((Manipulator)manipulators.get(i)).paint(g2); + //long renderDuration = System.currentTimeMillis()-renderStartTime; } } *************** *** 402,409 **** Graph oldGraph = this.graph; if (this.graph!=null) ! this.graph.removeGraphListener(graphListner); this.graph=graph; if (this.graph!=null) ! this.graph.addGraphListener(graphListner); nodePositions.clear(); repaint(); --- 418,425 ---- Graph oldGraph = this.graph; if (this.graph!=null) ! this.graph.removeGraphListener(graphListener); this.graph=graph; if (this.graph!=null) ! this.graph.addGraphListener(graphListener); nodePositions.clear(); repaint(); *************** *** 437,447 **** /** - * @return - */ - private NodePainter getDefaultNodePainter() { - return defaultNodePainter; - } - - /** * Returns the node at given point, or <code>null</code> if there is no such node. * --- 453,456 ---- *************** *** 778,780 **** --- 787,825 ---- } + /** + * @return Returns the layouter. + */ + public Layouter getLayouter() { + return layouter; + } + + public void startLayouter() { + if (layouter != null) { + layouter.start(); + layouterRunning = true; + } + } + + public void stopLayouter() { + if (layouter != null) { + layouter.stop(); + layouterRunning = false; + } + } + + public void pauseLayouter() { + if (layouterRunning && layouter != null) { + layouter.stop(); + } + } + + public void resumeLayouter() { + if (layouterRunning && layouter != null) { + layouter.start(); + } + } + + public boolean isLayouterRunning() { + return layouterRunning; + } } |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:51
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/graphl/view Modified Files: LabelGenerator.java GraphFacetRegistry.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: GraphFacetRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/GraphFacetRegistry.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GraphFacetRegistry.java 4 Oct 2004 10:21:04 -0000 1.5 --- GraphFacetRegistry.java 14 Oct 2004 13:03:02 -0000 1.6 *************** *** 133,137 **** while (assignedTypes.hasNext()) { Node classNode = (Node)assignedTypes.next(); ! String type = classNode.getValue(); setPainterForNodeType(type, nodePainter); } --- 133,137 ---- while (assignedTypes.hasNext()) { Node classNode = (Node)assignedTypes.next(); ! String type = classNode.getId(); setPainterForNodeType(type, nodePainter); } *************** *** 150,154 **** while (assignedTypes.hasNext()) { Node classNode = (Node)assignedTypes.next(); ! String type = classNode.getValue(); setPainterForEdgeType(type, edgePainter); } --- 150,154 ---- while (assignedTypes.hasNext()) { Node classNode = (Node)assignedTypes.next(); ! String type = classNode.getId(); setPainterForEdgeType(type, edgePainter); } *************** *** 167,171 **** while (assignedTypes.hasNext()) { Node classNode = (Node)assignedTypes.next(); ! String type = classNode.getValue(); setLayouterForNodeType(type, nodeLayouter); } --- 167,171 ---- while (assignedTypes.hasNext()) { Node classNode = (Node)assignedTypes.next(); ! String type = classNode.getId(); setLayouterForNodeType(type, nodeLayouter); } *************** *** 184,188 **** while (assignedTypes.hasNext()) { Node classNode = (Node)assignedTypes.next(); ! String type = classNode.getValue(); setLayouterForEdgeType(type, edgeLayouter); } --- 184,188 ---- while (assignedTypes.hasNext()) { Node classNode = (Node)assignedTypes.next(); ! String type = classNode.getId(); setLayouterForEdgeType(type, edgeLayouter); } Index: LabelGenerator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/view/LabelGenerator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LabelGenerator.java 4 Oct 2004 10:21:04 -0000 1.6 --- LabelGenerator.java 14 Oct 2004 13:03:02 -0000 1.7 *************** *** 54,58 **** break; case VALUE: ! value = node.getValue(); break; case PROPERTY: --- 54,58 ---- break; case VALUE: ! value = node.getId(); break; case PROPERTY: *************** *** 63,67 **** Edge edge = (Edge) edges.next(); if (edge.getType().equals(data)) { ! value = edge.getTo().getValue(); } } --- 63,67 ---- Edge edge = (Edge) edges.next(); if (edge.getType().equals(data)) { ! value = edge.getTo().getId(); } } *************** *** 91,95 **** break; case VALUE: ! value = edge.getValue(); break; case PROPERTY: --- 91,95 ---- break; case VALUE: ! value = edge.getId(); break; case PROPERTY: *************** *** 284,288 **** } ! while (listNode != null && !listNode.getValue().equals("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil")) { Node labelFacetNode = listNode.getFirstNeighbour("http://www.w3.org/1999/02/22-rdf-syntax-ns#first", true); if (labelFacetNode != null) { --- 284,288 ---- } ! while (listNode != null && !listNode.getId().equals("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil")) { Node labelFacetNode = listNode.getFirstNeighbour("http://www.w3.org/1999/02/22-rdf-syntax-ns#first", true); if (labelFacetNode != null) { |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:41
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/graphl/layout Modified Files: RepulsionNodeLayouter.java SortedNodeLayouter.java AbsoluteNodeLayouter.java GraphlLayoutStrategy.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: GraphlLayoutStrategy.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/GraphlLayoutStrategy.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GraphlLayoutStrategy.java 4 Oct 2004 10:21:01 -0000 1.7 --- GraphlLayoutStrategy.java 14 Oct 2004 13:02:58 -0000 1.8 *************** *** 432,614 **** } - ///** - // * Executes one step in the layout. - // */ - //public void executeGraphLayoutStep() { - // for (int i=0;i<10;i++) { - // relaxEdges(); - // adjustNodePairs(); - // moveNodes(); - // damp(); - // } - //} - ///** - // * Returns <code>true</code> if more steps in the layout should be executed. - // * - // * @return <code>true</code> if more steps should be executed - // */ - //public boolean shouldExecuteStep() { - // return !(m_damper<0.1 && m_damping && m_maxMotion<0.001); - //} - ///** - // * Relaxes the edges. - // */ - //protected void relaxEdges() { - // Iterator edges=m_graph.getEdges().iterator(); - // while (edges.hasNext()) { - // Edge edge=(Edge)edges.next(); - // Node from=edge.getFrom(); - // Node to=edge.getTo(); - // double deltaX=to.getX()-from.getX(); - // double deltaY=to.getY()-from.getY(); - // double currentLength=Math.sqrt(deltaX*deltaX+deltaY*deltaY); - // double factor=m_rigidity*currentLength/(edge.getLength()*100.0); - // double dx=deltaX*factor; - // double dy=deltaY*factor; - // // Edges pull directly in proportion to the distance between the nodes. This is good, - // // because we want the edges to be stretchy. The edges are ideal rubberbands. - // // They don't become springs when they are too short. That only causes the graph to oscillate. - // applyDelta(from,m_graphManager.getNodeMovement(from),dx,dy); - // applyDelta(to,m_graphManager.getNodeMovement(to),-dx,-dy); - // } - //} - ///** - // * Adjusts the pairs of nodes. - // */ - //private void adjustNodePairs() { - // SubGraph currentSubGraph=m_graphManager.getFirstSubGraph(); - // while (currentSubGraph!=null) { - // NodeMovement node1Movement=currentSubGraph.getFirstNodeMovement(); - // while (node1Movement!=null) { - // Node node1=node1Movement.m_node; - // NodeMovement node2Movement=currentSubGraph.getFirstNodeMovement(); - // while (node2Movement!=null) { - // Node node2=node2Movement.m_node; - // if (node1!=node2) { - // double dx=0; - // double dy=0; - // double deltaX=node1.getX()-node2.getX(); - // double deltaY=node1.getY()-node2.getY(); - // double currentLengthSquared=deltaX*deltaX+deltaY*deltaY; //so it's length squared - // if (Math.abs(currentLengthSquared)<0.1) { - // dx=Math.random(); //If two nodes are right on top of each other, randomly separate - // dy=Math.random(); - // } - // else if (currentLengthSquared<600*600) { // 600, because we don't want deleted nodes to fly too far away - // dx=deltaX/currentLengthSquared; // If it was sqrt(len) then a single node surrounded by many others will - // dy=deltaY/currentLengthSquared; // always look like a circle. This might look good at first, but I think - // // it makes large graphs look ugly+it contributes to oscillation. A - // // linear function does not fall off fast enough, so you get rough edges - // // in the 'force field' - // } - // double factor=100.0*node1.getRepulsion()*node2.getRepulsion()*m_rigidity; - // dx*=factor; - // dy*=factor; - // applyDelta(node1,node1Movement,dx,dy); - // applyDelta(node2,node2Movement,-dx,-dy); - // } - // node2Movement=(NodeMovement)node2Movement.m_next; - // } - // node1Movement=(NodeMovement)node1Movement.m_next; - // } - // currentSubGraph=(SubGraph)currentSubGraph.m_next; - // }; - //} - ///** - // * Moves nodes for the computed delta. - // */ - //protected void moveNodes() { - // double lastMaxMotion=m_maxMotion; - // m_maxMotion=0; - // Iterator iterator=m_graph.getNodes().iterator(); - // while (iterator.hasNext()) { - // Node node=(Node)iterator.next(); - // NodeMovement movement=m_graphManager.getNodeMovement(node); - // double dx=movement.m_dx; - // double dy=movement.m_dy; - // dx*=m_damper; // The damper slows things down. It cuts down jiggling at the last moment, and optimizes - // dy*=m_damper; // layout. As an experiment, get rid of the damper in these lines, and make a - // // long straight line of nodes. It wiggles too much and doesn't straighten out. - // // Slow down, but don't stop. Nodes in motion store momentum. This helps when the force - // // on a node is very low, but you still want to get optimal layout. - // movement.m_dx=dx/2; - // movement.m_dy=dy/2; - // if (!node.isFixed()) { - // double distanceMoved=Math.sqrt(dx*dx+dy*dy); - // // Don't move faster then 30 units at a time. Important in order toprevent severed nodes from flying away. - // double x=node.getX()+Math.max(-30,Math.min(30,dx)); - // double y=node.getY()+Math.max(-30,Math.min(30,dy)); - // node.setLocation(x,y); - // m_maxMotion=Math.max(distanceMoved,m_maxMotion); - // } - // if (movement.m_justChanged) { - // if (System.currentTimeMillis()>movement.m_timeWhenNodeBecomesNormal) - // movement.m_justChanged=false; - // } - // } - // if (m_maxMotion>0) - // m_motionRatio=lastMaxMotion/m_maxMotion-1; //subtract 1 to make a positive value mean that things are moving faster - // else - // m_motionRatio=0; - //} - ///** - // * Applies a delta to a node. - // * - // * @param node the node to which the delta is added - // * @param nodeMovement the node movement - // * @param dx delta in the X direction - // * @param dy delta in the Y direction - // */ - //protected void applyDelta(Node node,NodeMovement nodeMovement,double dx,double dy) { - // if (nodeMovement.m_justChanged) { - // nodeMovement.m_dx+=dx/10; - // nodeMovement.m_dy+=dy/10; - // } - // else { - // nodeMovement.m_dx+=dx; - // nodeMovement.m_dy+=dy; - // } - //} - ///** - // * Turns damping off. - // */ - //public void stopDamper() { - // m_damping=false; - // m_damper=1.0; - //} - ///** - // * Stabilizes the graph gently, by setting the damper to a low value. - // */ - //public void stopMotion() { - // m_damping=true; - // if (m_damper>0.3) - // m_damper=0.3; - // else - // m_damper=0; - //} - ///** - // * Applies the damping. - // */ - //public void damp() { - // if (m_damping) { - // // This is important. Only damp when the graph starts to move faster - // // When there is noise, you damp roughly half the time. (Which is a lot) - // // If things are slowing down, then you can let them do so on their own, - // // without damping. - // if (m_motionRatio<=0.001) { - // //If max motion<0.2, damp away - // //If by the time the damper has ticked down to 0.9, maxMotion is still>1, damp away - // //We never want the damper to be negative though - // if ((m_maxMotion<0.2 || (m_maxMotion>1 && m_damper<0.9)) && m_damper > 0.01) - // m_damper-=0.01; - // //If we've slowed down significanly, damp more aggresively (then the line two below) - // else if (m_maxMotion<0.4 && m_damper > 0.003) - // m_damper-=0.003; - // //If max motion is pretty high, and we just started damping, then only damp slightly - // else if(m_damper>0.0001) - // m_damper -=0.0001; - // } - // } - // if(m_maxMotion<0.001 && m_damping) - // m_damper=0; - //} --- 432,433 ---- Index: RepulsionNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/RepulsionNodeLayouter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RepulsionNodeLayouter.java 4 Oct 2004 10:21:01 -0000 1.4 --- RepulsionNodeLayouter.java 14 Oct 2004 13:02:58 -0000 1.5 *************** *** 36,39 **** --- 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) { Index: AbsoluteNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/AbsoluteNodeLayouter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbsoluteNodeLayouter.java 5 Oct 2004 07:54:19 -0000 1.5 --- AbsoluteNodeLayouter.java 14 Oct 2004 13:02:58 -0000 1.6 *************** *** 52,55 **** --- 52,57 ---- node.setCenter(r.getCenterX(), r.getCenterY()); node.setSize(r.getWidth(), r.getHeight()); + // TODO make this configurable + node.setZIndex(0); } else { *************** *** 64,67 **** --- 66,71 ---- node.setCenter(r.getCenterX(), r.getCenterY()); node.setSize(r.getWidth(), r.getHeight()); + // TODO make this configurable + node.setZIndex(0); } else { Index: SortedNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/SortedNodeLayouter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SortedNodeLayouter.java 4 Oct 2004 10:21:01 -0000 1.4 --- SortedNodeLayouter.java 14 Oct 2004 13:02:58 -0000 1.5 *************** *** 42,49 **** if (orientation == LEFTTORIGHT) { ! if ((other.getValue().compareTo(node.getValue()) < 0) && (other.getCenterX() > node.getCenterX()-30)) { movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; } ! else if ((other.getValue().compareTo(node.getValue()) > 0) && (other.getCenterX() < node.getCenterX()+30)) { movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; } --- 42,50 ---- if (orientation == LEFTTORIGHT) { ! // TODO (1, 1h) change all getLabel() calls to generic sorting mechanism ! if ((other.getLabel().compareTo(node.getLabel()) < 0) && (other.getCenterX() > node.getCenterX()-30)) { movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; } ! else if ((other.getLabel().compareTo(node.getLabel()) > 0) && (other.getCenterX() < node.getCenterX()+30)) { movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; } *************** *** 54,61 **** if (orientation == RIGHTTOLEFT) { ! if ((other.getValue().compareTo(node.getValue()) > 0) && (other.getCenterX() > node.getCenterX()-30)) { movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; } ! else if ((other.getValue().compareTo(node.getValue()) < 0) && (other.getCenterX() < node.getCenterX()+30)) { movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; } --- 55,62 ---- if (orientation == RIGHTTOLEFT) { ! if ((other.getLabel().compareTo(node.getLabel()) > 0) && (other.getCenterX() > node.getCenterX()-30)) { movement.dx += (other.getCenterX()-node.getCenterX()+30) / 10; } ! else if ((other.getLabel().compareTo(node.getLabel()) < 0) && (other.getCenterX() < node.getCenterX()+30)) { movement.dx -= (node.getCenterX()+30-other.getCenterX()) / 10; } *************** *** 66,73 **** if (orientation == TOPTOBOTTOM) { ! if ((other.getValue().compareTo(node.getValue()) < 0) && (other.getCenterY() > node.getCenterY()-30)) { movement.dy += (other.getCenterY()-node.getCenterY()+30) / 10; } ! else if ((other.getValue().compareTo(node.getValue()) > 0) && (other.getCenterY() < node.getCenterY()+30)) { movement.dy -= (node.getCenterY()+30-other.getCenterY()) / 10; } --- 67,74 ---- if (orientation == TOPTOBOTTOM) { ! if ((other.getLabel().compareTo(node.getLabel()) < 0) && (other.getCenterY() > node.getCenterY()-30)) { movement.dy += (other.getCenterY()-node.getCenterY()+30) / 10; } ! else if ((other.getLabel().compareTo(node.getLabel()) > 0) && (other.getCenterY() < node.getCenterY()+30)) { movement.dy -= (node.getCenterY()+30-other.getCenterY()) / 10; } *************** *** 78,85 **** if (orientation == LEFTTORIGHT) { ! if ((other.getValue().compareTo(node.getValue()) > 0) && (other.getCenterY() > node.getCenterY()-30)) { movement.dy += (other.getCenterY()-node.getCenterY()+30) / 10; } ! else if ((other.getValue().compareTo(node.getValue()) < 0) && (other.getCenterY() < node.getCenterY()+30)) { movement.dy -= (node.getCenterY()+30-other.getCenterY()) / 10; } --- 79,86 ---- if (orientation == LEFTTORIGHT) { ! if ((other.getLabel().compareTo(node.getLabel()) > 0) && (other.getCenterY() > node.getCenterY()-30)) { movement.dy += (other.getCenterY()-node.getCenterY()+30) / 10; } ! else if ((other.getLabel().compareTo(node.getLabel()) < 0) && (other.getCenterY() < node.getCenterY()+30)) { movement.dy -= (node.getCenterY()+30-other.getCenterY()) / 10; } |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:19
|
Update of /cvsroot/graphl/graphl/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/config Added Files: netznetz-config.rdf Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code --- NEW FILE: netznetz-config.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 rdfs 'http://www.w3.org/2000/01/rdf-schema#'> <!ENTITY owl 'http://www.w3.org/2002/07/owl#'> <!ENTITY map 'http://fabl.net/vocabularies/geography/map/1.1/'> <!ENTITY geo 'http://www.w3.org/2003/01/geo/wgs84_pos#'> <!ENTITY foo 'http://www.mediavirus.org/foo#'> ]> <rdf:RDF xml:base="" xmlns:graphl="&graphl;" xmlns:foaf="&foaf;" xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:owl="&owl;" xmlns:map="↦" xmlns:geo="&geo;" xmlns:foo="&foo;" > <!--<graphl:Configuration> <rdf:seeAlso rdf:about="facets.rdf"/> <rdf:seeAlso rdf:about="vocabularies.rdf"/> </graphl:Configuration>--> <graphl:Configuration> <graphl:availableNodeLayouters> <rdf:Bag> <rdf:li> <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.UnconstrainedNodeLayouter"> </graphl:NodeLayouter> </rdf:li> <rdf:li> <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.RepulsionNodeLayouter"> </graphl:NodeLayouter> </rdf:li> <rdf:li> <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.AbsoluteNodeLayouter"> </graphl:NodeLayouter> </rdf:li> <rdf:li> <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.SortedNodeLayouter"> </graphl:NodeLayouter> </rdf:li> </rdf:Bag> </graphl:availableNodeLayouters> <graphl:availableNodePainters> <rdf:Bag> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.BoxNodePainter"> </graphl:NodePainter> </rdf:li> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.ImageNodePainter"> <graphl:defaultImage> <graphl:Image rdf:about="http://www.mediavirus.org/graphl/images/default.gif"/> </graphl:defaultImage> </graphl:NodePainter> </rdf:li> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.InvisibleNodePainter"> </graphl:NodePainter> </rdf:li> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.ShapeNodePainter"> </graphl:NodePainter> </rdf:li> </rdf:Bag> </graphl:availableNodePainters> <graphl:availableEdgeLayouters> <rdf:Bag> <rdf:li> <graphl:EdgeLayouter graphl:javaClass="org.mediavirus.graphl.layout.SpringEdgeLayouter"> </graphl:EdgeLayouter> </rdf:li> <rdf:li> <graphl:EdgeLayouter graphl:javaClass="org.mediavirus.graphl.layout.DirectedEdgeLayouter"> </graphl:EdgeLayouter> </rdf:li> <rdf:li> <graphl:EdgeLayouter graphl:javaClass="org.mediavirus.graphl.layout.NeutralEdgeLayouter"> </graphl:EdgeLayouter> </rdf:li> </rdf:Bag> </graphl:availableEdgeLayouters> <graphl:availableEdgePainters> <rdf:Bag> <rdf:li> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter"> </graphl:EdgePainter> </rdf:li> <rdf:li> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.ManhattanEdgePainter"> </graphl:EdgePainter> </rdf:li> <rdf:li> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.InvisibleEdgePainter"> </graphl:EdgePainter> </rdf:li> </rdf:Bag> </graphl:availableEdgePainters> <graphl:defaultNodePainter> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.BoxNodePainter" graphl:baseColor="#f0f0f0"> <graphl:labelGenerator> <graphl:LabelGenerator> <graphl:labelFacets> <rdf:List> <rdf:first> <graphl:LabelFacet graphl:labelFacetType="Value" graphl:guessName="true"/> </rdf:first> <rdf:rest> <rdf:nil/> </rdf:rest> </rdf:List> </graphl:labelFacets> </graphl:LabelGenerator> </graphl:labelGenerator> </graphl:NodePainter> </graphl:defaultNodePainter> <graphl:defaultEdgePainter> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" graphl:paintLabel="true" graphl:labelColor="#666666"/> </graphl:defaultEdgePainter> <graphl:defaultNodeLayouter> <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.RepulsionNodeLayouter"/> </graphl:defaultNodeLayouter> <graphl:defaultEdgeLayouter> <graphl:EdgeLayouter graphl:javaClass="org.mediavirus.graphl.layout.SpringEdgeLayouter"/> </graphl:defaultEdgeLayouter> <graphl:assignedNodePainters> <rdf:Bag> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.BoxNodePainter" graphl:baseColor="#e0e0e0" graphl:borderColor="#990033" graphl:font="Verdana-14" graphl:borderStroke="2.0"> <graphl:labelGenerator> <graphl:LabelGenerator> <graphl:labelFacets> <rdf:List> <rdf:first> <graphl:LabelFacet graphl:labelFacetType="Property" graphl:labelFacetValue="&foaf;name"/> </rdf:first> <rdf:rest> <rdf:nil/> </rdf:rest> </rdf:List> </graphl:labelFacets> </graphl:LabelGenerator> </graphl:labelGenerator> <graphl:assignedToType> <rdfs:Class rdf:about="&foaf;Person"/> </graphl:assignedToType> <graphl:assignedToType> <rdfs:Class rdf:about="&foaf;Group"/> </graphl:assignedToType> <graphl:assignedToType> <rdfs:Class rdf:about="&foaf;Project"/> </graphl:assignedToType> <graphl:assignedToType> <rdfs:Class rdf:about="&foo;Institute"/> </graphl:assignedToType> <graphl:assignedToType> <rdfs:Class rdf:about="&foo;University"/> </graphl:assignedToType> </graphl:NodePainter> </rdf:li> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.BoxNodePainter" graphl:baseColor="#e0e0e0"> <graphl:labelGenerator> <graphl:LabelGenerator> <graphl:labelFacets> <rdf:List> <rdf:first> <graphl:LabelFacet graphl:labelFacetType="Value" graphl:guessName="true"/> </rdf:first> <rdf:rest> <rdf:nil/> </rdf:rest> </rdf:List> </graphl:labelFacets> </graphl:LabelGenerator> </graphl:labelGenerator> <graphl:assignedToType> <rdfs:Class rdf:about="&rdfs;Class"/> </graphl:assignedToType> </graphl:NodePainter> </rdf:li> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.BoxNodePainter" graphl:baseColor="#f0f0f0"> <graphl:labelGenerator> <graphl:LabelGenerator> <graphl:labelFacets> <rdf:List> <rdf:first> <graphl:LabelFacet graphl:labelFacetType="Value" graphl:guessName="true"/> </rdf:first> <rdf:rest> <rdf:nil/> </rdf:rest> </rdf:List> </graphl:labelFacets> </graphl:LabelGenerator> </graphl:labelGenerator> <graphl:assignedToType> <rdfs:Class rdf:about="&rdf;Property"/> </graphl:assignedToType> </graphl:NodePainter> </rdf:li> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.BoxNodePainter" graphl:baseColor="#f0f0f0"> <graphl:labelGenerator> <graphl:LabelGenerator> <graphl:labelFacets> <rdf:List> <rdf:first> <graphl:LabelFacet graphl:labelFacetType="String" graphl:labelFacetValue=" . "/> </rdf:first> <rdf:rest> <rdf:nil/> </rdf:rest> </rdf:List> </graphl:labelFacets> </graphl:LabelGenerator> </graphl:labelGenerator> <graphl:assignedToType> <rdfs:Class rdf:about="&foaf;Document"/> </graphl:assignedToType> </graphl:NodePainter> </rdf:li> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.ImageNodePainter" graphl:method="property" graphl:property="↦image"> <graphl:assignedToType> <rdfs:Class rdf:about="↦Map"/> </graphl:assignedToType> </graphl:NodePainter> </rdf:li> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.ShapeNodePainter" graphl:shape="X"> <graphl:assignedToType> <rdfs:Class rdf:about="&geo;Point"/> </graphl:assignedToType> <graphl:assignedToType> <rdfs:Class rdf:about="&foo;Address"/> </graphl:assignedToType> </graphl:NodePainter> </rdf:li> <rdf:li> <graphl:NodePainter graphl:javaClass="org.mediavirus.graphl.painter.ShapeNodePainter" graphl:shape="circle"> <graphl:assignedToType> <rdfs:Class rdf:about="&rdf;List"/> </graphl:assignedToType> <graphl:assignedToType> <rdfs:Class rdf:about="&rdf;Bag"/> </graphl:assignedToType> </graphl:NodePainter> </rdf:li> </rdf:Bag> </graphl:assignedNodePainters> <graphl:assignedNodeLayouters> <rdf:Bag> <rdf:li> <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.UnconstrainedNodeLayouter"> <!--<graphl:assignedToType> <rdfs:Class rdf:about="&rdfs;Class"/> </graphl:assignedToType>--> <graphl:assignedToType> <rdfs:Class rdf:about="&rdf;nil"/> </graphl:assignedToType> <graphl:assignedToType> <rdfs:Class rdf:about="&graphl;LabelFacet"/> </graphl:assignedToType> </graphl:NodeLayouter> </rdf:li> <rdf:li> <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.AbsoluteNodeLayouter" graphl:method="property" graphl:property="↦coverage" graphl:draggable="false"> <graphl:assignedToType> <rdfs:Class rdf:about="↦Map"/> </graphl:assignedToType> </graphl:NodeLayouter> </rdf:li> <!-- <rdf:li> <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.AbsoluteNodeLayouter" graphl:method="geo" graphl:draggable="false"> <graphl:assignedToType> <rdfs:Class rdf:about="&geo;Point"/> </graphl:assignedToType> </graphl:NodeLayouter> </rdf:li>--> </rdf:Bag> </graphl:assignedNodeLayouters> <graphl:assignedEdgePainters> <rdf:Bag> <rdf:li> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" graphl:paintLabel="false" graphl:stroke="1.0 1 5"> <graphl:assignedToType> <rdf:Property rdf:about="&rdf;type"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&rdfs;range"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&rdfs;isDefinedBy"/> </graphl:assignedToType> </graphl:EdgePainter> </rdf:li> <rdf:li> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" graphl:paintLabel="false" graphl:stroke="1.0 5 5" graphl:color="#ff0000"> <graphl:assignedToType> <rdf:Property rdf:about="&owl;inverseOf"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&owl;disjointWith"/> </graphl:assignedToType> </graphl:EdgePainter> </rdf:li> <rdf:li> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" graphl:paintLabel="true" graphl:stroke="0.33" graphl:color="#000000" graphl:labelColor="#666666"> <graphl:assignedToType> <rdf:Property rdf:about="&foaf;workInfoHomepage"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&foaf;homepage"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&foaf;schoolHomepage"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&foaf;workplaceHomepage"/> </graphl:assignedToType> </graphl:EdgePainter> </rdf:li> <rdf:li> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" graphl:paintLabel="false" graphl:stroke="1.0 5 5"> <graphl:assignedToType> <rdf:Property rdf:about="&rdfs;range"/> </graphl:assignedToType> </graphl:EdgePainter> </rdf:li> <rdf:li> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="false" graphl:paintLabel="false" graphl:stroke="1.0"> <graphl:assignedToType> <rdf:Property rdf:about="&rdf;first"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&graphl;connectedTo"/> </graphl:assignedToType> </graphl:EdgePainter> </rdf:li> <rdf:li> <graphl:EdgePainter graphl:javaClass="org.mediavirus.graphl.painter.StraightLineEdgePainter" graphl:paintArrow="true" graphl:paintLabel="false" graphl:stroke="1.0"> <graphl:assignedToType> <rdf:Property rdf:about="&rdf;rest"/> </graphl:assignedToType> </graphl:EdgePainter> </rdf:li> </rdf:Bag> </graphl:assignedEdgePainters> <graphl:assignedEdgeLayouters> <rdf:Bag> <rdf:li> <graphl:EdgeLayouter graphl:javaClass="org.mediavirus.graphl.layout.NeutralEdgeLayouter"> <graphl:assignedToType> <rdf:Property rdf:about="&rdf;type"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&rdfs;range"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&rdfs;isDefinedBy"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&owl;disjointWith"/> </graphl:assignedToType> </graphl:EdgeLayouter> </rdf:li> <rdf:li> <graphl:EdgeLayouter graphl:javaClass="org.mediavirus.graphl.layout.DirectedEdgeLayouter" graphl:direction="up"> <graphl:assignedToType> <rdf:Property rdf:about="&rdfs;subClassOf"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&rdfs;subPropertyOf"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&foo;subGroupOf"/> </graphl:assignedToType> <graphl:assignedToType> <rdf:Property rdf:about="&foo;subProjectOf"/> </graphl:assignedToType> </graphl:EdgeLayouter> </rdf:li> <rdf:li> <graphl:EdgeLayouter graphl:javaClass="org.mediavirus.graphl.layout.DirectedEdgeLayouter" graphl:direction="right"> <graphl:assignedToType> <rdf:Property rdf:about="&rdf;rest"/> </graphl:assignedToType> </graphl:EdgeLayouter> </rdf:li> <rdf:li> <graphl:EdgeLayouter graphl:javaClass="org.mediavirus.graphl.layout.DirectedEdgeLayouter" graphl:direction="down" graphl:length="40.0"> <graphl:assignedToType> <rdf:Property rdf:about="&rdf;first"/> </graphl:assignedToType> </graphl:EdgeLayouter> </rdf:li> </rdf:Bag> </graphl:assignedEdgeLayouters> </graphl:Configuration> </rdf:RDF> |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:18
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphlManipulator.java 5 Oct 2004 07:54:21 -0000 1.4 --- GraphlManipulator.java 14 Oct 2004 13:03:06 -0000 1.5 *************** *** 42,46 **** private Point mousePos; ! private Node edgeNode; private Edge dragEdge = null; private Node dragNode = null; --- 42,46 ---- private Point mousePos; ! private Node edgeNode = null; private Edge dragEdge = null; private Node dragNode = null; *************** *** 56,60 **** private Point2D oldTranslation; ! boolean doDragNode = true; public GraphlManipulator(){ --- 56,60 ---- private Point2D oldTranslation; ! boolean doDragNode = false; public GraphlManipulator(){ *************** *** 102,109 **** else if (e.getModifiers() == MouseEvent.BUTTON3_MASK) { if (overNode != null) { nodeMenu.show(e.getX(), e.getY(), overNode); } else if(overEdge != null) { ! // TODO (2): stop layout and resume later. (move layouter to graphlpane) (0.5h) edgeMenu.show(e.getX(), e.getY(), overEdge); } --- 102,110 ---- else if (e.getModifiers() == MouseEvent.BUTTON3_MASK) { if (overNode != null) { + graphPane.pauseLayouter(); nodeMenu.show(e.getX(), e.getY(), overNode); } else if(overEdge != null) { ! graphPane.pauseLayouter(); edgeMenu.show(e.getX(), e.getY(), overEdge); } *************** *** 201,208 **** } ! dragEdge = null; dragNode = null; edgeNode = null; doDragNode = false; } --- 202,211 ---- } ! dragEdge = null; dragNode = null; edgeNode = null; doDragNode = false; + + oldTranslation = null; } *************** *** 234,240 **** } else if (!doDragNode && oldTranslation != null){ ! GraphlPane pane = (GraphlPane)graphPane; ! Point2D diff = new Point2D.Double(mousePos.getX() - dragStart.getX(),mousePos.getY() - dragStart.getY()); ! pane.setTranslation(diff.getX()+oldTranslation.getX(), diff.getY()+oldTranslation.getY()); } } --- 237,243 ---- } else if (!doDragNode && oldTranslation != null){ ! double dx = mousePos.getX() - dragStart.getX(); ! double dy = mousePos.getY() - dragStart.getY(); ! graphPane.setTranslation(dx + oldTranslation.getX(), dy + oldTranslation.getY()); } } *************** *** 276,285 **** public Object editingStarted(Node node) { ! return ((RDFNode)node).getValue(); } public boolean editingFinished(Node node, Object value) { if (!((String)value).equals("")) { ! ((RDFNode)node).setValue((String)value); } return true; --- 279,288 ---- public Object editingStarted(Node node) { ! return ((RDFNode)node).getLabel(); } public boolean editingFinished(Node node, Object value) { if (!((String)value).equals("")) { ! ((RDFNode)node).setProperty("http://www.mediavirus.org/graphl#label",(String)value); } return true; |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:18
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/graphl/graph/rdf Modified Files: RDFNode.java RDFEdge.java RDFGraph.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: RDFEdge.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFEdge.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RDFEdge.java 4 Oct 2004 10:21:05 -0000 1.2 --- RDFEdge.java 14 Oct 2004 13:03:05 -0000 1.3 *************** *** 30,34 **** * @return The primary value of this Edge. */ ! public String getValue() { return getType(); } --- 30,34 ---- * @return The primary value of this Edge. */ ! public String getLabel() { return getType(); } Index: RDFNode.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFNode.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RDFNode.java 4 Oct 2004 10:21:05 -0000 1.3 --- RDFNode.java 14 Oct 2004 13:03:05 -0000 1.4 *************** *** 12,15 **** --- 12,17 ---- import org.mediavirus.graphl.graph.Node; + import edu.unika.aifb.rdf.api.util.RDFUtil; + /** * *************** *** 18,25 **** public class RDFNode extends DefaultNode { - protected String value; - protected String id; - protected String comment = null; - protected static int num = 0; --- 20,23 ---- *************** *** 37,41 **** } ! public RDFNode(RDFGraph graph, String id, String value) { super(); --- 35,39 ---- } ! public RDFNode(RDFGraph graph, String id) { super(); *************** *** 48,61 **** setId(getUniqueId()); } - - setValue(value); } ! public String getValue() { ! return value; ! } ! ! public void setValue(String value) { ! this.value = value; } --- 46,60 ---- setId(getUniqueId()); } } ! // TODO (2, 2h) label generation mechanism has to be hooked up here ! public String getLabel() { ! String label = getProperty("http://www.mediavirus.org/graphl#label"); ! if ( label != null) return label; ! else { ! label = RDFUtil.guessName(getId()); ! } ! if (label != null) return label; ! else return ""; } *************** *** 64,68 **** 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()).getValue(); } return null; --- 63,67 ---- 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; *************** *** 74,78 **** RDFEdge e = (RDFEdge)edges.next(); if (e.getType() == "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") { ! if (((RDFNode)e.getTo()).getValue().equals(type)) return true; } } --- 73,77 ---- 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; } } Index: RDFGraph.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/graph/rdf/RDFGraph.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RDFGraph.java 4 Oct 2004 10:21:05 -0000 1.3 --- RDFGraph.java 14 Oct 2004 13:03:05 -0000 1.4 *************** *** 63,71 **** //writer.writeStatement(node.getId(), "http://www.mediavirus.org/graphl#hasLabel", node.getLabel(), null, null, true); //if (node.getComment() != null) writer.writeStatement(node.getId(), "http://www.mediavirus.org/graphl#hasComment", node.getComment(), null, null, true); ! writer.writeStatement(node.getValue(), "http://www.mediavirus.org/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.getValue(), edge.getType(), ((RDFNode)edge.getTo()).getValue(), null, null, false); } } --- 63,71 ---- //writer.writeStatement(node.getId(), "http://www.mediavirus.org/graphl#hasLabel", node.getLabel(), null, null, true); //if (node.getComment() != null) writer.writeStatement(node.getId(), "http://www.mediavirus.org/graphl#hasComment", node.getComment(), null, null, true); ! writer.writeStatement(node.getId(), "http://www.mediavirus.org/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); } } *************** *** 174,178 **** RDFNode node = getNodeById(uri); if (node == null){ ! node = new RDFNode(this, uri, uri); node.setCenter(400*Math.random()-200,400*Math.random()-200); addElements(Collections.singleton(node), null); --- 174,178 ---- RDFNode node = getNodeById(uri); if (node == null){ ! node = new RDFNode(this, uri); node.setCenter(400*Math.random()-200,400*Math.random()-200); addElements(Collections.singleton(node), null); |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:15
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/graphl/vocabulary Modified Files: VocabularyRegistry.java SimpleVocabularyRegistry.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: VocabularyRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary/VocabularyRegistry.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VocabularyRegistry.java 4 Oct 2004 10:21:01 -0000 1.2 --- VocabularyRegistry.java 14 Oct 2004 13:03:05 -0000 1.3 *************** *** 21,25 **** public Enumeration getRegisteredVocabularies(); - public void registerVocabulary(Vocabulary v); } \ No newline at end of file --- 21,28 ---- public Enumeration getRegisteredVocabularies(); public void registerVocabulary(Vocabulary v); + + public String expandNamespace(String uri); + + public String compactNamespace(String uri); } \ No newline at end of file Index: SimpleVocabularyRegistry.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/vocabulary/SimpleVocabularyRegistry.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleVocabularyRegistry.java 4 Oct 2004 10:21:01 -0000 1.2 --- SimpleVocabularyRegistry.java 14 Oct 2004 13:03:05 -0000 1.3 *************** *** 6,11 **** --- 6,14 ---- import java.util.Enumeration; + import java.util.Iterator; import java.util.Vector; + import edu.unika.aifb.rdf.api.util.RDFUtil; + /** * @author Flo Ledermann <led...@im...> *************** *** 16,21 **** Vector registeredVocabularies = new Vector(); ! /* ! * Overrides @see org.mediavirus.graphl.vocabulary.VocabularyRegistry#getRegisteredVocabularies() */ public Enumeration getRegisteredVocabularies() { --- 19,24 ---- Vector registeredVocabularies = new Vector(); ! /** ! * @see org.mediavirus.graphl.vocabulary.VocabularyRegistry#getRegisteredVocabularies() */ public Enumeration getRegisteredVocabularies() { *************** *** 23,28 **** } ! /* ! * Overrides @see org.mediavirus.graphl.vocabulary.VocabularyRegistry#registerVocabulary(org.mediavirus.graphl.vocabulary.Vocabulary) */ public void registerVocabulary(Vocabulary v) { --- 26,31 ---- } ! /** ! * @see org.mediavirus.graphl.vocabulary.VocabularyRegistry#registerVocabulary(org.mediavirus.graphl.vocabulary.Vocabulary) */ public void registerVocabulary(Vocabulary v) { *************** *** 30,32 **** --- 33,66 ---- } + /** + * @see org.mediavirus.graphl.vocabulary.VocabularyRegistry#expandNamespace(java.lang.String) + */ + public String expandNamespace(String uri) { + int pos = uri.indexOf(':'); + if (pos == -1) return uri; + String prefix = uri.substring(0,pos); + for (Iterator iter = registeredVocabularies.iterator(); iter.hasNext();) { + Vocabulary vocab = (Vocabulary) iter.next(); + if (vocab.getDefaultNamespacePrefix().equals(prefix)) { + return vocab.getNamespace() + uri.substring(pos+1); + } + } + return uri; + } + + /** + * @see org.mediavirus.graphl.vocabulary.VocabularyRegistry#compactNamespace(java.lang.String) + */ + public String compactNamespace(String uri) { + String prefix = RDFUtil.guessNamespace(uri); + if (prefix == null) return uri; + for (Iterator iter = registeredVocabularies.iterator(); iter.hasNext();) { + Vocabulary vocab = (Vocabulary) iter.next(); + if (vocab.getNamespace().equals(prefix)) { + return vocab.getDefaultNamespacePrefix() + ":" + RDFUtil.guessName(uri); + } + } + return uri; + } + } |
|
From: Flo L. <fl...@us...> - 2004-10-14 13:03:14
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12051/src/org/mediavirus/util Modified Files: ParseUtils.java Log Message: - FEATURE: added z-index support for painting nodes & edges - FEATURE: BoxNodePainter draws rounded rectangles - FEATURE: Font for boxnodepainter is configurable - FEATURE: labelcolor of edgepainter is configurable - FEATURE: added utility functions for namespace compression/expansion - REFACTOR: moved layouter to graphpane - BUG: removed value property from graphelements - BUG: stopping layouter when displaying contextmenus etc. - BUG: fixed panning after startup - removed obsolete commented-out code Index: ParseUtils.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/util/ParseUtils.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ParseUtils.java 4 Oct 2004 10:21:04 -0000 1.1 --- ParseUtils.java 14 Oct 2004 13:03:04 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- import java.awt.BasicStroke; import java.awt.Color; + import java.awt.Font; import java.awt.Stroke; import java.util.StringTokenizer; *************** *** 71,73 **** --- 72,83 ---- } + /** + * @param property + * @return + */ + public static Font parseFont(String spec) { + if (spec == null) return null; + return Font.decode(spec); + } + } |
|
From: Flo L. <fl...@us...> - 2004-10-14 12:51:37
|
Update of /cvsroot/graphl/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9468 Modified Files: README.txt graphl-local.bat graphl.bat Log Message: added new libraries to classpath Index: graphl-local.bat =================================================================== RCS file: /cvsroot/graphl/graphl/graphl-local.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** graphl-local.bat 21 Jun 2004 20:47:38 -0000 1.1 --- graphl-local.bat 14 Oct 2004 12:51:25 -0000 1.2 *************** *** 1 **** ! java -cp ./bin;./lib/rdfapi.jar org.mediavirus.graphl.GraphlApplication \ No newline at end of file --- 1,2 ---- ! cd C:\data\projects\graphl ! java -cp ./bin;./lib/rdfapi.jar;./lib/l2fprod-common-fontchooser.jar;./lib/l2fprod-common-sheet.jar org.mediavirus.graphl.GraphlApplication %1 %2 %3 %4 %5 \ No newline at end of file Index: graphl.bat =================================================================== RCS file: /cvsroot/graphl/graphl/graphl.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** graphl.bat 21 Jun 2004 20:47:38 -0000 1.2 --- graphl.bat 14 Oct 2004 12:51:25 -0000 1.3 *************** *** 1 **** ! java -cp graphl.jar;./lib/rdfapi.jar org.mediavirus.graphl.GraphlApplication \ No newline at end of file --- 1 ---- ! java -cp graphl.jar;./lib/rdfapi.jar;./lib/l2fprod-common-fontchooser.jar;./lib/l2fprod-common-sheet.jar org.mediavirus.graphl.GraphlApplication %1 %2 %3 %4 %5 \ No newline at end of file Index: README.txt =================================================================== RCS file: /cvsroot/graphl/graphl/README.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README.txt 23 Aug 2004 16:55:30 -0000 1.2 --- README.txt 14 Oct 2004 12:51:25 -0000 1.3 *************** *** 28,32 **** for other improvements, see the changelog. ! i will post a notification to this list when 0.1 is out - i hope this will happen late october. the most notable improvements i am planning for the 0.1 release are: --- 28,32 ---- for other improvements, see the changelog. ! i will post a notification to the list when 0.1 is out - i hope this will happen late october. the most notable improvements i am planning for the 0.1 release are: |
|
From: Flo L. <fl...@us...> - 2004-10-05 07:54:55
|
Update of /cvsroot/graphl/graphl/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13893/config Modified Files: config.rdf Log Message: * added command line option support in GraphlApplication * added "Exit" menu entry (for quitting without window decorations) * fixes for LineEdgePainter and ShapeNodePainter * minor documentation updates * more default config tweaking Index: config.rdf =================================================================== RCS file: /cvsroot/graphl/graphl/config/config.rdf,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** config.rdf 4 Oct 2004 10:46:02 -0000 1.9 --- config.rdf 5 Oct 2004 07:54:20 -0000 1.10 *************** *** 310,316 **** <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.UnconstrainedNodeLayouter"> ! <graphl:assignedToType> <rdfs:Class rdf:about="&rdfs;Class"/> ! </graphl:assignedToType> <graphl:assignedToType> <rdfs:Class rdf:about="&rdf;nil"/> --- 310,316 ---- <graphl:NodeLayouter graphl:javaClass="org.mediavirus.graphl.layout.UnconstrainedNodeLayouter"> ! <!--<graphl:assignedToType> <rdfs:Class rdf:about="&rdfs;Class"/> ! </graphl:assignedToType>--> <graphl:assignedToType> <rdfs:Class rdf:about="&rdf;nil"/> *************** *** 354,364 **** graphl:stroke="1.0 1 5"> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdf;type"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdfs;range"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdfs;isDefinedBy"/> </graphl:assignedToType> </graphl:EdgePainter> --- 354,364 ---- graphl:stroke="1.0 1 5"> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdf;type"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdfs;range"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdfs;isDefinedBy"/> </graphl:assignedToType> </graphl:EdgePainter> *************** *** 372,379 **** graphl:color="#ff0000"> <graphl:assignedToType> ! <rdfs:Class rdf:about="&owl;inverseOf"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdfs:Class rdf:about="&owl;disjointWith"/> </graphl:assignedToType> </graphl:EdgePainter> --- 372,379 ---- graphl:color="#ff0000"> <graphl:assignedToType> ! <rdf:Property rdf:about="&owl;inverseOf"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdf:Property rdf:about="&owl;disjointWith"/> </graphl:assignedToType> </graphl:EdgePainter> *************** *** 386,390 **** graphl:stroke="1.0 5 5"> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdfs;range"/> </graphl:assignedToType> </graphl:EdgePainter> --- 386,390 ---- graphl:stroke="1.0 5 5"> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdfs;range"/> </graphl:assignedToType> </graphl:EdgePainter> *************** *** 397,404 **** graphl:stroke="1.0"> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdf;first"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdfs:Class rdf:about="&graphl;connectedTo"/> </graphl:assignedToType> </graphl:EdgePainter> --- 397,404 ---- graphl:stroke="1.0"> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdf;first"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdf:Property rdf:about="&graphl;connectedTo"/> </graphl:assignedToType> </graphl:EdgePainter> *************** *** 411,415 **** graphl:stroke="1.0"> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdf;rest"/> </graphl:assignedToType> </graphl:EdgePainter> --- 411,415 ---- graphl:stroke="1.0"> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdf;rest"/> </graphl:assignedToType> </graphl:EdgePainter> *************** *** 424,437 **** graphl:javaClass="org.mediavirus.graphl.layout.NeutralEdgeLayouter"> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdf;type"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdfs;range"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdfs;isDefinedBy"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdfs:Class rdf:about="&owl;disjointWith"/> </graphl:assignedToType> </graphl:EdgeLayouter> --- 424,437 ---- graphl:javaClass="org.mediavirus.graphl.layout.NeutralEdgeLayouter"> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdf;type"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdfs;range"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdfs;isDefinedBy"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdf:Property rdf:about="&owl;disjointWith"/> </graphl:assignedToType> </graphl:EdgeLayouter> *************** *** 442,449 **** graphl:direction="up"> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdfs;subClassOf"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdfs;subPropertyOf"/> </graphl:assignedToType> </graphl:EdgeLayouter> --- 442,449 ---- graphl:direction="up"> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdfs;subClassOf"/> </graphl:assignedToType> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdfs;subPropertyOf"/> </graphl:assignedToType> </graphl:EdgeLayouter> *************** *** 454,458 **** graphl:direction="right"> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdf;rest"/> </graphl:assignedToType> </graphl:EdgeLayouter> --- 454,458 ---- graphl:direction="right"> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdf;rest"/> </graphl:assignedToType> </graphl:EdgeLayouter> *************** *** 464,468 **** graphl:length="40.0"> <graphl:assignedToType> ! <rdfs:Class rdf:about="&rdf;first"/> </graphl:assignedToType> </graphl:EdgeLayouter> --- 464,468 ---- graphl:length="40.0"> <graphl:assignedToType> ! <rdf:Property rdf:about="&rdf;first"/> </graphl:assignedToType> </graphl:EdgeLayouter> |
|
From: Flo L. <fl...@us...> - 2004-10-05 07:54:54
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13893/src/org/mediavirus/graphl/layout Modified Files: AbsoluteNodeLayouter.java Log Message: * added command line option support in GraphlApplication * added "Exit" menu entry (for quitting without window decorations) * fixes for LineEdgePainter and ShapeNodePainter * minor documentation updates * more default config tweaking Index: AbsoluteNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/AbsoluteNodeLayouter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbsoluteNodeLayouter.java 4 Oct 2004 10:21:01 -0000 1.4 --- AbsoluteNodeLayouter.java 5 Oct 2004 07:54:19 -0000 1.5 *************** *** 33,43 **** boolean draggable = true; ! /* ! * Overrides @see org.mediavirus.graphl.layout.NodeLayouter#performLayoutStep(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager) */ public void performLayoutStep(Node node, GraphManager manager) { if (method == FIXED) { if (draggable && node.isDragging()) { - // TODO (2) take scale and offset into account setTarget(new Point2D.Double(node.getCenterX()/scale.getX()-offset.getX(), node.getCenterY()/scale.getY()-offset.getY())); } --- 33,42 ---- boolean draggable = true; ! /** ! * @see org.mediavirus.graphl.layout.NodeLayouter#performLayoutStep(org.mediavirus.graphl.graph.Node, org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager) */ public void performLayoutStep(Node node, GraphManager manager) { if (method == FIXED) { if (draggable && node.isDragging()) { setTarget(new Point2D.Double(node.getCenterX()/scale.getX()-offset.getX(), node.getCenterY()/scale.getY()-offset.getY())); } |
|
From: Flo L. <fl...@us...> - 2004-10-05 07:54:53
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13893/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: * added command line option support in GraphlApplication * added "Exit" menu entry (for quitting without window decorations) * fixes for LineEdgePainter and ShapeNodePainter * minor documentation updates * more default config tweaking Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GraphlManipulator.java 4 Oct 2004 10:21:07 -0000 1.3 --- GraphlManipulator.java 5 Oct 2004 07:54:21 -0000 1.4 *************** *** 220,224 **** else if (dragEdge != null) { int delta = (int)(mousePos.getY() - dragStart.getY()); ! // TODO (2) setLength is not in Node interface! -> Edge Manipulators if (oldLength-delta > 2) ((DefaultEdge)dragEdge).setLength(oldLength-delta); --- 220,224 ---- else if (dragEdge != null) { int delta = (int)(mousePos.getY() - dragStart.getY()); ! // TODO (2) setLength is not in Edge interface! -> Edge Manipulators if (oldLength-delta > 2) ((DefaultEdge)dragEdge).setLength(oldLength-delta); |