Class marimba.text.StylePool
All Packages Class Hierarchy This Package Previous Next Index
Class marimba.text.StylePool
java.lang.Object
|
+----marimba.text.StylePool
- public final class StylePool
- extends Object
A class that maintains an array of styles and their positions in a
document. There is always a single style at the end of the
document, which is in a position that is greater than any possible
(or at least likely) position in a real text object.
- Version:
- 1.14, 01/15/97
- Author:
- Jonathan Payne
-
deleteStyles(Text, int, int)
-
-
findStyle(int)
- Returns the index of the first style whose position is >= to
the specified position.
-
findStyleIndexFor(int)
- This returns the index of the style that is responsbile for the
specified position.
-
getStyleAt(int)
- Returns the style at the specified index.
-
getStylePosAt(int)
- Returns the position of the style at the specified index.
-
readStyles(ByteString, InputStream)
- Read a bunch of text, with embedded style references, into this
style pool.
-
setDefaultStyle(Style)
- Adjust the styles in the style pool based on a new default (or
initial) style.
-
writeStyles(byte[], int, int, OutputStream)
- Write the styles to the specified output stream, using the
specified text data.
findStyle
public int findStyle(int pos)
- Returns the index of the first style whose position is >= to
the specified position.
findStyleIndexFor
public int findStyleIndexFor(int pos)
- This returns the index of the style that is responsbile for the
specified position.
getStyleAt
public Style getStyleAt(int index)
- Returns the style at the specified index.
getStylePosAt
public int getStylePosAt(int index)
- Returns the position of the style at the specified index.
deleteStyles
public void deleteStyles(Text text,
int pos0,
int pos1)
setDefaultStyle
public void setDefaultStyle(Style s)
- Adjust the styles in the style pool based on a new default (or
initial) style. All styles which have the same attributes of
the default style are modified to look like the new default
style. Only compare the font and color attributes at this
point.
writeStyles
public void writeStyles(byte data[],
int pos0,
int pos1,
OutputStream out) throws IOException
- Write the styles to the specified output stream, using the
specified text data.
readStyles
public void readStyles(ByteString bs,
InputStream in) throws IOException
- Read a bunch of text, with embedded style references, into this
style pool. The text characters are inserted into the
specified ByteString.
All Packages Class Hierarchy This Package Previous Next Index