BEA Systems, Inc.

WebLogic Server 5.1.0 API Reference

weblogic.html
Class FontElement

java.lang.Object
  |
  +--weblogic.html.HtmlElement
        |
        +--weblogic.html.ElementWithAttributes
              |
              +--weblogic.html.SinglePartElement
                    |
                    +--weblogic.html.FontElement

Deprecated. Use StyleElement

public class FontElement
extends SinglePartElement

A FontElement is used to set the font color, face, and size of an HtmlElement. Use FontElement as the argument for any of the addElement() methods. You can also use the asFontElement() methods in the parent class HtmlElement. Valid color names for use with methods in this class are encapsulated in HtmlColor.

This examples uses FontElement to add font effects to an HtmlPage object "hp":

   hp.addElement(new FontElement(5, HtmlColor.fuchsia, caption).asItalicElement())
 
or, using asFontElement() to increase a font size:
    .addElement(new StringElement(filename).asCenteredElement().asFontElement("+1"))

The HTML FONT and BASEFONT elements are deprecated in HTML 4.0 in favor of a more generic use of the STYLE element. htmlKona continues to support these HTML elements, but not all browsers may display them properly.

Author:
Copyright (c) 1995-97, WebLogic, Inc. All Rights Reserved.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.
See Also:
StyleElement

Fields inherited from class weblogic.html.HtmlElement
codeset, useObsolete
 
Constructor Summary
FontElement()
          Deprecated. Constructs a FontElement.
FontElement(int size, HtmlElement val)
          Deprecated. Constructs a FontElement of the specified font size with the specified HtmlElement.
FontElement(int size, java.lang.String val)
          Deprecated. Constructs a FontElement of the specified font size with the specified string.
FontElement(int size, java.lang.String color, HtmlElement val)
          Deprecated. Constructs a FontElement of the specified font size and color with the specified HtmlElement.
FontElement(int size, java.lang.String color, java.lang.String val)
          Deprecated. Constructs a FontElement of the specified font size and color with the specified string.
FontElement(java.lang.String val)
          Deprecated. Constructs a FontElement with the specified string.
FontElement(java.lang.String size, HtmlElement val)
          Deprecated. Constructs a FontElement of the specified font size with the specified HtmlElement.
FontElement(java.lang.String size, java.lang.String val)
          Deprecated. Constructs a FontElement of the specified font size with the specified string.
FontElement(java.lang.String size, java.lang.String color, HtmlElement val)
          Deprecated. Constructs a FontElement of the specified font size and color with the specified HtmlElement.
FontElement(java.lang.String size, java.lang.String color, java.lang.String val)
          Deprecated. Constructs a FontElement of the specified font size and color with the specified string.
 
