Class browser.BasicStyle
All Packages This Package Previous Next
Class browser.BasicStyle
java.lang.Object
|
+----browser.Style
|
+----browser.BasicStyle
-
public class
BasicStyle
-
extends Style
The BasicStyle class is used to specify most of the style changes
that occur as a result of html tag refs. Zero or more of the
parameters may be specified for change. BasicStyle operates on
instances of FormattingParameters, generating new instances of
FormattingParameters by modifying old ones.
-
See Also:
-
FormattingParameters
-
Version:
-
1.12, 10 Apr 1995
-
Author:
-
Jonathan Payne
-
BasicStyle(String)
-
Constructs a new instance of BasicStyle.
-
addFontAttribute(int)
-
-
clearFontAttribute(int)
-
-
finish(WRFormatter, TagRef)
-
Processes this style in the context provided by a Formatter
and a TagRef.
-
handleStyleSpec(String)
-
Handles the initialization string described in the constructor.
-
setAlignment(byte)
-
-
setColor(int, int, int)
-
-
setFontName(String)
-
-
setFontSize(int)
-
-
setLeftMargin(int)
-
-
setRightMargin(int)
-
-
setWrap(byte)
-
-
shouldApply(int)
-
-
start(WRFormatter, TagRef)
-
Processes this style in the context provided by a Formatter
and a TagRef.
BasicStyle
public BasicStyle(String spec)
-
Constructs a new instance of BasicStyle. Initializes itself
based on the attribute=value pairs in the specified
specification. Possible attributes and their values are:
- size
- integer size of font
- color
-
integer:integer:integer red, green and blue components of
color
- style
- i
- turn on italics
mode
- b
- turn on bold mode
- u
- turn on underline
mode
- p
- go to plain text (no italics or
bold)
- f
- select fixed width
font
- [+-]leftMargin
- integer new value of left
margin - if + or - is specified, the new value is relative to
the current value
- [+-]rightMargin
- integer new value of
right margin - if + or - is specified, the new value is
relative to the current value
- wrap
- not
- wrap
only at newlines in the document
- word
- wrap at word
bounderies
- char
- wrap as soon as a character doesn't fit
on the line
.
handleStyleSpec
protected void handleStyleSpec(String spec)
-
Handles the initialization string described in the constructor.
-
Overrides:
-
handleStyleSpec in class Style
start
public void start(WRFormatter f,
TagRef ref)
-
Processes this style in the context provided by a Formatter
and a TagRef. If the specified TagRef has a matching closing
tag, then this pushes new parameters onto the formatter's
parameter stack. Otherwise it just applies the style changes
implied by this BasicStyle object.
-
Parameters:
-
f
-
the WRFormatter that's formatting the document
that contained this style
-
ref
-
the html TagRef that refered to this style
-
Overrides:
-
start in class Style
-
See Also:
-
Formatter,
WRFormatter
finish
public void finish(WRFormatter f,
TagRef ref)
-
Processes this style in the context provided by a Formatter
and a TagRef. If the specified TagRef is a closing tag, then
pop the formatter's parameter stack.
-
Parameters:
-
f
-
the WRFormatter that's formatting the document
that contained this style
-
ref
-
the html TagRef that refered to this style
-
Overrides:
-
finish in class Style
-
See Also:
-
Formatter,
WRFormatter
shouldApply
public boolean shouldApply(int bit)
setWrap
public BasicStyle setWrap(byte wrap)
setAlignment
public BasicStyle setAlignment(byte align)
setLeftMargin
public BasicStyle setLeftMargin(int lm)
setRightMargin
public BasicStyle setRightMargin(int rm)
addFontAttribute
public BasicStyle addFontAttribute(int attr)
clearFontAttribute
public BasicStyle clearFontAttribute(int attr)
setFontSize
public BasicStyle setFontSize(int size)
setFontName
public BasicStyle setFontName(String name)
setColor
public BasicStyle setColor(int r,
int g,
int b)
All Packages This Package Previous Next