[graphl-cvs] graphl/src/org/mediavirus/graphl/gui TextFieldInPlaceNodeEditor.java InPlaceNodeEditor.
Status: Pre-Alpha
Brought to you by:
flo1
From: Flo L. <fl...@us...> - 2005-09-07 12:30:15
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25832/src/org/mediavirus/graphl/gui Modified Files: TextFieldInPlaceNodeEditor.java InPlaceNodeEditor.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: TextFieldInPlaceNodeEditor.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/TextFieldInPlaceNodeEditor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TextFieldInPlaceNodeEditor.java 24 Aug 2005 16:11:15 -0000 1.3 --- TextFieldInPlaceNodeEditor.java 7 Sep 2005 12:29:55 -0000 1.4 *************** *** 8,11 **** --- 8,13 ---- import java.awt.event.KeyEvent; import java.awt.event.KeyListener; + import java.awt.geom.Point2D; + import javax.swing.JComponent; import javax.swing.JTextField; *************** *** 14,18 **** import org.mediavirus.graphl.graph.Node; - /** * Provides in-place editing of nodes using a text component. --- 16,19 ---- *************** *** 75,79 **** if (nodeBounds.width < 150) nodeBounds.width = 100; if (nodeBounds.height < 15) nodeBounds.height = 15; ! m_component.setLocation(nodeBounds.x-4,nodeBounds.y-4); m_component.setSize(nodeBounds.width+8,nodeBounds.height+8); } --- 76,82 ---- if (nodeBounds.width < 150) nodeBounds.width = 100; if (nodeBounds.height < 15) nodeBounds.height = 15; ! Point2D dst = nodeBounds.getLocation(); ! m_graphPane.getTransform().transform(dst,dst); ! m_component.setLocation((int)dst.getX()-4,(int)dst.getY()-4); m_component.setSize(nodeBounds.width+8,nodeBounds.height+8); } *************** *** 107,110 **** --- 110,114 ---- */ public void keyTyped(KeyEvent e) { + //System.out.println("position: " + m_component.getX() + " : " + m_component.getY()); } /** *************** *** 114,117 **** --- 118,122 ---- */ public void keyPressed(KeyEvent e) { + //m_component.repaint(); if (e.getKeyCode()==KeyEvent.VK_ESCAPE) abortEditing(); Index: InPlaceNodeEditor.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/InPlaceNodeEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** InPlaceNodeEditor.java 5 Sep 2005 15:47:18 -0000 1.4 --- InPlaceNodeEditor.java 7 Sep 2005 12:29:55 -0000 1.5 *************** *** 156,164 **** m_initialValue=m_nodeEditingController.editingStarted(m_node); setEditorComponentValue(m_component,m_initialValue); - updatePosition(); m_graphPane.add(m_component); editingStarting(m_component); m_graphPane.getFilteredGraph().addGraphListener(this); m_editingInProgress=true; } } --- 156,164 ---- m_initialValue=m_nodeEditingController.editingStarted(m_node); setEditorComponentValue(m_component,m_initialValue); m_graphPane.add(m_component); editingStarting(m_component); m_graphPane.getFilteredGraph().addGraphListener(this); m_editingInProgress=true; + updatePosition(); } } |