All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.graphics.BasicTSModifier

java.lang.Object
   |
   +----jp.kyasu.graphics.Modifier
           |
           +----jp.kyasu.graphics.FontModifier
                   |
                   +----jp.kyasu.graphics.BasicTSModifier

public class BasicTSModifier
extends FontModifier
implements TextStyleModifier
The 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)
 

Version:
22 Jun 1998
Author:
Kazuki YASUMATSU
See Also:
TextStyleModifier, Modifier, FontModifier

Variable Index

 o CLICKABLE
The constant for the attribute "clickable".
 o FONT
The constant for the attribute "font".

Constructor Index

 o BasicTSModifier()
Constructs an empty text style modifier.
 o BasicTSModifier(FontModifier)
Constructs a text style modifier that has the same attributes and values as the specified font modifier.

Method Index

 o modify(TextStyle)
Modifies the given text style, i.e., Creates the modified version of the given text style.

Variables

 o FONT
 public static final String FONT
The constant for the attribute "font". The value of this attribute should be a Font or an ExtendedFont.

See Also:
ExtendedFont
 o CLICKABLE
 public static final String CLICKABLE
The constant for the attribute "clickable". The value of this attribute should be a ClickableTextAction.

See Also:
ClickableTextAction

Constructors

 o BasicTSModifier
 public BasicTSModifier()
Constructs an empty text style modifier.

 o BasicTSModifier
 public BasicTSModifier(FontModifier modifier)
Constructs a text style modifier that has the same attributes and values as the specified font modifier.

Parameters:
modifier - the font modifier.

Methods

 o modify
 public TextStyle modify(TextStyle tStyle)
Modifies the given text style, i.e., Creates the modified version of the given text style.

Parameters:
tStyle - the given text style.
Returns:
the modified version of the given text style; or the given text style, if the modification has no effect on the given text style.
See Also:
modify

All Packages  Class Hierarchy  This Package  Previous  Next  Index