X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FJvSwingUtils.java;h=9573e1facc94d6dcf50065cb7bd8140efd286659;hb=d25788049914c6da6c71d203822a9adfe548d3be;hp=812353e0dc3f9400a1bb02cd667a3b3d83ee6189;hpb=70889ff334002372e84073f843e9b1fae70c0cfb;p=jalview.git diff --git a/src/jalview/gui/JvSwingUtils.java b/src/jalview/gui/JvSwingUtils.java index 812353e..9573e1f 100644 --- a/src/jalview/gui/JvSwingUtils.java +++ b/src/jalview/gui/JvSwingUtils.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * * This file is part of Jalview. * @@ -26,6 +26,7 @@ import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JMenu; +import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.SwingConstants; @@ -148,4 +149,46 @@ public final class JvSwingUtils jLabel.setToolTipText(tooltip); } + /** + * standard font for labels and check boxes in dialog boxes + * @return + */ + + public static Font getLabelFont() + { + return getLabelFont(false,false); + } + public static Font getLabelFont(boolean bold, boolean italic) + { + return new java.awt.Font("Verdana", (!bold && !italic) ? Font.PLAIN : (bold ? Font.BOLD : 0) + (italic ? Font.ITALIC : 0), 11); + } + + /** + * standard font for editable text areas + * @return + */ + public static Font getTextAreaFont() + { + return getLabelFont(false,false); + } + + /** + * clean up a swing menu. + * Removes any empty submenus without selection listeners. + * @param webService + */ + public static void cleanMenu(JMenu webService) + { + for (int i=0;i