com.sas.awt
Class Font

com.sas.awt.Font
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.lang.StringDataInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.models.NodeInterface, com.sas.models.SimpleNodeInterface, com.sas.PublicClonable, com.sas.ViewInterface, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class Font
implements com.sas.lang.StringDataInterface, com.sas.PublicClonable, com.sas.models.NodeInterface

A class representing Font.

See Also:
Serialized Form

Constructor Summary
Font()
          Default constructor for design time
Font(java.lang.String text)
          A constructor that takes a name of the font, style and size separated by comma and creates a font object.
Font(java.lang.String text, int style, int size)
          A constructor that takes a name, style and size of the font and creates a font object.
 
Method Summary
 void _setName(java.lang.String text)
          Sets the name of this font object to the specified name
 void _setSize(int sz)
          Sets the point size attribute of this font.
 void _setStyle(int si)
          Sets the Style to PLAIN-0, BOLD-1, ITALIC-2 or BOLDITALIC-3.
 java.lang.Object clone()
          Return a clone of the object.
 int countNodeChildren(int maximumChildCount)
          always returns zero
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
           
 com.sas.models.SimpleNodeInterface getNodeChild(int index)
          Returns the child node at the specified index.
 int getNodeChildCount()
          Returns the number of children available.
 com.sas.models.SimpleNodeInterface[] getNodeChildren(int startIndex, int count)
          Returns the specified range of children for the current node.
 java.lang.String getNodeExpandedText()
          Returns the value of the nodeExpandedText property.
 java.lang.String getNodeText()
          Get the name of this Font object
 java.lang.String getNodeType()
          Returns the value of the nodeType property.
 java.lang.String getText()
          Gets the name of the font.
 boolean isLeafNode()
          Indicates whether the current node is a leaf.
static Font newFont(java.awt.Font javaFont)
           
 void setText(java.lang.String text)
          Sets the font of this object to the specified name
 java.lang.String toString()
          Gets the string representation (name, style, size) of this font object.
 
Methods inherited from class com.sas.awt.FontComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getLinkInfo, getModelInterface, getRequiredInterfaces, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 

Constructor Detail

Font

public Font()
Default constructor for design time


Font

public Font(java.lang.String text)
A constructor that takes a name of the font, style and size separated by comma and creates a font object. If the size and/or style is not specified, it uses default size of 12 points and style PLAIN.

Parameters:
a - string containing name, size and style.

Font

public Font(java.lang.String text,
            int style,
            int size)
A constructor that takes a name, style and size of the font and creates a font object.

Parameters:
name - of the font
style - of the font PLAIN-0, BOLD-1, ITALIC-2, BOLDITALIC-3
size - point size of the font.
Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: FontComponent
Return a clone of the object.

Specified by:
clone in interface com.sas.PublicClonable
Overrides:
clone in class FontComponent
Returns:
a clone of the object.
Throws:
java.lang.CloneNotSupportedException - if the model attached to the component being cloned will not allow the clone to attach.

newFont

public static Font newFont(java.awt.Font javaFont)

getText

public java.lang.String getText()
Gets the name of the font.

Specified by:
getText in interface com.sas.lang.StringDataInterface
Returns:
name of the Font.

setText

public void setText(java.lang.String text)
Sets the font of this object to the specified name

Specified by:
setText in interface com.sas.lang.StringDataInterface
Parameters:
name - of the font.

_setName

public void _setName(java.lang.String text)
Sets the name of this font object to the specified name

Parameters:
name - of the font.

_setStyle

public void _setStyle(int si)
Sets the Style to PLAIN-0, BOLD-1, ITALIC-2 or BOLDITALIC-3. If the parameter passed in is greater than 3 or less than 0, the style attribute is set to PLAIN-0.

Parameters:
integer - representing the style of font

_setSize

public void _setSize(int sz)
Sets the point size attribute of this font.

Parameters:
point - size of this font

toString

public java.lang.String toString()
Gets the string representation (name, style, size) of this font object.

Overrides:
toString in class java.awt.Font
Returns:
sting representing the name, style and size of the font.

getNodeExpandedText

public java.lang.String getNodeExpandedText()
Returns the value of the nodeExpandedText property. The expanded text is usually a more descriptive version of the nodeText property. For example, a node that represents a file can return the file name for the nodeText property and the full path name for the nodeExpandedText property. It is an alias for toString()

Specified by:
getNodeExpandedText in interface com.sas.models.NodeInterface
Returns:
the concatenation of name, style and size separated by comma.

getNodeText

public java.lang.String getNodeText()
Get the name of this Font object

Specified by:
getNodeText in interface com.sas.models.NodeInterface
Returns:
the name

getNodeType

public java.lang.String getNodeType()
Returns the value of the nodeType property. The type can be used for categorizing nodes.

Specified by:
getNodeType in interface com.sas.models.NodeInterface
Returns:
the type "font"

countNodeChildren

public int countNodeChildren(int maximumChildCount)
always returns zero

Specified by:
countNodeChildren in interface com.sas.models.SimpleNodeInterface
Parameters:
maximumChildCount - the maximum number of children to read, or 0 to read indefinitely
Returns:
The number of children known to be available.
See Also:
SimpleNodeInterface

getNodeChildCount

public int getNodeChildCount()
Returns the number of children available. If the number of children is unknown, -1 should be returned.

Specified by:
getNodeChildCount in interface com.sas.models.SimpleNodeInterface
Returns:
always zero

isLeafNode

public boolean isLeafNode()
Indicates whether the current node is a leaf. A true value indicates that the current node is a leaf and hence will not have any children.

Specified by:
isLeafNode in interface com.sas.models.SimpleNodeInterface
Returns:
true always

getNodeChild

public com.sas.models.SimpleNodeInterface getNodeChild(int index)
Returns the child node at the specified index.

Specified by:
getNodeChild in interface com.sas.models.SimpleNodeInterface
Parameters:
index - the 0-based index of the child node to retrieve
Returns:
null always

getNodeChildren

public com.sas.models.SimpleNodeInterface[] getNodeChildren(int startIndex,
                                                            int count)
Returns the specified range of children for the current node. If there are less children than are queried for, an implementation can return an array whose size if representative of the actual number of children being returned or an array whose size is the same as the number of children asked for. If the resulting array's size is the same as the number asked for and there are fewer children returned than asked for the implementation should assign the unused values in the array to null.

Specified by:
getNodeChildren in interface com.sas.models.SimpleNodeInterface
Parameters:
startIndex - 0-based index which identifies the start of the range
count - the amount of children to get
Returns:
null always



Copyright © 2009 SAS Institute Inc. All Rights Reserved.