[graphl-cvs] graphl/src/org/mediavirus/graphl/interaction DefaultNodeManipulator.java GraphlManipula
Status: Pre-Alpha
Brought to you by:
flo1
From: Flo L. <fl...@us...> - 2005-09-05 15:46:48
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14883/src/org/mediavirus/graphl/interaction Modified Files: DefaultNodeManipulator.java GraphlManipulator.java Log Message: added methods to access filtered and unfiltered versions of the graph in GraphlPane Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** GraphlManipulator.java 24 Aug 2005 16:12:41 -0000 1.11 --- GraphlManipulator.java 5 Sep 2005 15:46:38 -0000 1.12 *************** *** 84,88 **** else { graphPane.pauseLayouter(); ! graphMenu.show(e.getX(), e.getY(), graphPane.getGraph()); } } --- 84,88 ---- else { graphPane.pauseLayouter(); ! graphMenu.show(e.getX(), e.getY(), graphPane.getFilteredGraph()); } } *************** *** 128,132 **** if (e.getClickCount() == 2) { //(e.getWhen() - lastClick) < 300) { if ((clickNode == null) && (clickEdge == null)) { ! final Node newNode = graphPane.getGraph().createNode(); clickNode = newNode; clickNode.setCenter(p.getX(), p.getY()); --- 128,132 ---- if (e.getClickCount() == 2) { //(e.getWhen() - lastClick) < 300) { if ((clickNode == null) && (clickEdge == null)) { ! final Node newNode = graphPane.getFilteredGraph().createNode(); clickNode = newNode; clickNode.setCenter(p.getX(), p.getY()); *************** *** 153,157 **** } ); editor.startEditing(); ! graphPane.getGraph().notifyPropertyChanged(); graphPane.repaint(); } --- 153,157 ---- } ); editor.startEditing(); ! graphPane.getFilteredGraph().notifyPropertyChanged(); graphPane.repaint(); } *************** *** 175,179 **** else { clickEdge.invert(); ! graphPane.getGraph().notifyLayoutUpdated(); graphPane.repaint(); } --- 175,179 ---- else { clickEdge.invert(); ! graphPane.getFilteredGraph().notifyLayoutUpdated(); graphPane.repaint(); } *************** *** 184,188 **** if ((e.getModifiers() & MouseEvent.CTRL_MASK) == 0) { graphPane.getSelection().clear(); ! graphPane.getGraph().notifyLayoutUpdated(); } if (clickNode != null) { --- 184,188 ---- if ((e.getModifiers() & MouseEvent.CTRL_MASK) == 0) { graphPane.getSelection().clear(); ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } if (clickNode != null) { *************** *** 194,198 **** System.out.println(clickNode.getType()); } ! graphPane.getGraph().notifyLayoutUpdated(); } else if (clickEdge != null) { --- 194,198 ---- System.out.println(clickNode.getType()); } ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } else if (clickEdge != null) { *************** *** 203,207 **** graphPane.getSelection().addEdge(clickEdge); } ! graphPane.getGraph().notifyLayoutUpdated(); } } --- 203,207 ---- graphPane.getSelection().addEdge(clickEdge); } ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } } *************** *** 227,231 **** else { graphPane.pauseLayouter(); ! graphMenu.show(e.getX(), e.getY(), graphPane.getGraph()); } } --- 227,231 ---- else { graphPane.pauseLayouter(); ! graphMenu.show(e.getX(), e.getY(), graphPane.getFilteredGraph()); } } *************** *** 247,261 **** // we also allow multiple edges between two nodes! RDFEdge edge = new RDFEdge(edgeNode, overNode); ! graphPane.getGraph().addElements(null, Collections.singleton(edge)); } else if ( overNode!=edgeNode ) { ! Node newNode = graphPane.getGraph().createNode(); newNode.setCenter(p.getX(), p.getY()); ! Edge edge = graphPane.getGraph().createEdge(edgeNode, newNode); Point d = new Point(); graphPane.screenToGraphPoint(dragStart,d); // TODO (3) length should be mapped to arbitrary property! ((DefaultEdge)edge).setLength(dragStart.distance(d)); ! ((DefaultGraph)graphPane.getGraph()).addElements(Collections.singleton(newNode), Collections.singleton(edge)); TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, newNode, this); editor.startEditing(); --- 247,263 ---- // we also allow multiple edges between two nodes! RDFEdge edge = new RDFEdge(edgeNode, overNode); ! edge.setSource(NS.graphl + "USER"); ! graphPane.getFilteredGraph().addElements(null, Collections.singleton(edge)); } else if ( overNode!=edgeNode ) { ! Node newNode = graphPane.getFilteredGraph().createNode(); newNode.setCenter(p.getX(), p.getY()); ! Edge edge = graphPane.getFilteredGraph().createEdge(edgeNode, newNode); ! edge.setSource(NS.graphl + "USER"); Point d = new Point(); graphPane.screenToGraphPoint(dragStart,d); // TODO (3) length should be mapped to arbitrary property! ((DefaultEdge)edge).setLength(dragStart.distance(d)); ! ((DefaultGraph)graphPane.getSourceGraph()).addElements(Collections.singleton(newNode), Collections.singleton(edge)); TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, newNode, this); editor.startEditing(); *************** *** 281,285 **** e.consume(); moved = true; ! graphPane.getGraph().notifyLayoutUpdated(); } // else if (dragEdge != null) { --- 283,287 ---- e.consume(); moved = true; ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } // else if (dragEdge != null) { *************** *** 317,321 **** graphPane.screenToGraphPoint(point,graphPoint); dragNode.setCenter(graphPoint.getX(),graphPoint.getY()); ! graphPane.getGraph().notifyLayoutUpdated(); } } --- 319,323 ---- graphPane.screenToGraphPoint(point,graphPoint); dragNode.setCenter(graphPoint.getX(),graphPoint.getY()); ! graphPane.getFilteredGraph().notifyLayoutUpdated(); } } Index: DefaultNodeManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/DefaultNodeManipulator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultNodeManipulator.java 29 Dec 2004 14:31:30 -0000 1.1 --- DefaultNodeManipulator.java 5 Sep 2005 15:46:38 -0000 1.2 *************** *** 62,66 **** if (node != overNode) { overNode = node; ! graphPane.getGraph().notifyUpdated(); } } --- 62,66 ---- if (node != overNode) { overNode = node; ! graphPane.getFilteredGraph().notifyUpdated(); } } *************** *** 74,78 **** (p.getY() < (overNode.getCenterY()+overNode.getHeight()/2)-10)) { overNode = null; ! graphPane.getGraph().notifyUpdated(); } } --- 74,78 ---- (p.getY() < (overNode.getCenterY()+overNode.getHeight()/2)-10)) { overNode = null; ! graphPane.getFilteredGraph().notifyUpdated(); } } |