setVisible flag sent to EditNameDialog
authoramwaterhouse <Andrew Waterhouse>
Tue, 1 May 2007 16:34:53 +0000 (16:34 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 1 May 2007 16:34:53 +0000 (16:34 +0000)
src/jalview/appletgui/APopupMenu.java
src/jalview/appletgui/AnnotationLabels.java
src/jalview/appletgui/AnnotationPanel.java
src/jalview/appletgui/EditNameDialog.java

index 41b5076..300eb94 100755 (executable)
@@ -307,7 +307,7 @@ public class APopupMenu
           "Group Description",\r
           ap.alignFrame,\r
           "Edit Group Name / Description",\r
-          500,100);\r
+          500,100, true);\r
 \r
       if (dialog.accept)\r
       {\r
@@ -342,7 +342,7 @@ public class APopupMenu
 \r
                                                    ap.alignFrame,\r
                                                    "Edit Sequence",\r
-                                                   500, 100);\r
+                                                   500, 100, true);\r
 \r
         if (dialog.accept)\r
         {\r
@@ -499,7 +499,7 @@ public class APopupMenu
         "Sequence Description",\r
         ap.alignFrame,\r
         "Edit Sequence Name / Description",\r
-        500,100);\r
+        500,100, true);\r
 \r
     if (dialog.accept)\r
     {\r
index 1884a08..5ddaa5e 100755 (executable)
@@ -157,19 +157,31 @@ public class AnnotationLabels
 
   boolean editLabelDescription(AlignmentAnnotation annotation)
   {
+    Checkbox padGaps = new Checkbox("Fill Empty Gaps With \""
+                                    +ap.av.getGapCharacter()+"\"",
+                                    annotation.padGaps);
+
     EditNameDialog dialog = new EditNameDialog(
         annotation.label,
         annotation.description,
-        "       Annotation Label",
+        "      Annotation Label",
         "Annotation Description",
         ap.alignFrame,
         "Edit Annotation Name / Description",
-        500, 100);
+        500, 180, false);
+
+    Panel empty = new Panel(new FlowLayout());
+    empty.add(padGaps);
+    dialog.add(empty);
+    dialog.pack();
+
+    dialog.setVisible(true);
 
     if (dialog.accept)
     {
       annotation.label = dialog.getName();
       annotation.description = dialog.getDescription();
+      annotation.setPadGaps(padGaps.getState(), av.getGapCharacter());
       repaint();
       return true;
     }
index 101bddf..ee9e159 100755 (executable)
@@ -225,7 +225,7 @@ public class AnnotationPanel
   String enterLabel(String text, String label)\r
   {\r
     EditNameDialog dialog = new EditNameDialog(text,null,label,null,\r
-        ap.alignFrame,"Enter Label", 400,200);\r
+        ap.alignFrame,"Enter Label", 400,200, true);\r
 \r
     if(dialog.accept)\r
       return dialog.getName();\r
@@ -370,8 +370,8 @@ public class AnnotationPanel
   {\r
     // setHeight of panels\r
     AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
-\r
     int height = 0;\r
+\r
     if (aa != null)\r
     {\r
       for (int i = 0; i < aa.length; i++)\r
@@ -387,6 +387,7 @@ public class AnnotationPanel
         {\r
           aa[i].height += av.charHeight;\r
         }\r
+\r
         if (aa[i].hasIcons)\r
         {\r
           aa[i].height += 16;\r
@@ -394,13 +395,14 @@ public class AnnotationPanel
 \r
         if (aa[i].graph > 0)\r
         {\r
-          aa[i].height += GRAPH_HEIGHT;\r
+          aa[i].height += aa[i].graphHeight;\r
         }\r
 \r
         if (aa[i].height == 0)\r
         {\r
           aa[i].height = 20;\r
         }\r
+\r
         height += aa[i].height;\r
       }\r
     }\r
index ca029c8..46325d9 100644 (file)
@@ -49,16 +49,18 @@ public class EditNameDialog extends JVDialog
                         String label2,\r
                         Frame owner,\r
                         String title,\r
-                        int width, int height)\r
+                        int width, int height, boolean display)\r
   {\r
     super(owner, title, true, width, height);\r
 \r
+    Font mono = new Font("Monospaced", Font.PLAIN, 12);\r
     Panel panel = new Panel(new BorderLayout());\r
     Panel panel2 = new Panel(new BorderLayout());\r
 \r
     id = new TextField(name, 40);\r
+    id.setFont(mono);\r
     Label label = new Label(label1);\r
-    label.setFont(new Font("Monospaced", Font.PLAIN, 12));\r
+    label.setFont(mono);\r
 \r
     panel2.add(label, BorderLayout.WEST);\r
     panel2.add(id, BorderLayout.CENTER);\r
@@ -69,13 +71,14 @@ public class EditNameDialog extends JVDialog
     {\r
       panel2 = new Panel(new BorderLayout());\r
       description = new TextField(desc, 40);\r
+      description.setFont(mono);\r
       label = new Label(label2);\r
-      label.setFont(new Font("Monospaced", Font.PLAIN, 12));\r
+      label.setFont(mono);\r
       panel2.add(label, BorderLayout.WEST);\r
       panel2.add(description, BorderLayout.CENTER);\r
       panel.add(panel2, BorderLayout.CENTER);\r
     }\r
     setMainPanel(panel);\r
-    setVisible(true);\r
+    setVisible(display);\r
   }\r
 }\r