From cc990c08d6ed667432490fabbd750f689fd51c2b Mon Sep 17 00:00:00 2001 From: niemisto Date: Wed, 17 Mar 2010 11:57:45 +0000 Subject: [PATCH] git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15060 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../simantics/sysdyn/ui/editor/SysdynDiagramEditor.java | 2 ++ .../src/org/simantics/sysdyn/ui/elements/TextElement.java | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java index 42ae0175..90ea71c3 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynDiagramEditor.java @@ -87,6 +87,8 @@ public class SysdynDiagramEditor extends ResourceEditorPart { try { diagram = (IDiagram)mapping.map(g, getInputResource()); + for(IElement element : diagram.getElements()) + element.addListener(elementUpdateListener); } catch (MappingException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/TextElement.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/TextElement.java index c7ed8f51..97aff786 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/TextElement.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/TextElement.java @@ -153,8 +153,9 @@ public class TextElement extends RectangularElement implements Movable, Connecta } else if(event.key.equals("Enter")) { validateNewName(); - update(); + update(); editor.removeAction(this); + editor.requestRepaint(); } return true; } @@ -162,6 +163,7 @@ public class TextElement extends RectangularElement implements Movable, Connecta validateNewName(); update(); editor.removeAction(this); + editor.requestRepaint(); } return false; } @@ -181,8 +183,8 @@ public class TextElement extends RectangularElement implements Movable, Connecta TextElement t = (TextElement) e; if(t != TextElement.this && t.label.equals(textNode.getText())) { label = oldText; - update(); - editor.requestRepaint(); + //update(); + //editor.requestRepaint(); } } } -- 2.47.1