From 5f7049c72b17fdf235c9dfa6182b7be74db9dcbb Mon Sep 17 00:00:00 2001 From: Moemoea Fierin <moemoea.fierin@epita.fr> Date: Wed, 9 Oct 2019 14:34:22 +0200 Subject: [PATCH] [ZOOM] Issue #31 text disappearance on every TML file - in all files with a drawString function, this function was modified and changed to my own created function which will make the text disappear if its too small - some missing override were added too --- src/main/java/ui/tmlad/TMLADActionState.java | 2 +- src/main/java/ui/tmlad/TMLADDecrypt.java | 2 +- src/main/java/ui/tmlad/TMLADEncrypt.java | 6 +++--- src/main/java/ui/tmlad/TMLADForEverLoop.java | 2 +- src/main/java/ui/tmlad/TMLADForLoop.java | 6 +++--- src/main/java/ui/tmlad/TMLADForStaticLoop.java | 6 +++--- src/main/java/ui/tmlad/TMLADNotifiedEvent.java | 4 ++-- src/main/java/ui/tmlad/TMLADRandom.java | 2 +- src/main/java/ui/tmlad/TMLADReadChannel.java | 12 ++++++------ src/main/java/ui/tmlad/TMLADReadRequestArg.java | 2 +- src/main/java/ui/tmlad/TMLADSelectEvt.java | 2 +- src/main/java/ui/tmlad/TMLADSendEvent.java | 4 ++-- src/main/java/ui/tmlad/TMLADSendRequest.java | 4 ++-- src/main/java/ui/tmlad/TMLADWaitEvent.java | 4 ++-- src/main/java/ui/tmlad/TMLADWriteChannel.java | 12 ++++++------ src/main/java/ui/tmlcd/TMLAttributeBox.java | 4 ++-- src/main/java/ui/tmlcd/TMLChannelOperator.java | 2 +- src/main/java/ui/tmlcd/TMLChannelProperties.java | 2 +- src/main/java/ui/tmlcd/TMLEventOperator.java | 2 +- src/main/java/ui/tmlcd/TMLEventProperties.java | 2 +- src/main/java/ui/tmlcd/TMLOperationBox.java | 2 +- src/main/java/ui/tmlcd/TMLRequestOperator.java | 2 +- src/main/java/ui/tmlcd/TMLRequestProperties.java | 2 +- src/main/java/ui/tmlcd/TMLTaskOperator.java | 4 ++-- src/main/java/ui/tmlcp/TMLCPPanel.java | 3 ++- src/main/java/ui/tmldd/TMLArchiArtifact.java | 2 +- src/main/java/ui/tmldd/TMLArchiBUSNode.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiBridgeNode.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiCPNode.java | 5 +++-- src/main/java/ui/tmldd/TMLArchiCPUNode.java | 4 ++-- .../java/ui/tmldd/TMLArchiConnectingPoint.java | 2 +- src/main/java/ui/tmldd/TMLArchiConnectorNode.java | 14 +++++++++++--- src/main/java/ui/tmldd/TMLArchiCrossbarNode.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiDMANode.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiEventArtifact.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiFPGANode.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiFirewallNode.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiHWANode.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiKey.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiMemoryNode.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiPortArtifact.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiRouterNode.java | 4 ++-- src/main/java/ui/tmldd/TMLArchiVGMNNode.java | 4 ++-- src/main/java/ui/tmlsd/TGConnectingPointTMLSD.java | 2 +- .../ui/tmlsd/TGConnectorMessageAsyncTMLSD.java | 2 +- src/main/java/ui/tmlsd/TMLSDActionState.java | 2 +- src/main/java/ui/tmlsd/TMLSDInstance.java | 2 +- 47 files changed, 96 insertions(+), 86 deletions(-) diff --git a/src/main/java/ui/tmlad/TMLADActionState.java b/src/main/java/ui/tmlad/TMLADActionState.java index 596730f17b..ec856478e2 100755 --- a/src/main/java/ui/tmlad/TMLADActionState.java +++ b/src/main/java/ui/tmlad/TMLADActionState.java @@ -132,7 +132,7 @@ public class TMLADActionState extends TADActionState/* Issue #69 TGCOneLineText g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); - g.drawString(value, x + (width - w) / 2 , y + textY); + drawSingleString(g,value, x + (width - w) / 2 , y + textY); } // public TGComponent isOnMe(int _x, int _y) { diff --git a/src/main/java/ui/tmlad/TMLADDecrypt.java b/src/main/java/ui/tmlad/TMLADDecrypt.java index 6a46df82e6..fef8c18a8b 100755 --- a/src/main/java/ui/tmlad/TMLADDecrypt.java +++ b/src/main/java/ui/tmlad/TMLADDecrypt.java @@ -145,7 +145,7 @@ public class TMLADDecrypt extends TADComponentWithoutSubcomponents/* Issue #69 T g.drawImage( scale( IconManager.imgic7000.getImage() ), x - scale( 22 ), y + height / 2, null ); - g.drawString("sec:" + securityContext, x + 3 * width / 2, y + height / 2); + drawSingleString(g,"sec:" + securityContext, x + 3 * width / 2, y + height / 2); } @Override diff --git a/src/main/java/ui/tmlad/TMLADEncrypt.java b/src/main/java/ui/tmlad/TMLADEncrypt.java index 42233caf97..d48589f61c 100755 --- a/src/main/java/ui/tmlad/TMLADEncrypt.java +++ b/src/main/java/ui/tmlad/TMLADEncrypt.java @@ -190,18 +190,18 @@ public class TMLADEncrypt extends TADComponentWithoutSubcomponents/* Issue #69 T } //Draw security pattern - g.drawString("sec:" + securityContext, x + 3 * width / 2, y + height / 2); + drawSingleString(g,"sec:" + securityContext, x + 3 * width / 2, y + height / 2); final int scaledSecIconHeight = scale( SEC_ICON_HIGHT ); //Draw nonce if it exists if (!nonce.isEmpty()) { - g.drawString("nonce:" + nonce, x + 3 * width / 2, y + height / 2 + scaledSecIconHeight ); + drawSingleString(g,"nonce:" + nonce, x + 3 * width / 2, y + height / 2 + scaledSecIconHeight ); } //Draw key if it exists if (!key.isEmpty()) { - g.drawString("key:" + key, x + 3 * width / 2, y + height / 2 + 2 * scaledSecIconHeight ); + drawSingleString(g,"key:" + key, x + 3 * width / 2, y + height / 2 + 2 * scaledSecIconHeight ); } g.drawImage( scale( IconManager.imgic7000.getImage() ), x - scale( 22 ), y + height / 2, null ); diff --git a/src/main/java/ui/tmlad/TMLADForEverLoop.java b/src/main/java/ui/tmlad/TMLADForEverLoop.java index feaf4dfaf1..5dfc173cab 100755 --- a/src/main/java/ui/tmlad/TMLADForEverLoop.java +++ b/src/main/java/ui/tmlad/TMLADForEverLoop.java @@ -130,7 +130,7 @@ public class TMLADForEverLoop extends TADForLoop /* Issue #69 TGCWithoutInternal //g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); //g.drawLine(x+width, y+height/2, x+width +lineLength, y+height/2); - g.drawString(value, x + (width - w) / 2 , y + textY); + drawSingleString(g,value, x + (width - w) / 2 , y + textY); } /*public boolean editOndoubleClick(JFrame frame) { diff --git a/src/main/java/ui/tmlad/TMLADForLoop.java b/src/main/java/ui/tmlad/TMLADForLoop.java index f203e4ac6c..c489092b8f 100755 --- a/src/main/java/ui/tmlad/TMLADForLoop.java +++ b/src/main/java/ui/tmlad/TMLADForLoop.java @@ -151,14 +151,14 @@ public class TMLADForLoop extends TADForLoop /* Issue #69 TGCWithoutInternalComp g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); //g.drawLine(x+width, y+height/2, x+width +lineLength, y+height/2); - g.drawString(value, x + (width - w) / 2 , y + textY); + drawSingleString(g,value, x + (width - w) / 2 , y + textY); // Info on loops - g.drawString(IN_LOOP, x+width+2, y+height/2); + drawSingleString(g,IN_LOOP, x+width+2, y+height/2); //int wTmp = g.getFontMetrics().stringWidth(EXIT_LOOP); // Issue #31 - g.drawString(EXIT_LOOP, (int) (x+width/2+ 2 * oldScaleFactor), (int) (y+height+ scale( 10 ) ) ); + drawSingleString(g,EXIT_LOOP, (int) (x+width/2+ 2 * oldScaleFactor), (int) (y+height+ scale( 10 ) ) ); } @Override diff --git a/src/main/java/ui/tmlad/TMLADForStaticLoop.java b/src/main/java/ui/tmlad/TMLADForStaticLoop.java index 049a75720b..c80b41d83d 100755 --- a/src/main/java/ui/tmlad/TMLADForStaticLoop.java +++ b/src/main/java/ui/tmlad/TMLADForStaticLoop.java @@ -137,11 +137,11 @@ public class TMLADForStaticLoop extends TADForLoop /* Issue #69 TGCWithoutIntern g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); //g.drawLine(x+width, y+height/2, x+width +lineLength, y+height/2); - g.drawString(valueLoop, x + (width - w) / 2 , y + textY); + drawSingleString(g,valueLoop, x + (width - w) / 2 , y + textY); //info on loops - g.drawString(IN_LOOP, x+width+2, y+height/2); - g.drawString(EXIT_LOOP, x+width/2+2, y+height+ scale( 10 ) ); + drawSingleString(g,IN_LOOP, x+width+2, y+height/2); + drawSingleString(g,EXIT_LOOP, x+width/2+2, y+height+ scale( 10 ) ); } @Override diff --git a/src/main/java/ui/tmlad/TMLADNotifiedEvent.java b/src/main/java/ui/tmlad/TMLADNotifiedEvent.java index b99efbc302..0250d106b9 100755 --- a/src/main/java/ui/tmlad/TMLADNotifiedEvent.java +++ b/src/main/java/ui/tmlad/TMLADNotifiedEvent.java @@ -148,8 +148,8 @@ public class TMLADNotifiedEvent extends TADComponentWithoutSubcomponents/* Issue g.drawLine(x, y, x+linebreak, y+height/2); g.drawLine(x, y+height, x+linebreak, y+height/2); - g.drawString("evt", x+(width-w) / 2, y); - g.drawString(value, x + linebreak + scale( 2 ), y + textY); + drawSingleString(g,"evt", x+(width-w) / 2, y); + drawSingleString(g,value, x + linebreak + scale( 2 ), y + textY); } @Override diff --git a/src/main/java/ui/tmlad/TMLADRandom.java b/src/main/java/ui/tmlad/TMLADRandom.java index 2fdee4c3ad..f022cabfd1 100755 --- a/src/main/java/ui/tmlad/TMLADRandom.java +++ b/src/main/java/ui/tmlad/TMLADRandom.java @@ -135,7 +135,7 @@ public class TMLADRandom extends TADComponentWithoutSubcomponents/* Issue #69 TG g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); //g.drawLine(x+width, y+height/2, x+width +lineLength, y+height/2); - g.drawString(valueRandom, x + (width - w) / 2 , y + textY); + drawSingleString(g,valueRandom, x + (width - w) / 2 , y + textY); } @Override diff --git a/src/main/java/ui/tmlad/TMLADReadChannel.java b/src/main/java/ui/tmlad/TMLADReadChannel.java index 589d8effb2..7ecda12ce8 100755 --- a/src/main/java/ui/tmlad/TMLADReadChannel.java +++ b/src/main/java/ui/tmlad/TMLADReadChannel.java @@ -197,18 +197,18 @@ public class TMLADReadChannel extends TADComponentWithoutSubcomponents/* Issue # g.drawLine(x, y, x + linebreak, y + height / 2); g.drawLine(x, y + height, x + linebreak, y + height / 2); if (isAttacker) { - g.drawString("attack", x + (width - w) / 2, y + textY); // Issue #31 + drawSingleString(g,"attack", x + (width - w) / 2, y + textY); // Issue #31 } else { - g.drawString("chl", x + (width - w) / 2, y + textY); // Issue #31 + drawSingleString(g,"chl", x + (width - w) / 2, y + textY); // Issue #31 } - g.drawString(value, x + linebreak + scale( textX0 ), y + scale( textY1 ) ); // Issue #31 + drawSingleString(g,value, x + linebreak + scale( textX0 ), y + scale( textY1 ) ); // Issue #31 if (!securityContext.equals("")) { c = g.getColor(); if (!isEncForm){ g.setColor(Color.RED); } - g.drawString("sec:" + securityContext, x + 3 * width / 4, y + height + textY1 - decSec); + drawSingleString(g,"sec:" + securityContext, x + 3 * width / 4, y + height + textY1 - decSec); g.setColor(c); } drawReachabilityInformation(g); @@ -232,10 +232,10 @@ public class TMLADReadChannel extends TADComponentWithoutSubcomponents/* Issue # latencyY = scale( latencyY ); textHeight = scale( textHeight ); - g.drawString(s, x - latencyX - w + 1, y - latencyY * index - 2); + drawSingleString(g,s, x - latencyX - w + 1, y - latencyY * index - 2); g.drawRect(x - latencyX - w, y - latencyY * index - textHeight, w + 4, textHeight); g.drawLine(x, y, x - latencyX, y - latencyY * index); - g.drawString(latencyVals.get(s), x - latencyX / 2, y - latencyY * index / 2); + drawSingleString(g,latencyVals.get(s), x - latencyX / 2, y - latencyY * index / 2); index++; } } diff --git a/src/main/java/ui/tmlad/TMLADReadRequestArg.java b/src/main/java/ui/tmlad/TMLADReadRequestArg.java index ca0e236ad0..0559dce755 100755 --- a/src/main/java/ui/tmlad/TMLADReadRequestArg.java +++ b/src/main/java/ui/tmlad/TMLADReadRequestArg.java @@ -190,7 +190,7 @@ public class TMLADReadRequestArg extends TADComponentWithoutSubcomponents/* Issu g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); //g.drawLine(x+width, y+height/2, x+width +lineLength, y+height/2); - g.drawString(value, x + (width - w) / 2 , y + textY); + drawSingleString(g,value, x + (width - w) / 2 , y + textY); } @Override diff --git a/src/main/java/ui/tmlad/TMLADSelectEvt.java b/src/main/java/ui/tmlad/TMLADSelectEvt.java index 08a040caac..8f0ae61bdc 100755 --- a/src/main/java/ui/tmlad/TMLADSelectEvt.java +++ b/src/main/java/ui/tmlad/TMLADSelectEvt.java @@ -130,7 +130,7 @@ public class TMLADSelectEvt extends TADComponentWithoutSubcomponents/* Issue #69 g.drawLine(x + width, y + height/2, x+ width + scaledLineOutLength, y + height/2); // Issue #31 g.drawLine(x+(width/2), y + height, x+(width/2), y + height + scaledLineOutLength); // Issue #31 - g.drawString("evt", x + scale( 5 ), y + height/2 + scale( 3 ) ); // Issue #31 + drawSingleString(g,"evt", x + scale( 5 ), y + height/2 + scale( 3 ) ); // Issue #31 } @Override diff --git a/src/main/java/ui/tmlad/TMLADSendEvent.java b/src/main/java/ui/tmlad/TMLADSendEvent.java index c0518d2135..03b0a2a3c0 100755 --- a/src/main/java/ui/tmlad/TMLADSendEvent.java +++ b/src/main/java/ui/tmlad/TMLADSendEvent.java @@ -186,8 +186,8 @@ public class TMLADSendEvent extends TADComponentWithoutSubcomponents implements g.drawLine(x + width - linebreak, y + height, x + width, y + height / 2); - g.drawString("evt", x + (width - w) / 2, y); - g.drawString(value, x + (width - w) / 2, y + textY); + drawSingleString(g,"evt", x + (width - w) / 2, y); + drawSingleString(g,value, x + (width - w) / 2, y + textY); drawReachabilityInformation(g); } diff --git a/src/main/java/ui/tmlad/TMLADSendRequest.java b/src/main/java/ui/tmlad/TMLADSendRequest.java index 5a3bbbbc0c..f3adac6e14 100755 --- a/src/main/java/ui/tmlad/TMLADSendRequest.java +++ b/src/main/java/ui/tmlad/TMLADSendRequest.java @@ -170,8 +170,8 @@ public class TMLADSendRequest extends TADComponentWithoutSubcomponents/* Issue # g.drawLine(x+width-linebreak, y, x+width, y+height/2); g.drawLine(x+width-linebreak, y+height, x+width, y+height/2); - g.drawString("req", x+(width-w) / 2, y); - g.drawString(value, x + (width - w) / 2 , y + textY); + drawSingleString(g,"req", x+(width-w) / 2, y); + drawSingleString(g,value, x + (width - w) / 2 , y + textY); drawReachabilityInformation(g); } diff --git a/src/main/java/ui/tmlad/TMLADWaitEvent.java b/src/main/java/ui/tmlad/TMLADWaitEvent.java index c8da373214..f4fe2504e1 100755 --- a/src/main/java/ui/tmlad/TMLADWaitEvent.java +++ b/src/main/java/ui/tmlad/TMLADWaitEvent.java @@ -168,8 +168,8 @@ public class TMLADWaitEvent extends TADComponentWithoutSubcomponents/* Issue #69 g.drawLine(x, y, x+linebreak, y+height/2); g.drawLine(x, y+height, x+linebreak, y+height/2); - g.drawString("evt", x+(width-w) / 2, y); - g.drawString(value, x + linebreak + scale( 2 ), y + textY); + drawSingleString(g,"evt", x+(width-w) / 2, y); + drawSingleString(g,value, x + linebreak + scale( 2 ), y + textY); drawReachabilityInformation(g); } diff --git a/src/main/java/ui/tmlad/TMLADWriteChannel.java b/src/main/java/ui/tmlad/TMLADWriteChannel.java index 4603cf2aff..7f5e2eb8a7 100755 --- a/src/main/java/ui/tmlad/TMLADWriteChannel.java +++ b/src/main/java/ui/tmlad/TMLADWriteChannel.java @@ -191,17 +191,17 @@ public class TMLADWriteChannel extends TADComponentWithoutSubcomponents/* Issue g.drawLine(x + width - linebreak, y, x + width, y + height / 2); g.drawLine(x + width - linebreak, y + height, x + width, y + height / 2); if (isAttacker) { - g.drawString("attack", x + (width - w) / 2, y); + drawSingleString(g,"attack", x + (width - w) / 2, y); } else { - g.drawString("chl", x + (width - w) / 2, y); + drawSingleString(g,"chl", x + (width - w) / 2, y); } - g.drawString(value, x + (width - w) / 2, y + textY); + drawSingleString(g,value, x + (width - w) / 2, y + textY); if (!securityContext.equals("")) { c = g.getColor(); if (!isEncForm){ g.setColor(Color.RED); } - g.drawString("sec:" + securityContext, x + 3 * width / 4, y + height + textY - scale( 4 ) ); + drawSingleString(g,"sec:" + securityContext, x + 3 * width / 4, y + height + textY - scale( 4 ) ); g.setColor(c); } @@ -221,10 +221,10 @@ public class TMLADWriteChannel extends TADComponentWithoutSubcomponents/* Issue int index = 1; for (String s : latencyVals.keySet()) { int w = g.getFontMetrics().stringWidth(s); - g.drawString(s, x - latencyX - w + 1, y - latencyY * index - 2); + drawSingleString(g,s, x - latencyX - w + 1, y - latencyY * index - 2); g.drawRect(x - latencyX - w, y - latencyY * index - textHeight, w + 4, textHeight); g.drawLine(x, y, x - latencyX, y - latencyY * index); - g.drawString(latencyVals.get(s), x - latencyX / 2, y - latencyY * index / 2); + drawSingleString(g,latencyVals.get(s), x - latencyX / 2, y - latencyY * index / 2); index++; } } diff --git a/src/main/java/ui/tmlcd/TMLAttributeBox.java b/src/main/java/ui/tmlcd/TMLAttributeBox.java index 0c77c26167..06f6f0fb33 100755 --- a/src/main/java/ui/tmlcd/TMLAttributeBox.java +++ b/src/main/java/ui/tmlcd/TMLAttributeBox.java @@ -163,10 +163,10 @@ public class TMLAttributeBox extends TGCWithoutInternalComponent { TAttribute a; for(int i=0; i<myAttributes.size(); i++) { a = myAttributes.get (i); - g.drawString(a.toString(), x + textX, y + textY + i* h); + drawSingleString(g,a.toString(), x + textX, y + textY + i* h); } } else if (myAttributes.size() >0) { - g.drawString("...", x + textX, y + textY); + drawSingleString(g,"...", x + textX, y + textY); } } diff --git a/src/main/java/ui/tmlcd/TMLChannelOperator.java b/src/main/java/ui/tmlcd/TMLChannelOperator.java index 671d105828..260782fe34 100755 --- a/src/main/java/ui/tmlcd/TMLChannelOperator.java +++ b/src/main/java/ui/tmlcd/TMLChannelOperator.java @@ -81,7 +81,7 @@ public class TMLChannelOperator extends TMLCompositionOperator { //g.drawImage(IconManager.img8, x + width - 20, y + 3, ColorManager.COMPOSITION_OPERATOR, null); ColorManager.setColor(g, getState(), 0); g.setFont((g.getFont()).deriveFont(Font.BOLD)); - g.drawString(value, x + textX, y + textY); + drawSingleString(g,value, x + textX, y + textY); g.setFont((g.getFont()).deriveFont(Font.PLAIN)); } } diff --git a/src/main/java/ui/tmlcd/TMLChannelProperties.java b/src/main/java/ui/tmlcd/TMLChannelProperties.java index 798d6c28b7..f0cf78e933 100755 --- a/src/main/java/ui/tmlcd/TMLChannelProperties.java +++ b/src/main/java/ui/tmlcd/TMLChannelProperties.java @@ -100,7 +100,7 @@ public class TMLChannelProperties extends TGCWithoutInternalComponent { ColorManager.setColor(g, getState(), 0); // h = g.getFontMetrics().getHeight(); - g.drawString(value, x, y + h); + drawSingleString(g,value, x, y + h); if (!tdp.isScaled()) { width = g.getFontMetrics().stringWidth(value); diff --git a/src/main/java/ui/tmlcd/TMLEventOperator.java b/src/main/java/ui/tmlcd/TMLEventOperator.java index f47c0f9d25..92e6463eb2 100755 --- a/src/main/java/ui/tmlcd/TMLEventOperator.java +++ b/src/main/java/ui/tmlcd/TMLEventOperator.java @@ -82,7 +82,7 @@ public class TMLEventOperator extends TMLCompositionOperator { //g.drawImage(IconManager.img8, x + width - 20, y + 3, ColorManager.COMPOSITION_OPERATOR, null); ColorManager.setColor(g, getState(), 0); g.setFont((g.getFont()).deriveFont(Font.BOLD)); - g.drawString(value, x + textX, y + textY); + drawSingleString(g,value, x + textX, y + textY); g.setFont((g.getFont()).deriveFont(Font.PLAIN)); } } diff --git a/src/main/java/ui/tmlcd/TMLEventProperties.java b/src/main/java/ui/tmlcd/TMLEventProperties.java index ceda021d7d..dee00aad3b 100755 --- a/src/main/java/ui/tmlcd/TMLEventProperties.java +++ b/src/main/java/ui/tmlcd/TMLEventProperties.java @@ -96,7 +96,7 @@ public class TMLEventProperties extends TGCWithoutInternalComponent { ColorManager.setColor(g, getState(), 0); // h = g.getFontMetrics().getHeight(); - g.drawString(valueOCL, x, y + h); + drawSingleString(g,valueOCL, x, y + h); if (!tdp.isScaled()) { width = g.getFontMetrics().stringWidth(valueOCL); diff --git a/src/main/java/ui/tmlcd/TMLOperationBox.java b/src/main/java/ui/tmlcd/TMLOperationBox.java index 130e870804..0f804a3792 100755 --- a/src/main/java/ui/tmlcd/TMLOperationBox.java +++ b/src/main/java/ui/tmlcd/TMLOperationBox.java @@ -90,7 +90,7 @@ public class TMLOperationBox extends TGCWithoutInternalComponent { g.fillRect(x+1, y+1, width-1, height-1); ColorManager.setColor(g, getState(), 0); if (value.length() > 0) { - g.drawString(value, x + textX, y + textY); + drawSingleString(g,value, x + textX, y + textY); } } diff --git a/src/main/java/ui/tmlcd/TMLRequestOperator.java b/src/main/java/ui/tmlcd/TMLRequestOperator.java index 851cb6de4c..07c6305de9 100755 --- a/src/main/java/ui/tmlcd/TMLRequestOperator.java +++ b/src/main/java/ui/tmlcd/TMLRequestOperator.java @@ -81,7 +81,7 @@ public class TMLRequestOperator extends TMLCompositionOperator { //g.drawImage(IconManager.img8, x + width - 20, y + 3, ColorManager.COMPOSITION_OPERATOR, null); ColorManager.setColor(g, getState(), 0); g.setFont((g.getFont()).deriveFont(Font.BOLD)); - g.drawString(value, x + textX, y + textY); + drawSingleString(g,value, x + textX, y + textY); g.setFont((g.getFont()).deriveFont(Font.PLAIN)); } } diff --git a/src/main/java/ui/tmlcd/TMLRequestProperties.java b/src/main/java/ui/tmlcd/TMLRequestProperties.java index 2dcff2167d..f026dbb026 100755 --- a/src/main/java/ui/tmlcd/TMLRequestProperties.java +++ b/src/main/java/ui/tmlcd/TMLRequestProperties.java @@ -94,7 +94,7 @@ public class TMLRequestProperties extends TGCWithoutInternalComponent { ColorManager.setColor(g, getState(), 0); // h = g.getFontMetrics().getHeight(); - g.drawString(valueOCL, x, y + h); + drawSingleString(g,valueOCL, x, y + h); if (!tdp.isScaled()) { width = g.getFontMetrics().stringWidth(valueOCL); diff --git a/src/main/java/ui/tmlcd/TMLTaskOperator.java b/src/main/java/ui/tmlcd/TMLTaskOperator.java index 110a6ad715..7cd165bbf1 100755 --- a/src/main/java/ui/tmlcd/TMLTaskOperator.java +++ b/src/main/java/ui/tmlcd/TMLTaskOperator.java @@ -199,13 +199,13 @@ public class TMLTaskOperator extends TGCWithInternalComponent implements TMLTask // ColorManager.setColor(g, getState(), 0); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(value, x + textX, y + textY); + drawSingleString(g,value, x + textX, y + textY); g.setFont(f); if (exit) { g.setFont(f.deriveFont((float)exitFontSize)); int w = g.getFontMetrics().stringWidth(EXIT_STRING); - g.drawString(EXIT_STRING, x + width - w - 5, y + textY + exitFontSize); + drawSingleString(g,EXIT_STRING, x + width - w - 5, y + textY + exitFontSize); g.setFont(f); } } diff --git a/src/main/java/ui/tmlcp/TMLCPPanel.java b/src/main/java/ui/tmlcp/TMLCPPanel.java index c7fe4fcc02..6c4f3b7064 100755 --- a/src/main/java/ui/tmlcp/TMLCPPanel.java +++ b/src/main/java/ui/tmlcp/TMLCPPanel.java @@ -226,7 +226,8 @@ public class TMLCPPanel extends TDiagramPanel { //mgui.changeMade(mgui.getSequenceDiagramPanel(name), TDiagramPanel.NEW_COMPONENT); return b; } - + + @Override public void enhance() { // Vector<TGComponent> v = new Vector<>(); diff --git a/src/main/java/ui/tmldd/TMLArchiArtifact.java b/src/main/java/ui/tmldd/TMLArchiArtifact.java index e0e00901ac..561bb306e6 100755 --- a/src/main/java/ui/tmldd/TMLArchiArtifact.java +++ b/src/main/java/ui/tmldd/TMLArchiArtifact.java @@ -170,7 +170,7 @@ public class TMLArchiArtifact extends TGCWithoutInternalComponent implements Swa g.drawLine(x+width-space, y+ marginFileY/*space+fileY*/, x+width-marginFileX/*space-fileX*/, y+ marginFileY/*space+fileY*/); g.drawLine(x+width- marginCran /*space-cran*/, y+space, x+width- marginCran/*space-cran*/, y+ marginCran/*space+cran*/); g.drawLine(x+width- marginCran/*space-cran*/, y+ marginCran/*space+cran*/, x + width-space, y+marginCran /*space+cran*/); - g.drawString(value, x + textX , y + textY); + drawSingleString(g,value, x + textX , y + textY); } public void setValue(String val, Graphics g) { diff --git a/src/main/java/ui/tmldd/TMLArchiBUSNode.java b/src/main/java/ui/tmldd/TMLArchiBUSNode.java index e6e8fdc604..7995aa0c43 100755 --- a/src/main/java/ui/tmldd/TMLArchiBUSNode.java +++ b/src/main/java/ui/tmldd/TMLArchiBUSNode.java @@ -169,10 +169,10 @@ public class TMLArchiBUSNode extends TMLArchiCommunicationNode implements Swallo int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY); // Issue #31 + drawSingleString(g,ster, x + (width - w)/2, y + textY); // Issue #31 g.setFont(f); w = g.getFontMetrics().stringWidth(name); - g.drawString(name, x + (width - w)/2, y + 2 * textY ); // Issue #31 + drawSingleString(g,name, x + (width - w)/2, y + 2 * textY ); // Issue #31 // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiBridgeNode.java b/src/main/java/ui/tmldd/TMLArchiBridgeNode.java index 7bd2fcda6c..dd89d9d156 100755 --- a/src/main/java/ui/tmldd/TMLArchiBridgeNode.java +++ b/src/main/java/ui/tmldd/TMLArchiBridgeNode.java @@ -142,9 +142,9 @@ public class TMLArchiBridgeNode extends TMLArchiCommunicationNode implements Swa // Strings String ster = "<<" + stereotype + ">>"; int w = g.getFontMetrics().stringWidth(ster); - g.drawString(ster, x + (width - w)/2, y + textY ); // Issue #31 + drawSingleString(g,ster, x + (width - w)/2, y + textY ); // Issue #31 w = g.getFontMetrics().stringWidth(name); - g.drawString(name, x + (width - w)/2, y + 2 * textY ); // Issue #31 + drawSingleString(g,name, x + (width - w)/2, y + 2 * textY ); // Issue #31 // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiCPNode.java b/src/main/java/ui/tmldd/TMLArchiCPNode.java index 8a919b6dcb..412872fb45 100755 --- a/src/main/java/ui/tmldd/TMLArchiCPNode.java +++ b/src/main/java/ui/tmldd/TMLArchiCPNode.java @@ -145,7 +145,7 @@ public class TMLArchiCPNode extends TMLArchiCommunicationNode implements Swallow int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY); // Issue #31 + drawSingleString(g,ster, x + (width - w)/2, y + textY); // Issue #31 g.setFont(f); // Complete name is derived @@ -154,7 +154,7 @@ public class TMLArchiCPNode extends TMLArchiCommunicationNode implements Swallow // String val = name + "::" + reference; // completeName = val; w = g.getFontMetrics().stringWidth(val); - g.drawString(val, x + (width - w)/2, y + 2 * textY ); // Issue #31 + drawSingleString(g,val, x + (width - w)/2, y + 2 * textY ); // Issue #31 // Icon // Issue #31 @@ -508,6 +508,7 @@ public class TMLArchiCPNode extends TMLArchiCommunicationNode implements Swallow } // Display the mapping of instances onto platform units + @Override public String getAttributes() { String attr = ""; diff --git a/src/main/java/ui/tmldd/TMLArchiCPUNode.java b/src/main/java/ui/tmldd/TMLArchiCPUNode.java index d96ffaabba..2f2b34e77b 100755 --- a/src/main/java/ui/tmldd/TMLArchiCPUNode.java +++ b/src/main/java/ui/tmldd/TMLArchiCPUNode.java @@ -159,10 +159,10 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w) / 2, y + textY);// Issue #31 + drawSingleString(g,ster, x + (width - w) / 2, y + textY);// Issue #31 g.setFont(f); w = g.getFontMetrics().stringWidth(name); - g.drawString(name, x + (width - w) / 2, y + 2 * textY );// Issue #31 + drawSingleString(g,name, x + (width - w) / 2, y + 2 * textY );// Issue #31 // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiConnectingPoint.java b/src/main/java/ui/tmldd/TMLArchiConnectingPoint.java index d7db38ab51..996d29edcb 100755 --- a/src/main/java/ui/tmldd/TMLArchiConnectingPoint.java +++ b/src/main/java/ui/tmldd/TMLArchiConnectingPoint.java @@ -58,7 +58,7 @@ public class TMLArchiConnectingPoint extends TGConnectingPointWidthHeight{ public TMLArchiConnectingPoint(CDElement _container, int _x, int _y, boolean _in, boolean _out, double _w, double _h) { super(_container, _x, _y, _in, _out, _w, _h); } - + @Override public boolean isCompatibleWith(int type) { return type == TGComponentManager.CONNECTOR_NODE_TMLARCHI; } diff --git a/src/main/java/ui/tmldd/TMLArchiConnectorNode.java b/src/main/java/ui/tmldd/TMLArchiConnectorNode.java index ad1dcd0663..7991fcec51 100755 --- a/src/main/java/ui/tmldd/TMLArchiConnectorNode.java +++ b/src/main/java/ui/tmldd/TMLArchiConnectorNode.java @@ -78,6 +78,7 @@ public class TMLArchiConnectorNode extends TGConnector implements WithAttribute editable = true; } + @Override public boolean editOndoubleClick(JFrame frame) { JDialogTMLConnectorNode dialog = new JDialogTMLConnectorNode(frame, "Setting connector attributes", this); //dialog.setSize(350, 300); @@ -92,7 +93,7 @@ public class TMLArchiConnectorNode extends TGConnector implements WithAttribute return true; } - + @Override protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ if (hasASpy) { g.drawImage(IconManager.img5200, (x1 + x2)/2, (y1 + y2)/2, null); @@ -106,8 +107,10 @@ public class TMLArchiConnectorNode extends TGConnector implements WithAttribute } public boolean hasASpy() { - return hasASpy; + return hasASpy; } + + @Override public void addActionToPopupMenu(JPopupMenu componentMenu, ActionListener menuAL, int x, int y) { componentMenu.addSeparator(); JMenuItem generate = null; @@ -122,10 +125,13 @@ public class TMLArchiConnectorNode extends TGConnector implements WithAttribute generate.addActionListener(menuAL); componentMenu.add(generate); } + + @Override public int getType() { return TGComponentManager.CONNECTOR_NODE_TMLARCHI; } + @Override protected String translateExtraParam() { StringBuffer sb = new StringBuffer("<extraparam>\n"); sb.append("<info priority=\""); @@ -182,6 +188,7 @@ public class TMLArchiConnectorNode extends TGConnector implements WithAttribute } } + @Override public boolean eventOnPopup(ActionEvent e) { String s = e.getActionCommand(); TraceManager.addDev("action: " + s); @@ -199,6 +206,7 @@ public class TMLArchiConnectorNode extends TGConnector implements WithAttribute return true; } + public TMLArchiCPUNode getOriginNode() { TGComponent tgc = tdp.getComponentToWhichBelongs(getTGConnectingPointP1()); if (tgc instanceof TMLArchiCPUNode) { @@ -220,7 +228,7 @@ public class TMLArchiConnectorNode extends TGConnector implements WithAttribute public int getPriority() { return priority; } - + @Override public String getAttributes() { return "Priority = " + priority; } diff --git a/src/main/java/ui/tmldd/TMLArchiCrossbarNode.java b/src/main/java/ui/tmldd/TMLArchiCrossbarNode.java index bebbe27993..6937ebab78 100755 --- a/src/main/java/ui/tmldd/TMLArchiCrossbarNode.java +++ b/src/main/java/ui/tmldd/TMLArchiCrossbarNode.java @@ -149,10 +149,10 @@ public class TMLArchiCrossbarNode extends TMLArchiCommunicationNode implements S int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY );// Issue #31 + drawSingleString(g,ster, x + (width - w)/2, y + textY );// Issue #31 g.setFont(f); w = g.getFontMetrics().stringWidth(name); - g.drawString(name, x + (width - w)/2, y + 2 * textY );// Issue #31 + drawSingleString(g,name, x + (width - w)/2, y + 2 * textY );// Issue #31 // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiDMANode.java b/src/main/java/ui/tmldd/TMLArchiDMANode.java index 5d84134509..6e023983cb 100755 --- a/src/main/java/ui/tmldd/TMLArchiDMANode.java +++ b/src/main/java/ui/tmldd/TMLArchiDMANode.java @@ -144,10 +144,10 @@ public class TMLArchiDMANode extends TMLArchiCommunicationNode implements Swallo int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY ); + drawSingleString(g,ster, x + (width - w)/2, y + textY ); w = g.getFontMetrics().stringWidth(name); g.setFont(f); - g.drawString(name, x + (width - w)/2, y + 2* textY ); + drawSingleString(g,name, x + (width - w)/2, y + 2* textY ); // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiEventArtifact.java b/src/main/java/ui/tmldd/TMLArchiEventArtifact.java index f71db2491a..210a750b0a 100755 --- a/src/main/java/ui/tmldd/TMLArchiEventArtifact.java +++ b/src/main/java/ui/tmldd/TMLArchiEventArtifact.java @@ -141,11 +141,11 @@ public class TMLArchiEventArtifact extends TGCWithoutInternalComponent implement g.drawImage( scale( IconManager.img9 ), x+width- scale( SPACE + FILE_X - 3 )/*space-fileX*/ + 3, y + scale( SPACE + 7 )/*space + 7*/, null);// Issue #31 - g.drawString(value, x + textX , y + textY); + drawSingleString(g,value, x + textX , y + textY); Font f = g.getFont(); g.setFont(f.deriveFont(Font.ITALIC)); - g.drawString(typeName, x + textX , y + textY + scale( 20 ) );// Issue #31 + drawSingleString(g,typeName, x + textX , y + textY + scale( 20 ) );// Issue #31 g.setFont(f); } diff --git a/src/main/java/ui/tmldd/TMLArchiFPGANode.java b/src/main/java/ui/tmldd/TMLArchiFPGANode.java index 023a13a667..7f098be681 100755 --- a/src/main/java/ui/tmldd/TMLArchiFPGANode.java +++ b/src/main/java/ui/tmldd/TMLArchiFPGANode.java @@ -159,12 +159,12 @@ public class TMLArchiFPGANode extends TMLArchiNode implements SwallowTGComponent int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY); // Issue #31 + drawSingleString(g,ster, x + (width - w)/2, y + textY); // Issue #31 g.setFont(f); w = g.getFontMetrics().stringWidth(name); // Issue #31 final int marginY2 = scale( MARGIN_Y_2 ); - g.drawString(name, x + (width - w)/2, y + marginY2 ); + drawSingleString(g,name, x + (width - w)/2, y + marginY2 ); // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiFirewallNode.java b/src/main/java/ui/tmldd/TMLArchiFirewallNode.java index c1ff198887..4479a7736a 100644 --- a/src/main/java/ui/tmldd/TMLArchiFirewallNode.java +++ b/src/main/java/ui/tmldd/TMLArchiFirewallNode.java @@ -147,12 +147,12 @@ public class TMLArchiFirewallNode extends TMLArchiCommunicationNode implements S // Strings String ster = "<<" + stereotype + ">>"; int w = g.getFontMetrics().stringWidth(ster); - g.drawString(ster, x + (width - w)/2, y + textY); + drawSingleString(g,ster, x + (width - w)/2, y + textY); w = g.getFontMetrics().stringWidth(name); // Issue #31 final int marginY2 = scale( MARGIN_Y_2 ); - g.drawString(name, x + (width - w)/2, y + marginY2 ); + drawSingleString(g,name, x + (width - w)/2, y + marginY2 ); // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiHWANode.java b/src/main/java/ui/tmldd/TMLArchiHWANode.java index c95aaacaaf..abab3551d8 100755 --- a/src/main/java/ui/tmldd/TMLArchiHWANode.java +++ b/src/main/java/ui/tmldd/TMLArchiHWANode.java @@ -151,13 +151,13 @@ public class TMLArchiHWANode extends TMLArchiNode implements SwallowTGComponent, int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY ); // Issue #31 + drawSingleString(g,ster, x + (width - w)/2, y + textY ); // Issue #31 g.setFont(f); w = g.getFontMetrics().stringWidth(name); // Issue #31 final int marginY2 = scale( MARGIN_Y_2 ); - g.drawString(name, x + (width - w)/2, y + marginY2 ); + drawSingleString(g,name, x + (width - w)/2, y + marginY2 ); // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiKey.java b/src/main/java/ui/tmldd/TMLArchiKey.java index 2a814efa01..593ce9d29c 100755 --- a/src/main/java/ui/tmldd/TMLArchiKey.java +++ b/src/main/java/ui/tmldd/TMLArchiKey.java @@ -171,12 +171,12 @@ public class TMLArchiKey extends TGCWithoutInternalComponent implements Swallowe // Issue #31 g.drawImage( scale( IconManager.img9 ), x+width-keyOffsetY-keyOffsetX + shaftWidth/*3*/, y + keyOffsetY + scale( 7 ), null ); - g.drawString(value, x + textX , y + textY); + drawSingleString(g,value, x + textX , y + textY); Font f = g.getFont(); g.setFont(f.deriveFont(Font.ITALIC)); // Issue #31 - g.drawString(typeName, x + textX , y + textY + scale( 20 ) ); + drawSingleString(g,typeName, x + textX , y + textY + scale( 20 ) ); g.setFont(f); } diff --git a/src/main/java/ui/tmldd/TMLArchiMemoryNode.java b/src/main/java/ui/tmldd/TMLArchiMemoryNode.java index d94658bbb5..9b82673703 100755 --- a/src/main/java/ui/tmldd/TMLArchiMemoryNode.java +++ b/src/main/java/ui/tmldd/TMLArchiMemoryNode.java @@ -144,10 +144,10 @@ public class TMLArchiMemoryNode extends TMLArchiCommunicationNode implements Swa int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY); // Issue #31 + drawSingleString(g,ster, x + (width - w)/2, y + textY); // Issue #31 w = g.getFontMetrics().stringWidth(name); g.setFont(f); - g.drawString(name, x + (width - w)/2, y + 2 * textY/*2*/); // Issue #31 + drawSingleString(g,name, x + (width - w)/2, y + 2 * textY/*2*/); // Issue #31 // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiPortArtifact.java b/src/main/java/ui/tmldd/TMLArchiPortArtifact.java index 9ff6a38535..19ece1ae27 100644 --- a/src/main/java/ui/tmldd/TMLArchiPortArtifact.java +++ b/src/main/java/ui/tmldd/TMLArchiPortArtifact.java @@ -178,11 +178,11 @@ public class TMLArchiPortArtifact extends TGCWithoutInternalComponent implements g.drawImage( scale( IconManager.img9 ), x+width - scale( space + fileX - 3 ), y + scale( SPACE + 7 ), null); - g.drawString(value, x + textX , y + textY); + drawSingleString(g,value, x + textX , y + textY); Font f = g.getFont(); g.setFont(f.deriveFont(Font.ITALIC)); - g.drawString(typeName, x + textX , y + textY + 20); + drawSingleString(g,typeName, x + textX , y + textY + 20); g.setFont(f); // Link to selected memory diff --git a/src/main/java/ui/tmldd/TMLArchiRouterNode.java b/src/main/java/ui/tmldd/TMLArchiRouterNode.java index 30012eb922..cee15e328d 100755 --- a/src/main/java/ui/tmldd/TMLArchiRouterNode.java +++ b/src/main/java/ui/tmldd/TMLArchiRouterNode.java @@ -143,9 +143,9 @@ public class TMLArchiRouterNode extends TMLArchiCommunicationNode implements Swa // Strings String ster = "<<" + stereotype + ">>"; int w = g.getFontMetrics().stringWidth(ster); - g.drawString(ster, x + (width - w)/2, y + textY ); // Issue #31 + drawSingleString(g,ster, x + (width - w)/2, y + textY ); // Issue #31 w = g.getFontMetrics().stringWidth(name); - g.drawString(name, x + (width - w)/2, y + 2 * textY ); // Issue #31 + drawSingleString(g,name, x + (width - w)/2, y + 2 * textY ); // Issue #31 // Icon // Issue #31 diff --git a/src/main/java/ui/tmldd/TMLArchiVGMNNode.java b/src/main/java/ui/tmldd/TMLArchiVGMNNode.java index 80c7c4c4de..4f54eb551f 100755 --- a/src/main/java/ui/tmldd/TMLArchiVGMNNode.java +++ b/src/main/java/ui/tmldd/TMLArchiVGMNNode.java @@ -149,10 +149,10 @@ public class TMLArchiVGMNNode extends TMLArchiCommunicationNode implements Swall int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY); // Issue #31 + drawSingleString(g,ster, x + (width - w)/2, y + textY); // Issue #31 g.setFont(f); w = g.getFontMetrics().stringWidth(name); - g.drawString(name, x + (width - w)/2, y + 2 * textY); // Issue #31 + drawSingleString(g,name, x + (width - w)/2, y + 2 * textY); // Issue #31 // Icon //g.drawImage(IconManager.imgic1102.getImage(), x + width - 20, y + 4, null); diff --git a/src/main/java/ui/tmlsd/TGConnectingPointTMLSD.java b/src/main/java/ui/tmlsd/TGConnectingPointTMLSD.java index 417421aad7..2f14729e2a 100755 --- a/src/main/java/ui/tmlsd/TGConnectingPointTMLSD.java +++ b/src/main/java/ui/tmlsd/TGConnectingPointTMLSD.java @@ -59,7 +59,7 @@ public class TGConnectingPointTMLSD extends TGConnectingPoint{ public TGConnectingPointTMLSD(CDElement _container, int _x, int _y, boolean _in, boolean _out) { super(_container, _x, _y, _in, _out); } - + @Override public boolean isCompatibleWith(int type) { // if ((type == TGComponentManager.CONNECTOR_MESSAGE_ASYNC_TMLSD)) { diff --git a/src/main/java/ui/tmlsd/TGConnectorMessageAsyncTMLSD.java b/src/main/java/ui/tmlsd/TGConnectorMessageAsyncTMLSD.java index 8f15bb0318..06cee3dba5 100755 --- a/src/main/java/ui/tmlsd/TGConnectorMessageAsyncTMLSD.java +++ b/src/main/java/ui/tmlsd/TGConnectorMessageAsyncTMLSD.java @@ -85,7 +85,7 @@ public class TGConnectorMessageAsyncTMLSD extends TGConnectorMessageTMLSD { heightValue = g.getFontMetrics().getHeight(); } - g.drawString(value, ((p1.getX() + p2.getX()) / 2)-widthValue/2, ((p1.getY() + p2.getY()) / 2) - 5); + drawSingleString(g,value, ((p1.getX() + p2.getX()) / 2)-widthValue/2, ((p1.getY() + p2.getY()) / 2) - 5); } public int getType() { diff --git a/src/main/java/ui/tmlsd/TMLSDActionState.java b/src/main/java/ui/tmlsd/TMLSDActionState.java index ae3a8b2091..5e475ba7ec 100755 --- a/src/main/java/ui/tmlsd/TMLSDActionState.java +++ b/src/main/java/ui/tmlsd/TMLSDActionState.java @@ -93,7 +93,7 @@ public class TMLSDActionState extends TGCOneLineText implements SwallowedTGCompo // } g.drawRoundRect(x - width/2, y, width, height, arc, arc); - g.drawString(value, x - w / 2 , y + textY); + drawSingleString(g,value, x - w / 2 , y + textY); } @Override diff --git a/src/main/java/ui/tmlsd/TMLSDInstance.java b/src/main/java/ui/tmlsd/TMLSDInstance.java index a8a47a0297..abbad573bf 100755 --- a/src/main/java/ui/tmlsd/TMLSDInstance.java +++ b/src/main/java/ui/tmlsd/TMLSDInstance.java @@ -130,7 +130,7 @@ public abstract class TMLSDInstance extends TGCWithInternalComponent implements scaledHText = scale( hText ); } - g.drawString(name, x - (scaledWText / 2) + width/2, y - 3); // Issue #31 + drawSingleString(g,name, x - (scaledWText / 2) + width/2, y - 3); // Issue #31 g.drawLine(x - (scaledWText / 2) + width/2, y-2, x + (scaledWText / 2) + width/2, y-2); // Issue #31 g.drawLine(x+(width/2), y, x+(width/2), y +height); -- GitLab