Method Summary
protected  java.lang.String getHtmlCode()
          Deprecated.  
 FontElement setFontColor(java.awt.Color color)
          Deprecated. Sets the font color to a java.awt.Color object.
 FontElement setFontColor(java.lang.String val)
          Deprecated. Sets the font color to its hexidecimal RGB value (for example, #FFFFFF) or to the name of a color.
 FontElement setFontFace(java.lang.String fontnames)
          Deprecated. Sets the FACE attribute for a FontElement.
 FontElement setFontSize(int val)
          Deprecated. Sets the font size.
 FontElement setFontSize(java.lang.String val)
          Deprecated. Sets the font size to a string value.
 
Methods inherited from class weblogic.html.SinglePartElement
getElement, printBody, printBody, printBody, setElement, setElement, widthAsLiteral
 
Methods inherited from class weblogic.html.ElementWithAttributes
addAttribute, addAttribute, escapeQuotes, getBooleanAttribute, getElementAttribute, getLocalVar, getQuotedAttribute, output, output, output, printBody, printCR, printEndingTag, setBooleanAttribute, setBooleanAttribute, setClass, setDirection, setElementAttribute, setElementAttribute, setElementAttribute, setElementAttribute, setElementAttribute, setId, setLang, setLocalVar, setQuotedAttribute, setStyle
 
Methods inherited from class weblogic.html.HtmlElement
asAnchorElement, asBigElement, asBlockquoteElement, asBoldElement, asCenteredElement, asCiteElement, asCodeElement, asCommentElement, asDefineTermElement, asEmphasisElement, asFontElement, asFontElement, asFontElement, asHtmlContainer, asItalicElement, asKeyboardElement, asLiteralElement, asParagraphElement, asSampleElement, asSmallElement, asStrikeElement, asStrongElement, asSubscriptElement, asSuperscriptElement, asTeletypeElement, asUnderlineElement, asVariableElement, getVersion, setAnchorMode, setCodeset, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FontElement

public FontElement()
Deprecated. 
Constructs a FontElement.

FontElement

public FontElement(java.lang.String val)
Deprecated. 
Constructs a FontElement with the specified string.

Parameters:
contents - String

FontElement

public FontElement(int size,
                   java.lang.String val)
Deprecated. 
Constructs a FontElement of the specified font size with the specified string.

Parameters:
size - Font size in points
val - String

FontElement

public FontElement(java.lang.String size,
                   java.lang.String val)
Deprecated. 
Constructs a FontElement of the specified font size with the specified string.

Parameters:
size - Font size
val - String

FontElement

public FontElement(int size,
                   HtmlElement val)
Deprecated. 
Constructs a FontElement of the specified font size with the specified HtmlElement.

Parameters:
size - Font size
val - HtmlElement

FontElement

public FontElement(java.lang.String size,
                   HtmlElement val)
Deprecated. 
Constructs a FontElement of the specified font size with the specified HtmlElement.

Parameters:
size - Font size
val - HtmlElement

FontElement

public FontElement(java.lang.String size,
                   java.lang.String color,
                   java.lang.String val)
Deprecated. 
Constructs a FontElement of the specified font size and color with the specified string. Supports Netscape relative terms for font size.

Parameters:
size - Font size or term for font size
color - Hex RGB color or valid color name
val - String

FontElement

public FontElement(int size,
                   java.lang.String color,
                   java.lang.String val)
Deprecated. 
Constructs a FontElement of the specified font size and color with the specified string.

Parameters:
size - Font size
color - Hex RGB color or valid color name
val - String

FontElement

public FontElement(int size,
                   java.lang.String color,
                   HtmlElement val)
Deprecated. 
Constructs a FontElement of the specified font size and color with the specified HtmlElement.

Parameters:
size - Font size
color - Hex RGB color or valid color name
val - HtmlElement

FontElement

public FontElement(java.lang.String size,
                   java.lang.String color,
                   HtmlElement val)
Deprecated. 
Constructs a FontElement of the specified font size and color with the specified HtmlElement. Supports Netscape relative terms for font size.

Parameters:
size - Font size or term for font size
color - Hex RGB color or valid color name
val - HtmlElement
Method Detail

setFontColor

public FontElement setFontColor(java.lang.String val)
Deprecated. 
Sets the font color to its hexidecimal RGB value (for example, #FFFFFF) or to the name of a color. Valid color names are encapsulated in HtmlColor. Not supported by all browsers.

Parameters:
val - Hex color value or valid color name
Returns:
FontElement object

setFontColor

public FontElement setFontColor(java.awt.Color color)
Deprecated. 
Sets the font color to a java.awt.Color object. Not supported by all browsers.

Parameters:
color - Color object
Returns:
FontElement object

setFontFace

public FontElement setFontFace(java.lang.String fontnames)
Deprecated. 
Sets the FACE attribute for a FontElement. Not supported by all browsers.

Parameters:
fontnames - Comma-delimited list of font face names
Returns:
FontElement

setFontSize

public FontElement setFontSize(int val)
Deprecated. 
Sets the font size.

Parameters:
val - Font size in points
Returns:
FontElement object

setFontSize

public FontElement setFontSize(java.lang.String val)
Deprecated. 
Sets the font size to a string value. Supports relative terms for font size.

Parameters:
val - Font size
Returns:
FontElement object

getHtmlCode

protected java.lang.String getHtmlCode()
Deprecated. 

Overrides:
getHtmlCode in class ElementWithAttributes

Documentation is available at
http://www.weblogic.com/docs51