From b43f7dd02fe810721a5c8c2acafe43e7437c5a1e Mon Sep 17 00:00:00 2001
From: Letitia Li <leli@enst.fr>
Date: Mon, 5 Oct 2015 11:13:34 +0000
Subject: [PATCH] Pragma UI fix

---
 src/ui/ColorManager.java            |  4 ++--
 src/ui/avatarbd/AvatarBDPragma.java | 10 ++++++++--
 src/ui/window/JDialogPragma.java    |  3 ++-
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/ui/ColorManager.java b/src/ui/ColorManager.java
index 3442e5118f..316b0d9722 100755
--- a/src/ui/ColorManager.java
+++ b/src/ui/ColorManager.java
@@ -80,7 +80,7 @@ public class ColorManager {
 
     //public static final Color UML_NOTE_BG = new Color(189, 91, 13, 200);
     public static  Color UML_NOTE_BG = new Color(173, 190, 234);
-    public static  Color PRAGMA_BG = new Color(255, 0, 255);
+    public static  Color PRAGMA_BG = new Color(200, 170, 200);
     public static final Color COMPOSITION_OPERATOR = Color.yellow;
     public static final Color ATTRIBUTE_BOX = new Color(199, 243, 105);
     public static final Color ATTRIBUTE_BOX_ACTION = new Color(199, 243, 105);
@@ -126,7 +126,7 @@ public class ColorManager {
     public static  Color TML_PORT_EVENT = new Color(216, 187, 249);
     public static  Color TML_PORT_REQUEST = new Color(196, 166, 122);
 
-    public static final Color UML_NOTE = Color.lightGray;
+    public static final Color UML_NOTE = new Color(73, 90, 134);
     public static final Color PRAGMA = new Color(100, 0, 100);
 
     public static final Color SD_REFERENCE = new Color(104, 229, 255);
diff --git a/src/ui/avatarbd/AvatarBDPragma.java b/src/ui/avatarbd/AvatarBDPragma.java
index 12e507491d..ec2f435742 100755
--- a/src/ui/avatarbd/AvatarBDPragma.java
+++ b/src/ui/avatarbd/AvatarBDPragma.java
@@ -142,7 +142,7 @@ public class AvatarBDPragma extends TGCScalableWithoutInternalComponent {
           }*/
 
         if (((rescaled) && (!tdp.isScaled())) || myFont == null) {
-            currentFontSize = tdp.getFontSize();
+            currentFontSize = tdp.getFontSize()+1;
             //System.out.println("Rescaled, font size = " + currentFontSize + " height=" + height);
             //            myFont = f.deriveFont((float)currentFontSize);
             //myFontB = myFont.deriveFont(Font.BOLD);
@@ -195,16 +195,22 @@ public class AvatarBDPragma extends TGCScalableWithoutInternalComponent {
         g.fillPolygon(px, py, 4);
 
         g.setColor(Color.black);	
+	
 	int i = 1;
+	Font heading = new Font("heading", Font.BOLD, 14);
+	g.setFont(heading);
 	g.drawString("Model Pragma", x+textX, y+textY + currentFontSize);
+	g.setFont(fold);
 	for (String s: models){
 	    g.drawString(s, x + textX, y + textY + (i+1)* currentFontSize);
 	    i++;
 	}
 	g.drawString(" ", x+ textX, y+ textY+(i+1)*currentFontSize);
 	i++;
-	g.drawLine(x, y+textY+i*currentFontSize, x+width, y+textY+i*currentFontSize);
+	g.drawLine(x, y+textY/2+i*currentFontSize, x+width, y+textY/2+i*currentFontSize);
+	g.setFont(heading);
 	g.drawString("Property Pragma", x+textX, y+textY+(i+1)* currentFontSize);
+	g.setFont(fold);
 	i++;
 	for (String s: properties){
 	    if (authMap.containsKey(s)){
diff --git a/src/ui/window/JDialogPragma.java b/src/ui/window/JDialogPragma.java
index df97fcfa0d..d454f0159f 100755
--- a/src/ui/window/JDialogPragma.java
+++ b/src/ui/window/JDialogPragma.java
@@ -88,8 +88,9 @@ public class JDialogPragma extends javax.swing.JDialog implements ActionListener
             popupMenu.setOpaque(false);
             popupMenu.setBorder(null);
             popupMenu.add(list = createSuggestionList(position, subWord), BorderLayout.CENTER);
+	    //Show popupMenu only if there are matching suggestions
 	    if (list.getModel().getSize() >0){
-            popupMenu.show(textarea, location.x, textarea.getBaseline(0, 0) + location.y);
+                popupMenu.show(textarea, location.x, textarea.getBaseline(0, 0) + location.y);
 	    }
         }
 
-- 
GitLab