| javax.swing.text.DefaultStyledDocument org.cougaar.tools.csmart.ui.console.ConsoleStyledDocument
ConsoleStyledDocument | public class ConsoleStyledDocument extends DefaultStyledDocument (Code) | | This is the document that contains the content of the Node output.
By extending DefaultStyledDocument , we get access to
search and highlight support. Note however that this is relatively
heavyweight. It includes support for undo listeners, all sorts of
SGML type strutures, etc. Also note that it uses a GapContent
for underlying storage - which automatically grows at twice the required
speed, and never shrinks. So this extension goes to some pains to
remove text from the document before adding additional content,
to avoid growing the document uncontrollably.
|
Method Summary | |
public void | appendString(String s, AttributeSet a) Append a string to the display buffer.
If we are limiting the buffer size, trim the buffer as necessary
to keep under the limit, possibly including some of the addition
being added here. | public void | cleanUp() | public int | getBufferSize() Get the number of characters displayed. | public static void | main(String[] args) | public void | setBufferSize(int bufferSize) Set the number of characters displayed. |
bufferSize | int bufferSize(Code) | | |
minRemoveSize | int minRemoveSize(Code) | | |
ConsoleStyledDocument | public ConsoleStyledDocument()(Code) | | |
appendString | public void appendString(String s, AttributeSet a)(Code) | | Append a string to the display buffer.
If we are limiting the buffer size, trim the buffer as necessary
to keep under the limit, possibly including some of the addition
being added here. This is in part necessary because the underlying
storage, a GapContent , never shrinks in size --
and when it increases in size, it does so by double the necessary
amount (to maintain a gap).
Note that this means that notifications / etc may miss things
if we were unable to add the entire new String.
Parameters: s - string to append to the styled document Parameters: a - attribute set to use in the styled document |
cleanUp | public void cleanUp()(Code) | | When completely done with this document, get rid of all listeners,
and set the internal buffer variable to null
|
getBufferSize | public int getBufferSize()(Code) | | Get the number of characters displayed. A value of -1 means
display all characters (no limit).
|
setBufferSize | public void setBufferSize(int bufferSize)(Code) | | Set the number of characters displayed. A value of -1 means
display all characters (no limit). Values of 0 and other negative
numbers are ignored.
|
Fields inherited from javax.swing.text.DefaultStyledDocument | final public static int BUFFER_SIZE_DEFAULT(Code)(Java Doc) protected ElementBuffer buffer(Code)(Java Doc)
|
Methods inherited from javax.swing.text.DefaultStyledDocument | public void addDocumentListener(DocumentListener listener)(Code)(Java Doc) public Style addStyle(String nm, Style parent)(Code)(Java Doc) protected void create(ElementSpec[] data)(Code)(Java Doc) protected AbstractElement createDefaultRoot()(Code)(Java Doc) public Color getBackground(AttributeSet attr)(Code)(Java Doc) public Element getCharacterElement(int pos)(Code)(Java Doc) public Element getDefaultRootElement()(Code)(Java Doc) public Font getFont(AttributeSet attr)(Code)(Java Doc) public Color getForeground(AttributeSet attr)(Code)(Java Doc) public Style getLogicalStyle(int p)(Code)(Java Doc) public Element getParagraphElement(int pos)(Code)(Java Doc) public Style getStyle(String nm)(Code)(Java Doc) public Enumeration> getStyleNames()(Code)(Java Doc) protected void insert(int offset, ElementSpec[] data) throws BadLocationException(Code)(Java Doc) protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr)(Code)(Java Doc) public void removeDocumentListener(DocumentListener listener)(Code)(Java Doc) public void removeElement(Element elem)(Code)(Java Doc) public void removeStyle(String nm)(Code)(Java Doc) protected void removeUpdate(DefaultDocumentEvent chng)(Code)(Java Doc) public void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)(Code)(Java Doc) public void setLogicalStyle(int pos, Style s)(Code)(Java Doc) public void setParagraphAttributes(int offset, int length, AttributeSet s, boolean replace)(Code)(Java Doc) protected void styleChanged(Style style)(Code)(Java Doc)
|
|
|