]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15060 ac1ea38d-2e2b... simantics-1.0
authorniemisto <niemisto@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 17 Mar 2010 11:57:45 +0000 (11:57 +0000)
committerniemisto <niemisto@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 17 Mar 2010 11:57:45 +0000 (11:57 +0000)
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/TextElement.java

index 42ae0175c9971cdef916d9cb057b47a804a03ce0..90ea71c3708c638e838465dd261987a36a88d315 100644 (file)
@@ -87,6 +87,8 @@ public class SysdynDiagramEditor extends ResourceEditorPart {
                                \r
                try {\r
                        diagram = (IDiagram)mapping.map(g, getInputResource());\r
+                       for(IElement element : diagram.getElements())\r
+                           element.addListener(elementUpdateListener);\r
                } catch (MappingException e) {\r
                        // TODO Auto-generated catch block\r
                        e.printStackTrace();\r
index c7ed8f51d522c0ee75c780ae89f33d9fde590cc7..97aff786b3cc58c4dba8b71cb8f9743a4026f0e5 100644 (file)
@@ -153,8 +153,9 @@ public class TextElement extends RectangularElement implements Movable, Connecta
                 }\r
                 else if(event.key.equals("Enter")) {\r
                     validateNewName();\r
-                    update();\r
+                    update();                    \r
                     editor.removeAction(this);\r
+                    editor.requestRepaint();\r
                 }\r
                 return true;\r
             }\r
@@ -162,6 +163,7 @@ public class TextElement extends RectangularElement implements Movable, Connecta
                 validateNewName();\r
                 update();\r
                 editor.removeAction(this);\r
+                editor.requestRepaint();\r
             }\r
             return false;\r
         }\r
@@ -181,8 +183,8 @@ public class TextElement extends RectangularElement implements Movable, Connecta
                         TextElement t = (TextElement) e;\r
                         if(t != TextElement.this && t.label.equals(textNode.getText())) {\r
                             label = oldText;\r
-                            update();\r
-                            editor.requestRepaint();     \r
+                            //update();\r
+                            //editor.requestRepaint();     \r
                         }\r
                     }\r
                 }\r