From: niemisto Date: Tue, 1 Dec 2009 15:45:46 +0000 (+0000) Subject: git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@13204 ac1ea38d-2e2b... X-Git-Tag: simantics-1.0~116 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=883798087fcde46ebdc59bc69e89787da86dc901;p=simantics%2Fsysdyn.git git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@13204 ac1ea38d-2e2b-0410-8846-a27921b304fc --- 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 59725bd2..e820dad2 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 @@ -44,6 +44,14 @@ public class TextElement extends RectangularElement implements Movable, Connecta public TextElement() { } + public double getTextDeltaX() { + return 0.0; + } + + public double getTextDeltaY() { + return 0.0; + } + public TextElement(String label, double x, double y) { this.label = label; this.posX = x; @@ -71,11 +79,11 @@ public class TextElement extends RectangularElement implements Movable, Connecta textBounds.getHeight()*FONT_SCALE ); - textX = posX-textBounds.getCenterX(); - textY = posY-textBounds.getCenterY(); + textX = posX+getTextDeltaX()-textBounds.getCenterX(); + textY = posY+getTextDeltaY()-textBounds.getCenterY(); bounds.setFrame( - posX-textBounds.getWidth()*0.5-XPADDING, - posY-textBounds.getHeight()*0.5-YPADDING, + posX+getTextDeltaX()-textBounds.getWidth()*0.5-XPADDING, + posY+getTextDeltaY()-textBounds.getHeight()*0.5-YPADDING, textBounds.getWidth()+XPADDING*2, textBounds.getHeight()+YPADDING*2 ); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ValveElement.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ValveElement.java index e93751c0..ad3a4cd2 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ValveElement.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ValveElement.java @@ -25,6 +25,11 @@ public class ValveElement extends TextElement implements Rotatable { this.posX = x; this.posY = y; } + + @Override + public double getTextDeltaY() { + return 8.0; + } @Override public void init(G2DParentNode parent) {