javax.swing.plaf.basic
Class BasicHTML.BasicDocument

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.DefaultStyledDocument
          extended byjavax.swing.text.html.HTMLDocument
              extended byjavax.swing.plaf.basic.BasicHTML.BasicDocument
All Implemented Interfaces:
Document, Serializable, StyledDocument
Enclosing class:
BasicHTML

static class BasicHTML.BasicDocument
extends HTMLDocument

The subclass of HTMLDocument that is used as the model. getForeground is overridden to return the foreground property from the Component this was created for.


Nested Class Summary
 
Nested classes inherited from class javax.swing.text.html.HTMLDocument
HTMLDocument.BlockElement, HTMLDocument.HTMLReader, HTMLDocument.Iterator, HTMLDocument.RunElement
 
Nested classes inherited from class javax.swing.text.DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElement
 
Nested classes inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
 
Field Summary
 
Fields inherited from class javax.swing.text.html.HTMLDocument
AdditionalComments
 
Fields inherited from class javax.swing.text.DefaultStyledDocument
buffer, BUFFER_SIZE_DEFAULT
 
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
(package private) BasicHTML.BasicDocument(StyleSheet s, Font defaultFont, Color foreground)
          The host, that is where we are rendering.
 
Method Summary
private  void setFontAndColor(Font font, Color fg)
          Sets the default font and default color.
 
Methods inherited from class javax.swing.text.html.HTMLDocument
create, createBranchElement, createDefaultRoot, createLeafElement, fireChangedUpdate, fireUndoableEditUpdate, getBase, getElement, getElement, getIterator, getParser, getPreservesUnknownTags, getReader, getReader, getStyleSheet, getTokenThreshold, insert, insertAfterEnd, insertAfterStart, insertBeforeEnd, insertBeforeStart, insertUpdate, processHTMLFrameHyperlinkEvent, setBase, setInnerHTML, setOuterHTML, setParagraphAttributes, setParser, setPreservesUnknownTags, setTokenThreshold
 
Methods inherited from class javax.swing.text.DefaultStyledDocument
addDocumentListener, addStyle, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, removeDocumentListener, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, styleChanged
 
Methods inherited from class javax.swing.text.AbstractDocument
addUndoableEditListener, createPosition, dump, fireInsertUpdate, fireRemoveUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, insertString, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.text.Document
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeUndoableEditListener, render
 

Constructor Detail

BasicHTML.BasicDocument

BasicHTML.BasicDocument(StyleSheet s,
                        Font defaultFont,
                        Color foreground)
The host, that is where we are rendering.

Method Detail

setFontAndColor

private void setFontAndColor(Font font,
                             Color fg)
Sets the default font and default color. These are set by adding a rule for the body that specifies the font and color. This allows the html to override these should it wish to have a custom font or color.