From: amwaterhouse Date: Tue, 1 May 2007 16:34:53 +0000 (+0000) Subject: setVisible flag sent to EditNameDialog X-Git-Tag: Release_2_3~87 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f13833b55dc6e05e5630b8dc465059a5cd2848a8;p=jalview.git setVisible flag sent to EditNameDialog --- diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 41b5076..300eb94 100755 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -307,7 +307,7 @@ public class APopupMenu "Group Description", ap.alignFrame, "Edit Group Name / Description", - 500,100); + 500,100, true); if (dialog.accept) { @@ -342,7 +342,7 @@ public class APopupMenu ap.alignFrame, "Edit Sequence", - 500, 100); + 500, 100, true); if (dialog.accept) { @@ -499,7 +499,7 @@ public class APopupMenu "Sequence Description", ap.alignFrame, "Edit Sequence Name / Description", - 500,100); + 500,100, true); if (dialog.accept) { diff --git a/src/jalview/appletgui/AnnotationLabels.java b/src/jalview/appletgui/AnnotationLabels.java index 1884a08..5ddaa5e 100755 --- a/src/jalview/appletgui/AnnotationLabels.java +++ b/src/jalview/appletgui/AnnotationLabels.java @@ -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; } diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 101bddf..ee9e159 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -225,7 +225,7 @@ public class AnnotationPanel String enterLabel(String text, String label) { EditNameDialog dialog = new EditNameDialog(text,null,label,null, - ap.alignFrame,"Enter Label", 400,200); + ap.alignFrame,"Enter Label", 400,200, true); if(dialog.accept) return dialog.getName(); @@ -370,8 +370,8 @@ public class AnnotationPanel { // setHeight of panels AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); - int height = 0; + if (aa != null) { for (int i = 0; i < aa.length; i++) @@ -387,6 +387,7 @@ public class AnnotationPanel { aa[i].height += av.charHeight; } + if (aa[i].hasIcons) { aa[i].height += 16; @@ -394,13 +395,14 @@ public class AnnotationPanel if (aa[i].graph > 0) { - aa[i].height += GRAPH_HEIGHT; + aa[i].height += aa[i].graphHeight; } if (aa[i].height == 0) { aa[i].height = 20; } + height += aa[i].height; } } diff --git a/src/jalview/appletgui/EditNameDialog.java b/src/jalview/appletgui/EditNameDialog.java index ca029c8..46325d9 100644 --- a/src/jalview/appletgui/EditNameDialog.java +++ b/src/jalview/appletgui/EditNameDialog.java @@ -49,16 +49,18 @@ public class EditNameDialog extends JVDialog String label2, Frame owner, String title, - int width, int height) + int width, int height, boolean display) { super(owner, title, true, width, height); + Font mono = new Font("Monospaced", Font.PLAIN, 12); Panel panel = new Panel(new BorderLayout()); Panel panel2 = new Panel(new BorderLayout()); id = new TextField(name, 40); + id.setFont(mono); Label label = new Label(label1); - label.setFont(new Font("Monospaced", Font.PLAIN, 12)); + label.setFont(mono); panel2.add(label, BorderLayout.WEST); panel2.add(id, BorderLayout.CENTER); @@ -69,13 +71,14 @@ public class EditNameDialog extends JVDialog { panel2 = new Panel(new BorderLayout()); description = new TextField(desc, 40); + description.setFont(mono); label = new Label(label2); - label.setFont(new Font("Monospaced", Font.PLAIN, 12)); + label.setFont(mono); panel2.add(label, BorderLayout.WEST); panel2.add(description, BorderLayout.CENTER); panel.add(panel2, BorderLayout.CENTER); } setMainPanel(panel); - setVisible(true); + setVisible(display); } }