[graphl-cvs] graphl/src/org/mediavirus/graphl/layout RepulsionNodeLayouter.java SortedNodeLayouter.j
Status: Pre-Alpha
Brought to you by:
flo1
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16461/src/org/mediavirus/graphl/layout Modified Files: RepulsionNodeLayouter.java SortedNodeLayouter.java AbsoluteNodeLayouter.java SpringEdgeLayouter.java GraphlLayoutStrategy.java DirectedEdgeLayouter.java Log Message: - FEATURE: added navigator thread for update-exhibition, disabled in normal operation - FEATURE: started implementation of filtering architecture - FEATURE: creating new node opens type context menu - CODE: added NS calss for easier namespace referencing in code Index: DirectedEdgeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/DirectedEdgeLayouter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DirectedEdgeLayouter.java 4 Oct 2004 10:21:01 -0000 1.1 --- DirectedEdgeLayouter.java 17 Aug 2005 15:52:49 -0000 1.2 *************** *** 9,12 **** --- 9,13 ---- import org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager; import org.mediavirus.graphl.view.AbstractFacet; + import org.mediavirus.graphl.vocabulary.NS; /** *************** *** 115,123 **** public void setConfigurationNode(Node node) { ! String str = node.getProperty("http://www.mediavirus.org/graphl#length"); if (str != null) { setLength(Float.parseFloat(str)); } ! str = node.getProperty("http://www.mediavirus.org/graphl#direction"); if ( str != null) { if (str.equalsIgnoreCase("up")) { --- 116,124 ---- public void setConfigurationNode(Node node) { ! String str = node.getProperty(NS.graphl + "length"); if (str != null) { setLength(Float.parseFloat(str)); } ! str = node.getProperty(NS.graphl + "direction"); if ( str != null) { if (str.equalsIgnoreCase("up")) { Index: SortedNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/SortedNodeLayouter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SortedNodeLayouter.java 27 Oct 2004 10:55:40 -0000 1.7 --- SortedNodeLayouter.java 17 Aug 2005 15:52:49 -0000 1.8 *************** *** 19,22 **** --- 19,23 ---- import org.mediavirus.graphl.layout.GraphlLayoutStrategy.NodeMovement; import org.mediavirus.graphl.view.AbstractFacet; + import org.mediavirus.graphl.vocabulary.NS; /** *************** *** 306,326 **** */ public void setConfigurationNode(Node node) { ! String str = node.getProperty("http://www.mediavirus.org/graphl#distance"); if (str != null) { setDistance(Float.parseFloat(str)); } ! str = node.getProperty("http://www.mediavirus.org/graphl#property"); if ( str != null) { setProperty(str); } ! str = node.getProperty("http://www.mediavirus.org/graphl#align"); if (str != null) { setAlign(str.equalsIgnoreCase("true")); } ! str = node.getProperty("http://www.mediavirus.org/graphl#proportional"); if (str != null) { setProportional(str.equalsIgnoreCase("true")); } ! str = node.getProperty("http://www.mediavirus.org/graphl#orientation"); if (str != null) { if (str.equalsIgnoreCase("DOWN")) { --- 307,327 ---- */ public void setConfigurationNode(Node node) { ! String str = node.getProperty(NS.graphl + "distance"); if (str != null) { setDistance(Float.parseFloat(str)); } ! str = node.getProperty(NS.graphl + "property"); if ( str != null) { setProperty(str); } ! str = node.getProperty(NS.graphl + "align"); if (str != null) { setAlign(str.equalsIgnoreCase("true")); } ! str = node.getProperty(NS.graphl + "proportional"); if (str != null) { setProportional(str.equalsIgnoreCase("true")); } ! str = node.getProperty(NS.graphl + "orientation"); if (str != null) { if (str.equalsIgnoreCase("DOWN")) { Index: RepulsionNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/RepulsionNodeLayouter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RepulsionNodeLayouter.java 30 Nov 2004 09:38:32 -0000 1.7 --- RepulsionNodeLayouter.java 17 Aug 2005 15:52:49 -0000 1.8 *************** *** 11,14 **** --- 11,15 ---- import org.mediavirus.graphl.layout.GraphlLayoutStrategy.NodeMovement; import org.mediavirus.graphl.view.AbstractFacet; + import org.mediavirus.graphl.vocabulary.NS; /** *************** *** 18,22 **** public class RepulsionNodeLayouter extends AbstractFacet implements NodeLayouter { ! float strength = 1.0f; /* --- 19,23 ---- public class RepulsionNodeLayouter extends AbstractFacet implements NodeLayouter { ! float strength = 0.3f; /* *************** *** 144,148 **** */ public void setConfigurationNode(Node node) { ! String str = node.getProperty("http://www.mediavirus.org/graphl#strength"); if (str != null) { setStrength(Float.parseFloat(str)); --- 145,149 ---- */ public void setConfigurationNode(Node node) { ! String str = node.getProperty(NS.graphl + "strength"); if (str != null) { setStrength(Float.parseFloat(str)); Index: AbsoluteNodeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/AbsoluteNodeLayouter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AbsoluteNodeLayouter.java 30 Nov 2004 09:38:32 -0000 1.8 --- AbsoluteNodeLayouter.java 17 Aug 2005 15:52:49 -0000 1.9 *************** *** 13,16 **** --- 13,17 ---- import org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager; import org.mediavirus.graphl.view.AbstractFacet; + import org.mediavirus.graphl.vocabulary.NS; import org.mediavirus.util.ParseUtils; *************** *** 276,280 **** public void setConfigurationNode(Node node) { ! String str = node.getProperty("http://www.mediavirus.org/graphl#method"); if ( str != null) { if (str.equalsIgnoreCase("property")) { --- 277,281 ---- public void setConfigurationNode(Node node) { ! String str = node.getProperty(NS.graphl + "method"); if ( str != null) { if (str.equalsIgnoreCase("property")) { *************** *** 289,296 **** } ! str = node.getProperty("http://www.mediavirus.org/graphl#property"); if (str != null) setProperty(str); ! str = node.getProperty("http://www.mediavirus.org/graphl#draggable"); if (str != null) setDraggable(Boolean.valueOf(str).booleanValue()); --- 290,297 ---- } ! str = node.getProperty(NS.graphl + "property"); if (str != null) setProperty(str); ! str = node.getProperty(NS.graphl + "draggable"); if (str != null) setDraggable(Boolean.valueOf(str).booleanValue()); Index: GraphlLayoutStrategy.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/GraphlLayoutStrategy.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GraphlLayoutStrategy.java 30 Nov 2004 09:38:32 -0000 1.10 --- GraphlLayoutStrategy.java 17 Aug 2005 15:52:49 -0000 1.11 *************** *** 115,119 **** EdgeLayouter edgeLayouter = edge.getCurrentLayouter(); ! edgeLayouter.performLayoutStep(edge, graphManager); } --- 115,120 ---- EdgeLayouter edgeLayouter = edge.getCurrentLayouter(); ! // TODO (1) should never be null! ! if (edgeLayouter != null) edgeLayouter.performLayoutStep(edge, graphManager); } *************** *** 130,134 **** Node node=(Node)iterator.next(); NodeLayouter nodeLayouter = node.getCurrentLayouter(); ! nodeLayouter.performLayoutStep(node, graphManager); } if (graphManager.maxMotion>0) --- 131,137 ---- Node node=(Node)iterator.next(); NodeLayouter nodeLayouter = node.getCurrentLayouter(); ! ! // TODO (1) should never be null! ! if (nodeLayouter != null) nodeLayouter.performLayoutStep(node, graphManager); } if (graphManager.maxMotion>0) *************** *** 324,329 **** NodeMovement nodeMovement1=getNodeMovement(edge.getFrom()); NodeMovement nodeMovement2=getNodeMovement(edge.getTo()); ! if (nodeMovement1.getSubGraph()!=nodeMovement2.getSubGraph()) ! mergeSubGraphs(nodeMovement1.getSubGraph(),nodeMovement2.getSubGraph()); } public void graphContentsChanged() { --- 327,332 ---- NodeMovement nodeMovement1=getNodeMovement(edge.getFrom()); NodeMovement nodeMovement2=getNodeMovement(edge.getTo()); ! if (nodeMovement1.getSubGraph()!=nodeMovement2.getSubGraph()) ! mergeSubGraphs(nodeMovement1.getSubGraph(),nodeMovement2.getSubGraph()); } public void graphContentsChanged() { Index: SpringEdgeLayouter.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/SpringEdgeLayouter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SpringEdgeLayouter.java 21 Oct 2004 16:00:48 -0000 1.8 --- SpringEdgeLayouter.java 17 Aug 2005 15:52:49 -0000 1.9 *************** *** 9,12 **** --- 9,13 ---- import org.mediavirus.graphl.layout.GraphlLayoutStrategy.GraphManager; import org.mediavirus.graphl.view.AbstractFacet; + import org.mediavirus.graphl.vocabulary.NS; *************** *** 59,62 **** --- 60,64 ---- // 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. + manager.getNodeMovement(from).applyDelta(dx,dy); manager.getNodeMovement(to).applyDelta(-dx,-dy); *************** *** 107,123 **** 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)); --- 109,125 ---- public void setConfigurationNode(Node node) { ! String str = node.getProperty(NS.graphl + "lengthFactor"); if (str != null) { setLengthFactor(Float.parseFloat(str)); } ! str = node.getProperty(NS.graphl + "lengthProperty"); if ( str != null) { setLengthProperty(str); } ! str = node.getProperty(NS.graphl + "defaultLength"); if (str != null) { setDefaultLength(Float.parseFloat(str)); } ! str = node.getProperty(NS.graphl + "rigidity"); if (str != null) { setRigidity(Float.parseFloat(str)); |