Thread: [graphl-cvs] graphl/src/org/mediavirus/graphl/interaction GraphlManipulator.java
Status: Pre-Alpha
Brought to you by:
flo1
From: Flo L. <fl...@us...> - 2004-08-22 22:31:47
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26842/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: * registering available facets via config.rdf works * zoom factor visible in gui * clicking zoom label resets to 100% * fixed some repainting/relayouting issues Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GraphlManipulator.java 2 Aug 2004 12:36:49 -0000 1.1 --- GraphlManipulator.java 22 Aug 2004 22:31:32 -0000 1.2 *************** *** 98,102 **** else { oldTranslation = ((GraphlPane)graphPane).getTranslation(); - } } --- 98,101 ---- *************** *** 217,220 **** --- 216,220 ---- e.consume(); moved = true; + graphPane.getGraph().notifyLayoutUpdated(); } else if (dragEdge != null) { *************** *** 227,230 **** --- 227,231 ---- graphPane.repaint(); e.consume(); + graphPane.getGraph().notifyLayoutUpdated(); } else if (edgeNode != null) { *************** *** 237,242 **** pane.setTranslation(diff.getX()+oldTranslation.getX(), diff.getY()+oldTranslation.getY()); } - graphPane.getGraph().notifyLayoutUpdated(); - } --- 238,241 ---- |
From: Flo L. <fl...@us...> - 2004-10-04 10:21:22
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18139/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: * added width and height properties to the Node interface, to allow layouters to define a bounding box for nodes. * AbsoluteNodeLayouter will also use bounding box information for maps etc. This is currently only used in imageNodePainter * added DirectedEdgeLayouter for laying out hierarchical and directed graphs like trees. this works nice for rdf schemas et al. * Added ShapeNodePainter to draw labels as java2d shapes (currently predefined: circle, square, cross and X). No label yet. * using JavaBeans/property pages for facet configuration. added a dependency to com.l2fprod package, implementing paroperty sheets - i want to get rid of this again in the future, but i don't have time currently to implement such bullshit that should be in the jdk anyhow * Added a StrokeChooser for defining strokes for node and edgepainters * added a ParseUtils class for parsing colors and strokes from literals * greatly extended default configuration for facets * some documentation updates (javadoc runs without warnings now) Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GraphlManipulator.java 22 Aug 2004 22:31:32 -0000 1.2 --- GraphlManipulator.java 4 Oct 2004 10:21:07 -0000 1.3 *************** *** 25,29 **** /** ! * @author flo * */ --- 25,29 ---- /** ! * @author Flo Ledermann <led...@im...> * */ *************** *** 120,124 **** if ((clickNode == null) && (clickEdge == null)) { clickNode = graphPane.getGraph().createNode(); ! clickNode.setLocation(p.getX(), p.getY()); ((DefaultGraph)graphPane.getGraph()).addElements(Collections.singleton(clickNode), null); graphPane.getGraph().notifyLayoutUpdated(); --- 120,124 ---- if ((clickNode == null) && (clickEdge == null)) { clickNode = graphPane.getGraph().createNode(); ! clickNode.setCenter(p.getX(), p.getY()); ((DefaultGraph)graphPane.getGraph()).addElements(Collections.singleton(clickNode), null); graphPane.getGraph().notifyLayoutUpdated(); *************** *** 189,193 **** } else if ( overNode!=edgeNode ) { Node newNode = graphPane.getGraph().createNode(); ! newNode.setLocation(p.getX(), p.getY()); Edge edge = graphPane.getGraph().createEdge(edgeNode, newNode); Point d = new Point(); --- 189,193 ---- } 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(); *************** *** 251,255 **** Point2D graphPoint=new Point2D.Double(); graphPane.screenToGraphPoint(point,graphPoint); ! dragNode.setLocation(graphPoint.getX(),graphPoint.getY()); graphPane.getGraph().notifyLayoutUpdated(); } --- 251,255 ---- Point2D graphPoint=new Point2D.Double(); graphPane.screenToGraphPoint(point,graphPoint); ! dragNode.setCenter(graphPoint.getX(),graphPoint.getY()); graphPane.getGraph().notifyLayoutUpdated(); } *************** *** 265,269 **** if(mousePos==null) return; ! Point p = new Point((int)edgeNode.getX(), (int)edgeNode.getY()); Point sp = new Point(); graphPane.screenToGraphPoint(mousePos,sp); --- 265,269 ---- if(mousePos==null) return; ! Point p = new Point((int)edgeNode.getCenterX(), (int)edgeNode.getCenterY()); Point sp = new Point(); graphPane.screenToGraphPoint(mousePos,sp); *************** *** 275,288 **** } - /** - * @see de.fzi.wim.guibase.graphview.inplaceedit.NodeEditingController#editingStarted(de.fzi.wim.guibase.graphview.graph.Node) - */ public Object editingStarted(Node node) { return ((RDFNode)node).getValue(); } - /** - * @see de.fzi.wim.guibase.graphview.inplaceedit.NodeEditingController#editingFinished(de.fzi.wim.guibase.graphview.graph.Node, java.lang.Object) - */ public boolean editingFinished(Node node, Object value) { if (!((String)value).equals("")) { --- 275,282 ---- *************** *** 292,304 **** } - /** - * @see de.fzi.wim.guibase.graphview.inplaceedit.NodeEditingController#editingAborted(de.fzi.wim.guibase.graphview.graph.Node) - */ public void editingAborted(Node node) { } - /* - * Overrides @see de.fzi.wim.guibase.graphview.view.Manipulator#setGraphPane(de.fzi.wim.guibase.graphview.view.JGraphPane) - */ public void setGraphPane(GraphlPane graphPane) { --- 286,292 ---- |
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); |
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-21 16:00:58
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4235/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: - BUG updating painter list in GraphlPane menus - BUG scale center in center of viewport - FEATURE SortedNodeLayouter sorts on arbitrary property - FEATURE SortedNodeLayouter configurable in GUI + configfile - FEATURE BoxNodePainter: configurable roundedRect + cornerRadius - BUG added beaninfo for manhattanEdgePainter Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GraphlManipulator.java 14 Oct 2004 13:03:06 -0000 1.5 --- GraphlManipulator.java 21 Oct 2004 16:00:49 -0000 1.6 *************** *** 237,242 **** } 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()); } --- 237,242 ---- } else if (!doDragNode && oldTranslation != null){ ! double dx = (mousePos.getX() - dragStart.getX()) / graphPane.getScaleFactor(); ! double dy = (mousePos.getY() - dragStart.getY()) / graphPane.getScaleFactor(); graphPane.setTranslation(dx + oldTranslation.getX(), dy + oldTranslation.getY()); } |
From: Flo L. <fl...@us...> - 2004-11-30 09:38:43
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26998/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: - FEATURE: added menu to choose/switch configuration at runtime - FEATURE: extension of config.rdf to include two sample configurations - FEATURE: extended built-in vocabularies - FEATURE: RepulsionNodeLayouter has configurable strength - BUG: fixed context menu for macs - BUG: fixed cloning of BoxNodePainter - API: added Edge.invert() - API: added FacetRegistry.updateFacets() - REFACTOR: moved default facet selection to context menu - REFACTOR: removed GraphlPane.getScreenPointForNode() calls (use only graph coords) - MISC: misc. minor bugfixes and restructuring - DOC: added first package.html file Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GraphlManipulator.java 21 Oct 2004 16:00:49 -0000 1.6 --- GraphlManipulator.java 30 Nov 2004 09:38:34 -0000 1.7 *************** *** 26,30 **** /** * @author Flo Ledermann <led...@im...> - * */ public class GraphlManipulator extends AbstractManipulator implements NodeEditingController{ --- 26,29 ---- *************** *** 68,72 **** Edge overEdge = graphPane.getNearestEdge(p); ! if (e.getModifiers() == MouseEvent.BUTTON1_MASK) { dragStart = e.getPoint(); --- 67,81 ---- Edge overEdge = graphPane.getNearestEdge(p); ! if (e.isPopupTrigger()) { ! 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); ! } ! } ! else if (e.getButton() == MouseEvent.BUTTON1) { dragStart = e.getPoint(); *************** *** 84,90 **** dragNode.setDragging(true); lastPosition=e.getPoint(); ! Point nodeScreenPoint=graphPane.getScreenPointForNode(dragNode); ! grabPoint=new Point(p.x-nodeScreenPoint.x,p.y-nodeScreenPoint.y); ! graphCursor=graphPane.getCursor(); graphPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } --- 93,98 ---- dragNode.setDragging(true); lastPosition=e.getPoint(); ! grabPoint = new Point(p.x - (int)dragNode.getCenterX(), p.y - (int)dragNode.getCenterY()); ! graphCursor = graphPane.getCursor(); graphPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } *************** *** 100,113 **** } } - 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); - } - } } --- 108,111 ---- *************** *** 116,122 **** graphPane.screenToGraphPoint(e.getPoint(),p); Node clickNode = graphPane.getNodeAtPoint(p); ! RDFEdge clickEdge = (RDFEdge)graphPane.getNearestEdge(p); ! if ((e.getWhen() - lastClick) < 300) { if ((clickNode == null) && (clickEdge == null)) { clickNode = graphPane.getGraph().createNode(); --- 114,120 ---- graphPane.screenToGraphPoint(e.getPoint(),p); Node clickNode = graphPane.getNodeAtPoint(p); ! Edge clickEdge = graphPane.getNearestEdge(p); ! if ((e.getWhen() - lastClick) < 300) { if ((clickNode == null) && (clickEdge == null)) { clickNode = graphPane.getGraph().createNode(); *************** *** 169,173 **** public void mouseReleased(MouseEvent e) { ! if (dragNode!=null) { moveDraggedNode(e.getPoint()); dragNode.setDragging(false); --- 167,186 ---- public void mouseReleased(MouseEvent e) { ! if (e.isPopupTrigger()) { ! Point p = new Point(); ! graphPane.screenToGraphPoint(e.getPoint(),p); ! Node overNode = graphPane.getNodeAtPoint(p); ! Edge overEdge = graphPane.getNearestEdge(p); ! ! 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); ! } ! } ! else if (dragNode!=null) { moveDraggedNode(e.getPoint()); dragNode.setDragging(false); |
From: Flo L. <fl...@us...> - 2004-12-10 16:13:14
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9448/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: added context menu for graph to switch configurations in the applet or without menubar Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GraphlManipulator.java 30 Nov 2004 09:38:34 -0000 1.7 --- GraphlManipulator.java 10 Dec 2004 16:13:04 -0000 1.8 *************** *** 17,20 **** --- 17,21 ---- import org.mediavirus.graphl.graph.rdf.RDFNode; import org.mediavirus.graphl.gui.EdgeContextMenu; + import org.mediavirus.graphl.gui.GraphContextMenu; import org.mediavirus.graphl.gui.NodeContextMenu; import org.mediavirus.graphl.gui.NodeEditingController; *************** *** 50,53 **** --- 51,55 ---- private NodeContextMenu nodeMenu = null; private EdgeContextMenu edgeMenu = null; + private GraphContextMenu graphMenu = null; int sequence = 0; *************** *** 76,79 **** --- 78,85 ---- edgeMenu.show(e.getX(), e.getY(), overEdge); } + else { + graphPane.pauseLayouter(); + graphMenu.show(e.getX(), e.getY(), graphPane.getGraph()); + } } else if (e.getButton() == MouseEvent.BUTTON1) { *************** *** 181,184 **** --- 187,194 ---- edgeMenu.show(e.getX(), e.getY(), overEdge); } + else { + graphPane.pauseLayouter(); + graphMenu.show(e.getX(), e.getY(), graphPane.getGraph()); + } } else if (dragNode!=null) { *************** *** 313,317 **** nodeMenu = new NodeContextMenu(parent); edgeMenu = new EdgeContextMenu(parent); ! } } --- 323,327 ---- nodeMenu = new NodeContextMenu(parent); edgeMenu = new EdgeContextMenu(parent); ! graphMenu = new GraphContextMenu(parent); } } |
From: Flo L. <fl...@us...> - 2005-08-17 15:53:07
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16461/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.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: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GraphlManipulator.java 29 Dec 2004 14:31:30 -0000 1.9 --- GraphlManipulator.java 17 Aug 2005 15:52:55 -0000 1.10 *************** *** 12,15 **** --- 12,17 ---- import java.util.Collections; + import javax.swing.JPopupMenu; + import org.mediavirus.graphl.GraphlPane; import org.mediavirus.graphl.graph.*; *************** *** 20,26 **** --- 22,31 ---- import org.mediavirus.graphl.gui.NodeContextMenu; import org.mediavirus.graphl.gui.NodeEditingController; + import org.mediavirus.graphl.gui.ResourceListener; import org.mediavirus.graphl.gui.TextFieldInPlaceNodeEditor; + import org.mediavirus.graphl.gui.TypeMenu; import org.mediavirus.graphl.painter.ArrowEdgePainter; import org.mediavirus.graphl.painter.NodePainter; + import org.mediavirus.graphl.vocabulary.NS; /** *************** *** 104,112 **** } } ! else if (overEdge != null) { ! dragEdge = (RDFEdge)overEdge; ! oldLength = dragEdge.getLength(); ! e.consume(); ! } else { oldTranslation = ((GraphlPane)graphPane).getTranslation(); --- 109,117 ---- } } ! // else if (overEdge != null) { ! // dragEdge = (RDFEdge)overEdge; ! // oldLength = dragEdge.getLength(); ! // e.consume(); ! // } else { oldTranslation = ((GraphlPane)graphPane).getTranslation(); *************** *** 120,130 **** Node clickNode = graphPane.getHoverNode(); Edge clickEdge = graphPane.getHoverEdge(); ! ! if ((e.getWhen() - lastClick) < 300) { if ((clickNode == null) && (clickEdge == null)) { ! clickNode = graphPane.getGraph().createNode(); clickNode.setCenter(p.getX(), p.getY()); ! ((DefaultGraph)graphPane.getGraph()).addElements(Collections.singleton(clickNode), null); ! graphPane.getGraph().notifyLayoutUpdated(); } else if (clickNode != null) { --- 125,149 ---- Node clickNode = graphPane.getHoverNode(); Edge clickEdge = graphPane.getHoverEdge(); ! ! 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()); ! TypeMenu nodeTypeMenu = new TypeMenu("New Node", graphPane.getVocabularies()); ! nodeTypeMenu.updateMenu(TypeMenu.CLASSES); ! nodeTypeMenu.addResourceListener(new ResourceListener() { ! public void resourceChanged(String resource) { ! newNode.setType(resource); ! graphPane.getGraph().notifyPropertyChanged(); ! graphPane.repaint(); ! } ! }); ! ! JPopupMenu menu = new JPopupMenu(); ! menu.add(nodeTypeMenu); ! menu.show(graphPane, e.getX(), e.getY()); ! ! //graphPane.getGraph().notifyLayoutUpdated(); } else if (clickNode != null) { *************** *** 243,257 **** graphPane.getGraph().notifyLayoutUpdated(); } ! 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(); --- 262,276 ---- graphPane.getGraph().notifyLayoutUpdated(); } ! // 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(); *************** *** 306,310 **** public boolean editingFinished(Node node, Object value) { if (!((String)value).equals("")) { ! ((RDFNode)node).setProperty("http://www.mediavirus.org/graphl#label",(String)value); } return true; --- 325,329 ---- public boolean editingFinished(Node node, Object value) { if (!((String)value).equals("")) { ! ((RDFNode)node).setProperty(NS.graphl + "label",(String)value); } return true; |
From: Flo L. <fl...@us...> - 2005-08-24 16:12:49
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6988/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: fixed context menu popup upon creation of new node Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GraphlManipulator.java 17 Aug 2005 15:52:55 -0000 1.10 --- GraphlManipulator.java 24 Aug 2005 16:12:41 -0000 1.11 *************** *** 136,139 **** --- 136,156 ---- public void resourceChanged(String resource) { newNode.setType(resource); + TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, newNode, new NodeEditingController() { + + public Object editingStarted(Node node) { + return node.getProperty(NS.foaf + "name"); + } + + public boolean editingFinished(Node node, Object value) { + if (!((String)value).equals("")) { + ((RDFNode)node).setProperty(NS.foaf + "name",(String)value); + } + return true; + } + + public void editingAborted(Node node) { + } + } ); + editor.startEditing(); graphPane.getGraph().notifyPropertyChanged(); graphPane.repaint(); *************** *** 150,153 **** --- 167,171 ---- TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, clickNode, this); editor.startEditing(); + graphPane.repaint(); } else if (clickEdge != null) { *************** *** 158,161 **** --- 176,180 ---- clickEdge.invert(); graphPane.getGraph().notifyLayoutUpdated(); + graphPane.repaint(); } } *************** *** 173,176 **** --- 192,196 ---- else { graphPane.getSelection().addNode(clickNode); + System.out.println(clickNode.getType()); } graphPane.getGraph().notifyLayoutUpdated(); *************** *** 227,231 **** // we also allow multiple edges between two nodes! RDFEdge edge = new RDFEdge(edgeNode, overNode); ! ((DefaultGraph)graphPane.getGraph()).addElements(null, Collections.singleton(edge)); } else if ( overNode!=edgeNode ) { --- 247,251 ---- // we also allow multiple edges between two nodes! RDFEdge edge = new RDFEdge(edgeNode, overNode); ! graphPane.getGraph().addElements(null, Collections.singleton(edge)); } else if ( overNode!=edgeNode ) { *************** *** 235,238 **** --- 255,259 ---- Point d = new Point(); graphPane.screenToGraphPoint(dragStart,d); + // TODO (3) length should be mapped to arbitrary property! ((DefaultEdge)edge).setLength(dragStart.distance(d)); ((DefaultGraph)graphPane.getGraph()).addElements(Collections.singleton(newNode), Collections.singleton(edge)); *************** *** 320,329 **** public Object editingStarted(Node node) { ! return ((RDFNode)node).getLabel(); } public boolean editingFinished(Node node, Object value) { if (!((String)value).equals("")) { ! ((RDFNode)node).setProperty(NS.graphl + "label",(String)value); } return true; --- 341,350 ---- public Object editingStarted(Node node) { ! return node.getProperty(NS.foaf + "name"); } public boolean editingFinished(Node node, Object value) { if (!((String)value).equals("")) { ! ((RDFNode)node).setProperty(NS.foaf + "name",(String)value); } return true; |
From: Flo L. <fl...@us...> - 2005-09-07 12:30:16
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25832/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: - FEATURE: type menu pops up upon edge creation - BUG: fixed assignment of unique ids to new nodes - BUG: fixed in-place editor for nodes - CODE: loading graphs is now synchronized to avoid loading conflicts - CODE: restoring Graphics transform in GraphlPane after rendering Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GraphlManipulator.java 5 Sep 2005 15:46:38 -0000 1.12 --- GraphlManipulator.java 7 Sep 2005 12:29:56 -0000 1.13 *************** *** 136,158 **** public void resourceChanged(String resource) { newNode.setType(resource); ! TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, newNode, new NodeEditingController() { ! ! public Object editingStarted(Node node) { ! return node.getProperty(NS.foaf + "name"); ! } ! ! public boolean editingFinished(Node node, Object value) { ! if (!((String)value).equals("")) { ! ((RDFNode)node).setProperty(NS.foaf + "name",(String)value); ! } ! return true; ! } ! ! public void editingAborted(Node node) { ! } ! } ); editor.startEditing(); - graphPane.getFilteredGraph().notifyPropertyChanged(); - graphPane.repaint(); } }); --- 136,141 ---- public void resourceChanged(String resource) { newNode.setType(resource); ! TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, newNode, GraphlManipulator.this); editor.startEditing(); } }); *************** *** 161,166 **** menu.add(nodeTypeMenu); menu.show(graphPane, e.getX(), e.getY()); - - //graphPane.getGraph().notifyLayoutUpdated(); } else if (clickNode != null) { --- 144,147 ---- *************** *** 171,175 **** else if (clickEdge != null) { if ( clickEdge.getCurrentPainter().isPointInLabel(graphPane, clickEdge, p)){ ! //TODO (2): show in-place editor for edge } else { --- 152,156 ---- else if (clickEdge != null) { if ( clickEdge.getCurrentPainter().isPointInLabel(graphPane, clickEdge, p)){ ! // in-place editor for edge ? } else { *************** *** 246,255 **** if (overNode!=null && overNode!=edgeNode) { // 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); --- 227,249 ---- 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()); ! edgeTypeMenu.updateMenu(TypeMenu.PROPERTIES); ! edgeTypeMenu.addResourceListener(new ResourceListener() { ! public void resourceChanged(String resource) { ! edge.setType(resource); ! graphPane.getFilteredGraph().addElements(null, Collections.singleton(edge)); ! } ! }); ! ! JPopupMenu menu = new JPopupMenu(); ! menu.add(edgeTypeMenu); ! menu.show(graphPane, e.getX(), e.getY()); } else if ( overNode!=edgeNode ) { ! final Node newNode = graphPane.getFilteredGraph().createNode(); newNode.setCenter(p.getX(), p.getY()); Edge edge = graphPane.getFilteredGraph().createEdge(edgeNode, newNode); *************** *** 258,265 **** 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(); } --- 252,271 ---- 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)); ! ! TypeMenu nodeTypeMenu = new TypeMenu("New Node", graphPane.getVocabularies()); ! nodeTypeMenu.updateMenu(TypeMenu.CLASSES); ! nodeTypeMenu.addResourceListener(new ResourceListener() { ! public void resourceChanged(String resource) { ! newNode.setType(resource); ! TextFieldInPlaceNodeEditor editor = new TextFieldInPlaceNodeEditor(graphPane, newNode, GraphlManipulator.this); ! editor.startEditing(); ! } ! }); ! ! JPopupMenu menu = new JPopupMenu(); ! menu.add(nodeTypeMenu); ! menu.show(graphPane, e.getX(), e.getY()); } *************** *** 284,287 **** --- 290,294 ---- moved = true; graphPane.getFilteredGraph().notifyLayoutUpdated(); + //graphPane.repaint(); } // else if (dragEdge != null) { |
From: Flo L. <fl...@us...> - 2005-12-18 13:30:09
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23462/src/org/mediavirus/graphl/interaction Modified Files: GraphlManipulator.java Log Message: fixed small regression bug in node creation Index: GraphlManipulator.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/interaction/GraphlManipulator.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GraphlManipulator.java 18 Dec 2005 11:11:41 -0000 1.14 --- GraphlManipulator.java 18 Dec 2005 13:30:00 -0000 1.15 *************** *** 123,129 **** Edge clickEdge = graphPane.getHoverEdge(); ! 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()); --- 123,130 ---- Edge clickEdge = graphPane.getHoverEdge(); ! if (e.getClickCount() == 2) { if ((clickNode == null) && (clickEdge == null)) { final Node newNode = graphPane.getFilteredGraph().createNode(); + graphPane.getFilteredGraph().addElements(Collections.singleton(newNode), null); clickNode = newNode; clickNode.setCenter(p.getX(), p.getY()); *************** *** 244,248 **** Point d = new Point(); graphPane.screenToGraphPoint(dragStart,d); ! ((DefaultGraph)graphPane.getSourceGraph()).addElements(Collections.singleton(newNode), Collections.singleton(edge)); TypeMenu nodeTypeMenu = new TypeMenu("New Node", graphPane.getVocabularies()); --- 245,249 ---- Point d = new Point(); graphPane.screenToGraphPoint(dragStart,d); ! graphPane.getFilteredGraph().addElements(Collections.singleton(newNode), Collections.singleton(edge)); TypeMenu nodeTypeMenu = new TypeMenu("New Node", graphPane.getVocabularies()); |