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

Method Index

 o deleteStyles(Text, int, int)
 o findStyle(int)
Returns the index of the first style whose position is >= to the specified position.
 o findStyleIndexFor(int)
This returns the index of the style that is responsbile for the specified position.
 o getStyleAt(int)
Returns the style at the specified index.
 o getStylePosAt(int)
Returns the position of the style at the specified index.
 o readStyles(ByteString, InputStream)
Read a bunch of text, with embedded style references, into this style pool.
 o setDefaultStyle(Style)
Adjust the styles in the style pool based on a new default (or initial) style.
 o writeStyles(byte[], int, int, OutputStream)
Write the styles to the specified output stream, using the specified text data.

Methods

 o findStyle
  public int findStyle(int pos)
Returns the index of the first style whose position is >= to the specified position.
 o findStyleIndexFor
  public int findStyleIndexFor(int pos)
This returns the index of the style that is responsbile for the specified position.
 o getStyleAt
  public Style getStyleAt(int index)
Returns the style at the specified index.
 o getStylePosAt
  public int getStylePosAt(int index)
Returns the position of the style at the specified index.
 o deleteStyles
  public void deleteStyles(Text text,
                           int pos0,
                           int pos1)
 o 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.
 o 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.
 o 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