[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-12-18 11:11:53
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2618/src/org/mediavirus/graphl/interaction Modified Files: DefaultNodeManipulator.java GraphlManipulator.java Log Message: - FEATURE: RXPath landed! you can assign properties of facets through XPath-like expressions based on the currently rendered node - CODE: Remove LabelGenerator classes - this can now done with RXPath - CODE: migrated to JDK 1.5, added class specifiers for all collections (generics) - CODE: added a singleton GraphlRegistry, currently only holding the vocabularyRegistry instance Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GraphlManipulator.java 7 Sep 2005 12:29:56 -0000 1.13 --- GraphlManipulator.java 18 Dec 2005 11:11:41 -0000 1.14 *************** *** 16,20 **** import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.*; - import org.mediavirus.graphl.graph.rdf.RDFEdge; import org.mediavirus.graphl.graph.rdf.RDFNode; import org.mediavirus.graphl.gui.EdgeContextMenu; --- 16,19 ---- *************** *** 43,54 **** protected Cursor graphCursor; - private long lastClick; private Point mousePos; private Node edgeNode = null; ! private Edge dragEdge = null; private Node dragNode = null; - private double oldLength = 2; Point dragStart = null; --- 42,51 ---- protected Cursor graphCursor; private Point mousePos; private Node edgeNode = null; ! //private Edge dragEdge = null; private Node dragNode = null; Point dragStart = null; *************** *** 187,192 **** } } - - lastClick = e.getWhen(); } --- 184,187 ---- *************** *** 227,233 **** if (overNode!=null && overNode!=edgeNode) { // we also allow multiple edges between two nodes! ! // TODO (2) Edge, Node constructors should be package protected and accessed only via facotry methods in Graph ! final RDFEdge edge = new RDFEdge(edgeNode, overNode); ! edge.setSource(NS.graphl + "USER"); TypeMenu edgeTypeMenu = new TypeMenu("New Edge", graphPane.getVocabularies()); --- 222,226 ---- if (overNode!=null && overNode!=edgeNode) { // we also allow multiple edges between two nodes! ! final Edge edge = graphPane.getFilteredGraph().createEdge(edgeNode, overNode); TypeMenu edgeTypeMenu = new TypeMenu("New Edge", graphPane.getVocabularies()); *************** *** 251,256 **** 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)); --- 244,247 ---- *************** *** 272,276 **** } ! dragEdge = null; dragNode = null; edgeNode = null; --- 263,267 ---- } ! //dragEdge = null; dragNode = null; edgeNode = null; *************** *** 292,306 **** //graphPane.repaint(); } - // 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); - // else - // ((DefaultEdge)dragEdge).setLength(2); - // graphPane.repaint(); - // e.consume(); - // graphPane.getGraph().notifyLayoutUpdated(); - // } else if (edgeNode != null) { graphPane.repaint(); --- 283,286 ---- Index: DefaultNodeManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/DefaultNodeManipulator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DefaultNodeManipulator.java 5 Sep 2005 15:46:38 -0000 1.2 --- DefaultNodeManipulator.java 18 Dec 2005 11:11:41 -0000 1.3 *************** *** 23,27 **** public class DefaultNodeManipulator extends AbstractManipulator implements NodeManipulator { ! private List assignedElements = new ArrayList(); private Node overNode = null; --- 23,27 ---- public class DefaultNodeManipulator extends AbstractManipulator implements NodeManipulator { ! private List<GraphElement> assignedElements = new ArrayList<GraphElement>(); private Node overNode = null; *************** *** 113,117 **** // need to return copy, becuase elements might be unassigned by caller // this triggers a ConcurrentModificationException if original set is returned ! return new ArrayList(assignedElements); } --- 113,117 ---- // need to return copy, becuase elements might be unassigned by caller // this triggers a ConcurrentModificationException if original set is returned ! return new ArrayList<GraphElement>(assignedElements); } |