All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----jp.kyasu.graphics.Modifier | +----jp.kyasu.graphics.FontModifier | +----jp.kyasu.graphics.BasicTSModifier
BasicTSModifier
class is a basic implementation of
the interface for the text style modifier.
An example of the modification is:
TextStyle textStyle = new TextStyle("SansSerif", Font.PLAIN, 12); BasicTSModifier modifier = new BasicTSModifier(); modifier.put(BasicTSModifier.BOLD, true); modifier.put(BasicTSModifier.SIZE, 14); modifier.put(BasicTSModifier.COLOR, Color.red); textStyle = modifier.modify(textStyle); // textStyle: new TextStyle("SansSerif", Font.BOLD, 14, Color.red) modifier.clear(); modifier.put(BasicTSModifier.ITALIC, true); modifier.put(BasicTSModifier.SIZE_DIFF, -2); modifier.put(BasicTSModifier.COLOR, BasicTSModifier.NULL); textStyle = modifier.modify(textStyle); // textStyle: new TextStyle("SansSerif", Font.BOLD | Font.ITALIC, 12) modifier.clear(); modifier.put(BasicTSModifier.FONT, new Font("Serif", Font.PLAIN, 12)); modifier.put(BasicTSModifier.CLICKABLE, new ClickableTextAction("action")); textStyle = modifier.modify(textStyle); // textStyle: new TextStyle("Serif", Font.PLAIN, 12) with action modifier.clear(); modifier.put(BasicTSModifier.FONT, new ExtendedFont("Monospaced", Font.PLAIN, 14, Color.red)); modifier.put(BasicTSModifier.CLICKABLE, BasicTSModifier.NULL); textStyle = modifier.modify(textStyle); // textStyle: new TextStyle("Monospaced", Font.PLAIN, 14, Color.red)
public static final String FONT
public static final String CLICKABLE
public BasicTSModifier()
public BasicTSModifier(FontModifier modifier)
public TextStyle modify(TextStyle tStyle)
All Packages Class Hierarchy This Package Previous Next Index