public class FilterStyledDocument extends FilterDocument
StyledDocument
.
Useful if a subclass wants to modify the behaviour of a document.
Note that unlike FilterDocument
, no methods are faked here, since a real styled document is available.
original
StreamDescriptionProperty, TitleProperty
Constructor and Description |
---|
FilterStyledDocument(StyledDocument original)
Create new document instance.
|
Modifier and Type | Method and Description |
---|---|
Style |
addStyle(String nm,
Style parent) |
Color |
getBackground(AttributeSet attr) |
Element |
getCharacterElement(int pos) |
Font |
getFont(AttributeSet attr) |
Color |
getForeground(AttributeSet attr) |
Style |
getLogicalStyle(int p) |
Element |
getParagraphElement(int pos) |
Style |
getStyle(String nm) |
void |
removeStyle(String nm) |
void |
setCharacterAttributes(int offset,
int length,
AttributeSet s,
boolean replace) |
void |
setLogicalStyle(int pos,
Style s) |
void |
setParagraphAttributes(int offset,
int length,
AttributeSet s,
boolean replace) |
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render
public FilterStyledDocument(StyledDocument original)
original
- the delegated-to styled documentpublic Style addStyle(String nm, Style parent)
addStyle
in interface StyledDocument
addStyle
in class FilterDocument
public void removeStyle(String nm)
removeStyle
in interface StyledDocument
removeStyle
in class FilterDocument
public Style getStyle(String nm)
getStyle
in interface StyledDocument
getStyle
in class FilterDocument
public void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)
setCharacterAttributes
in interface StyledDocument
setCharacterAttributes
in class FilterDocument
public void setParagraphAttributes(int offset, int length, AttributeSet s, boolean replace)
setParagraphAttributes
in interface StyledDocument
setParagraphAttributes
in class FilterDocument
public void setLogicalStyle(int pos, Style s)
setLogicalStyle
in interface StyledDocument
setLogicalStyle
in class FilterDocument
public Style getLogicalStyle(int p)
getLogicalStyle
in interface StyledDocument
getLogicalStyle
in class FilterDocument
public Element getParagraphElement(int pos)
getParagraphElement
in interface StyledDocument
getParagraphElement
in class FilterDocument
public Element getCharacterElement(int pos)
getCharacterElement
in interface StyledDocument
getCharacterElement
in class FilterDocument
public Color getForeground(AttributeSet attr)
getForeground
in interface StyledDocument
getForeground
in class FilterDocument
public Color getBackground(AttributeSet attr)
getBackground
in interface StyledDocument
getBackground
in class FilterDocument
public Font getFont(AttributeSet attr)
getFont
in interface StyledDocument
getFont
in class FilterDocument