Underline support!

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1307 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2003-11-15 02:06:16 +00:00
parent 7ec293a935
commit b2052c2f88
2 changed files with 9 additions and 2 deletions
@@ -1,5 +1,5 @@
//
// $Id: Label.java,v 1.31 2002/12/06 22:17:50 mdb Exp $
// $Id: Label.java,v 1.32 2003/11/15 02:06:16 mdb Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2002 Michael Bayne
@@ -503,6 +503,10 @@ public class Label implements SwingConstants, LabelStyleConstants
Font font = (_font == null) ? gfx.getFont() : _font;
HashMap map = new HashMap();
map.put(TextAttribute.FONT, font);
if (_style == UNDERLINE) {
map.put(TextAttribute.UNDERLINE,
TextAttribute.UNDERLINE_LOW_ONE_PIXEL);
}
AttributedString text = new AttributedString(_text, map);
return text.getIterator();
}
@@ -1,5 +1,5 @@
//
// $Id: LabelStyleConstants.java,v 1.1 2002/09/23 21:19:06 shaper Exp $
// $Id: LabelStyleConstants.java,v 1.2 2003/11/15 02:06:16 mdb Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2002 Walter Korman
@@ -37,4 +37,7 @@ public interface LabelStyleConstants
/** Constant denoting shadow text style. */
public static final int SHADOW = 3;
/** Constant denoting underlined text style. */
public static final int UNDERLINE = 4;
}