From ddd377cdf4acd7b7356d481e620b09f970440aa8 Mon Sep 17 00:00:00 2001 From: niemisto Date: Wed, 17 Mar 2010 11:37:42 +0000 Subject: [PATCH] bug fixes git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15058 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/objmap/rules/range/FieldAccessor.java | 6 ++++-- .../src/org/simantics/sysdyn/ui/elements/FlowElement.java | 2 ++ .../src/org/simantics/sysdyn/ui/elements/TextElement.java | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java b/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java index 149081e8..53d0d875 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java +++ b/org.simantics.objmap/src/org/simantics/objmap/rules/range/FieldAccessor.java @@ -59,8 +59,10 @@ public class FieldAccessor implements IRangeAccessor { " -> " + value ); - if(currentValue == null ? value == null : currentValue.equals(value)) - return false; + if(value == null + ? (currentValue == null || field.getType().isPrimitive()) + : value.equals(currentValue)) + return false; field.set(element, value); return true; } catch (IllegalArgumentException e) { diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/FlowElement.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/FlowElement.java index 3823c841..9371a6d4 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/FlowElement.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/FlowElement.java @@ -134,6 +134,8 @@ public class FlowElement extends Element implements IElementListener { path.lineTo(maxx + ARROW_LENGTH, y - ARROW_WIDTH); path.lineTo(maxx + ARROW_LENGTH, y + ARROW_WIDTH); } + else + return; // FIXME (HN) This is just a quick bugfix, didn't understand the logic completely path.closePath(); arrowNode.setShape(path); 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 8e1e82a1..c7ed8f51 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,12 +153,14 @@ public class TextElement extends RectangularElement implements Movable, Connecta } else if(event.key.equals("Enter")) { validateNewName(); + update(); editor.removeAction(this); } return true; } else if(_event instanceof ClickEvent) { validateNewName(); + update(); editor.removeAction(this); } return false; @@ -167,7 +169,7 @@ public class TextElement extends RectangularElement implements Movable, Connecta @Override public void textChanged() { label = textNode.getText(); - update(); + //update(); editor.requestRepaint(); } @@ -197,7 +199,7 @@ public class TextElement extends RectangularElement implements Movable, Connecta public boolean handle(IDiagramEditor editor, IEvent _event) { if(_event instanceof KeyboardEvent) { KeyboardEvent event = (KeyboardEvent)_event; - if(event.key.equals("F3")) { + if(event.key.equals("F3") || event.key.equals("F2")) { beginRenameAction(editor); return true; } -- 2.47.1