SilverStream
Application Server 3.5

com.sssw.rt.gui
Class AgoFontIdentifier

java.lang.Object
 |
 +--com.sssw.rt.gui.AgoFontIdentifier
All Implemented Interfaces:
Cloneable

public class AgoFontIdentifier
extends Object
implements Cloneable

The AgoFontIdentifier is a representation of a font for use with the SilverStream controls. The AgoFontIdentifier specifies the font's name, style, and point size.


Field Summary
static int BOLD
          Bold text style.
static int ITALIC
          Italic text style.
static int PLAIN
          Plain text style.
 
Constructor Summary
AgoFontIdentifier(AgoFontIdentifier fontidentifier)
          AgoFontIdentifier constructor.
AgoFontIdentifier(Font font)
          AgoFontIdentifier constructor.
AgoFontIdentifier(String name, int style, int size)
          AgoFontIdentifier constructor.
 
Method Summary
 Object clone()
          Clone method.
 boolean equals(Object object)
          Determine whether another object (presumably, another FontInstance) is the same as this one.
 String getName()
          Get the font name.
 int getSize()
          Returns the font size.
 int getStyle()
          Returns the font style.
 int hashCode()
          Return the hash code.
 void scale(int delta, int minimum, int maximum)
          Scale the font.
 void setName(String name)
          Set the font name.
 void setSize(int size)
          Sets the font point size.
 void setStyle(int style)
          Sets the AgoFontIdentifier's font style.
 String toString()
          Convert to a string.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PLAIN

public static final int PLAIN
Plain text style.

BOLD

public static final int BOLD
Bold text style.

ITALIC

public static final int ITALIC
Italic text style.
Constructor Detail

AgoFontIdentifier

public AgoFontIdentifier(String name,
                         int style,
                         int size)
AgoFontIdentifier constructor.

The AgoFontIdentifier object consists of three parts: a font name, a font style and a font size.

Parameters:
name - specifies the font name. At runtime, Java translates this value to the appropriate font installed on the system. These are the valid values:
 Dialog, SansSerif, Serif, Monospaced, Helvetica, 
 TimesRoman, Courier, DialogInput, Zapfdingbats
 
style - specifies the font style which can be one of these values:
  AgoFontIdentifier.PLAIN
  AgoFontIdentifier.BOLD
  AgoFontIdentifier.ITALIC
  AgoFontIdentifier.BOLD + AgoFontIdentifier.ITALIC
 
size - an integer that specifies the point size.

AgoFontIdentifier

public AgoFontIdentifier(Font font)
AgoFontIdentifier constructor.

AgoFontIdentifier

public AgoFontIdentifier(AgoFontIdentifier fontidentifier)
AgoFontIdentifier constructor.
Method Detail

getName

public String getName()
Get the font name.

Returns the font name which can be: Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats.

Example:

The following code fragment illustrates how to use the getName() method for AgoFontIdentifier.

  String fontname;
  fontname = fontid.getName();
 
see #setName(String)

setName

public void setName(String name)
Set the font name. The name can be: Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats.
See Also:
AgoFontIdentifier.getName()

getStyle

public int getStyle()
Returns the font style.

The style can be one of these values:

  AgoFontIdentifier.PLAIN
  AgoFontIdentifier.BOLD
  AgoFontIdentifier.ITALIC
  AgoFontIdentifier.BOLD + AgoFontIdentifier.ITALIC
 
Example:

The following code fragment illustrates how to use the getStyle() method for AgoFontIdentifier.

  int fontstyle;
  fontstyle = fontid.getStyle();
 
See Also:
AgoFontIdentifier.setStyle(int)

setStyle

public void setStyle(int style)
Sets the AgoFontIdentifier's font style. The style can can be one of these values:
  AgoFontIdentifier.PLAIN}
  AgoFontIdentifier.BOLD}
  AgoFontIdentifier.ITALIC}
  AgoFontIdentifier.BOLD + AgoFontIdentifier.ITALIC
 
See Also:
AgoFontIdentifier.getStyle()

getSize

public int getSize()
Returns the font size.

It can be any integer.

Example:

The following code fragment illustrates how to use the getSize() method for AgoFontIdentifier.

  int fontsize;
  fontsize = fontid.getSize();
 
See Also:
AgoFontIdentifier.setSize(int)

setSize

public void setSize(int size)
Sets the font point size. It can be any integer.
See Also:
AgoFontIdentifier.getSize()

scale

public void scale(int delta,
                  int minimum,
                  int maximum)
Scale the font. Make sure it's within the specified minimum/maximum range.

hashCode

public int hashCode()
Return the hash code.
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Determine whether another object (presumably, another FontInstance) is the same as this one.
Overrides:
equals in class Object

clone

public Object clone()
Clone method.
Overrides:
clone in class Object

toString

public String toString()
Convert to a string.
Overrides:
toString in class Object

SilverStream
Application Server 3.5