X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FJvSwingUtils.java;h=b25b2c884d447f13c1e39c1d6baf013657a42aaf;hb=72fb6df14f1ff426bbafa18dcc9a90450da93018;hp=79e0cefaa88418be0fc51af172d486e637fc1b62;hpb=05d220bbea0e8ce667490219436b96ebdf9826df;p=jalview.git diff --git a/src/jalview/gui/JvSwingUtils.java b/src/jalview/gui/JvSwingUtils.java index 79e0cef..b25b2c8 100644 --- a/src/jalview/gui/JvSwingUtils.java +++ b/src/jalview/gui/JvSwingUtils.java @@ -56,12 +56,15 @@ import javax.swing.border.TitledBorder; */ public final class JvSwingUtils { + public static final String HTML_PREFIX = "
"; + /** * wrap a bare html safe string to around 60 characters per line using a CSS * style class specifying word-wrap and break-word * * @param enclose - * if true, add <html> wrapper tags + * if true, add <html> wrapper tags (currently false for only + * two references -- both in Jws2Discoverer -- * @param ttext * * @return @@ -94,10 +97,12 @@ public final class JvSwingUtils { return enclose ? "" + ttext + "" : ttext; } - - return (enclose ? "" : "") - + "

" - + ttext + "

" + ((enclose ? "" : "")); + // BH 2018,2019 + return (enclose + ? HTML_PREFIX + + ttext + + "
" + : ttext); } @@ -356,12 +361,13 @@ public final class JvSwingUtils /** * Adds a titled border to the component in the default font and position (top - * left) + * left), optionally witht italic text * * @param comp * @param title + * @param italic */ - public static void createItalicTitledBorder(JComponent comp, + public static TitledBorder createTitledBorder(JComponent comp, String title, boolean italic) { Font font = comp.getFont(); @@ -374,6 +380,8 @@ public final class JvSwingUtils title, TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION, font); comp.setBorder(titledBorder); + + return titledBorder; } }