[graphl-cvs] graphl/src/org/mediavirus/graphl/interaction GraphlManipulator.java
Status: Pre-Alpha
Brought to you by:
flo1
|
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); |