From eb335f7046544de24aa40a10de47bbe258e9c118 Mon Sep 17 00:00:00 2001 From: Florian Lugou <florian.lugou@telecom-paristech.fr> Date: Thu, 19 May 2016 13:11:39 +0000 Subject: [PATCH] fix lock display for confidentiality of attributes --- src/ui/avatarbd/AvatarBDBlock.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui/avatarbd/AvatarBDBlock.java b/src/ui/avatarbd/AvatarBDBlock.java index 0beba05139..4fa10ceb27 100644 --- a/src/ui/avatarbd/AvatarBDBlock.java +++ b/src/ui/avatarbd/AvatarBDBlock.java @@ -311,9 +311,10 @@ public class AvatarBDBlock extends TGCScalableWithInternalComponent implements S // Try to draw it w = graph.getFontMetrics ().stringWidth (attrString); - if (w + 2*textX < this.width) + if (w + 2*textX < this.width) { graph.drawString (attrString, this.x + textX, this.y + h); - else { + this.drawConfidentialityVerification (attr.getConfidentialityVerification (), graph, this.x, this.y + h); + } else { // If we can't, try to draw with "..." instead int stringLength; for (stringLength = attrString.length ()-1; stringLength >= 0; stringLength--) { @@ -321,6 +322,7 @@ public class AvatarBDBlock extends TGCScalableWithInternalComponent implements S w = graph.getFontMetrics ().stringWidth (abbrev); if (w + 2*textX < this.width) { graph.drawString (abbrev, this.x + textX, this.y + h); + this.drawConfidentialityVerification (attr.getConfidentialityVerification (), graph, this.x, this.y + h); break; } } -- GitLab