com.sas.table
Class FontStyle

com.sas.table.FontStyle
All Implemented Interfaces:
com.sas.collection.PropertyBagChangedListener, com.sas.collection.PropertyBagChangedSource, com.sas.collection.PropertyBagInterface, com.sas.collection.StaticPropertyBagInterface, com.sas.DeepClonable, com.sas.PublicClonable, com.sas.util.Countable, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class FontStyle

A customizable set of font properties.

See CellStyle for more details.

See Also:
FontStyles, FontWeights, FontWidths, Serialized Form

Field Summary
static java.lang.String NAME
          String used to identify the name property in the bag.
static java.lang.String SIZE
          String used to identify the size property in the bag.
static java.lang.String STYLE
          String used to identify the style property in the bag.
static java.lang.String WEIGHT
          String used to identify the weight property in the bag.
static java.lang.String WIDTH
          String used to identify the width property in the bag.
 
Constructor Summary
FontStyle()
           
 
Method Summary
 java.awt.Font getFont()
          Creates and returns a font with the characteristics defined by this FontStyle.
 java.lang.String getName()
          Returns the name.
 double getSize()
          Returns the size in points.
 int getStyle()
          Returns the style -- one of com.sas.awt.util.FontStyles.
 int getWeight()
          Returns the weight -- one of com.sas.awt.util.FontWeights.
 int getWidth()
          Returns the width -- one of com.sas.awt.util.FontWidths.
 boolean isNameSet()
          Determines if the name property is in the bag.
 boolean isSizeSet()
          Determines if the size property is in the bag.
 boolean isStyleSet()
          Determines if the style property is in the bag.
 boolean isWeightSet()
          Determines if the weight property is in the bag.
 boolean isWidthSet()
          Determines if the width property is in the bag.
 void setFont(java.awt.Font font)
          Sets the name, size, style, weight, and width properties based on the characteristics of a given font.
 void setName(java.lang.String newValue)
          Specifies the name.
 void setSize(double newValue)
          Specifies the size in points.
 void setStyle(int newValue)
          Specifies the style -- one of com.sas.awt.util.FontStyles.
 void setWeight(int newValue)
          Specifies the weight -- one of com.sas.awt.util.FontWeights.
 void setWidth(int newValue)
          Specifies the width -- one of com.sas.awt.util.FontWidths.
 void unsetName()
          Removes the name property from the bag.
 void unsetSize()
          Removes the size property from the bag.
 void unsetStyle()
          Removes the style property from the bag.
 void unsetWeight()
          Removes the weight property from the bag.
 void unsetWidth()
          Removes the width property from the bag.
 

Field Detail

NAME

public static final java.lang.String NAME
String used to identify the name property in the bag.

See Also:
Constant Field Values

SIZE

public static final java.lang.String SIZE
String used to identify the size property in the bag.

See Also:
Constant Field Values

STYLE

public static final java.lang.String STYLE
String used to identify the style property in the bag.

See Also:
Constant Field Values

WEIGHT

public static final java.lang.String WEIGHT
String used to identify the weight property in the bag.

See Also:
Constant Field Values

WIDTH

public static final java.lang.String WIDTH
String used to identify the width property in the bag.

See Also:
Constant Field Values
Constructor Detail

FontStyle

public FontStyle()
Method Detail

getName

public java.lang.String getName()
Returns the name.

Returns:
The value of the name property.
See Also:
isNameSet(), setName(java.lang.String), unsetName()

setName

public void setName(java.lang.String newValue)
Specifies the name.

Parameters:
newValue - The new value to assign the named property.
See Also:
getName(), isNameSet(), unsetName()

isNameSet

public boolean isNameSet()
Determines if the name property is in the bag.

Returns:
true if name has been set, and false otherwise.
See Also:
getName(), setName(java.lang.String), unsetName()

unsetName

public void unsetName()
Removes the name property from the bag.

See Also:
getName(), isNameSet(), setName(java.lang.String)

getSize

public double getSize()
Returns the size in points.

Returns:
The value of the size property.
See Also:
isSizeSet(), setSize(double), unsetSize()

setSize

public void setSize(double newValue)
Specifies the size in points.

Parameters:
newValue - The new value to assign the size property.
See Also:
getSize(), isSizeSet(), unsetSize()

isSizeSet

public boolean isSizeSet()
Determines if the size property is in the bag.

Returns:
true if size has been set, and false otherwise.
See Also:
getSize(), setSize(double), unsetSize()

unsetSize

public void unsetSize()
Removes the size property from the bag.

See Also:
getSize(), isSizeSet(), setSize(double)

getStyle

public int getStyle()
Returns the style -- one of com.sas.awt.util.FontStyles.

Returns:
The value of the style property.
See Also:
isStyleSet(), setStyle(int), unsetStyle()

setStyle

public void setStyle(int newValue)
Specifies the style -- one of com.sas.awt.util.FontStyles.

Parameters:
newValue - The new value to assign the style property.
See Also:
getStyle(), isStyleSet(), unsetStyle()

isStyleSet

public boolean isStyleSet()
Determines if the style property is in the bag.

Returns:
true if style has been set, and false otherwise.
See Also:
getStyle(), setStyle(int), unsetStyle()

unsetStyle

public void unsetStyle()
Removes the style property from the bag.

See Also:
getStyle(), isStyleSet(), setStyle(int)

getWeight

public int getWeight()
Returns the weight -- one of com.sas.awt.util.FontWeights.

Returns:
The value of the weight property.
See Also:
isWeightSet(), setWeight(int), unsetWeight()

setWeight

public void setWeight(int newValue)
Specifies the weight -- one of com.sas.awt.util.FontWeights.

Parameters:
newValue - The new value to assign the weight property.
See Also:
getWeight(), isWeightSet(), unsetWeight()

isWeightSet

public boolean isWeightSet()
Determines if the weight property is in the bag.

Returns:
true if weight has been set, and false otherwise.
See Also:
getWeight(), setWeight(int), unsetWeight()

unsetWeight

public void unsetWeight()
Removes the weight property from the bag.

See Also:
getWeight(), isWeightSet(), setWeight(int)

getWidth

public int getWidth()
Returns the width -- one of com.sas.awt.util.FontWidths.

Returns:
The value of the width property.
See Also:
isWidthSet(), setWidth(int), unsetWidth()

setWidth

public void setWidth(int newValue)
Specifies the width -- one of com.sas.awt.util.FontWidths.

Parameters:
newValue - The new value to assign the width property.
See Also:
getWidth(), isWidthSet(), unsetWidth()

isWidthSet

public boolean isWidthSet()
Determines if the width property is in the bag.

Returns:
true if width has been set, and false otherwise.
See Also:
getWidth(), setWidth(int), unsetWidth()

unsetWidth

public void unsetWidth()
Removes the width property from the bag.

See Also:
getWidth(), isWidthSet(), setWidth(int)

getFont

public java.awt.Font getFont()
Creates and returns a font with the characteristics defined by this FontStyle. This FontStyle must have at least its name and size properties set.

Returns:
A java.awt.Font that reflects the preferences of this FontStyle.

setFont

public void setFont(java.awt.Font font)
Sets the name, size, style, weight, and width properties based on the characteristics of a given font.

Parameters:
font - The font to mimic.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.