|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

, HTMLDocument

public interface StyledDocument

Interface for a generic styled document.
| Field Summary |
|---|
Fields inherited from interface javax.swing.text.Document ![]() |
|---|
StreamDescriptionProperty |
| Method Summary | |
|---|---|
Style |
addStyle
Adds a new style into the logical style hierarchy. |
Color |
getBackground
Takes a set of attributes and turn it into a background color specification. |
Element |
getCharacterElement
Gets the element that represents the character that is at the given offset within the document. |
Font |
getFont
Takes a set of attributes and turn it into a font specification. |
Color |
getForeground
Takes a set of attributes and turn it into a foreground color specification. |
Style |
getLogicalStyle
Gets a logical style for a given position in a paragraph. |
Element |
getParagraphElement
Gets the element that represents the paragraph that encloses the given offset within the document. |
Style |
getStyle
Fetches a named style previously added. |
void |
removeStyle
Removes a named style previously added to the document. |
void |
setCharacterAttributes
Changes the content element attributes used for the given range of existing content in the document. |
void |
setLogicalStyle
Sets the logical style to use for the paragraph at the given position. |
void |
setParagraphAttributes
Sets paragraph attributes. |
Methods inherited from interface javax.swing.text.Document ![]() |
|---|
addDocumentListener |
| Method Detail |
|---|

Style![]()
![]()
addStyle(String
![]()
![]()
nm, Style
![]()
![]()
parent)
nm - the name of the style (must be unique within the
collection of named styles). The name may be null if the style
is unnamed, but the caller is responsible
for managing the reference returned as an unnamed style can't
be fetched by name. An unnamed style may be useful for things
like character attribute overrides such as found in a style
run.parent - the parent style. This may be null if unspecified
attributes need not be resolved in some other style.

void removeStyle(String![]()
![]()
nm)
nm - the name of the style to remove

Style![]()
![]()
getStyle(String
![]()
![]()
nm)
nm - the name of the style

void setCharacterAttributes(int offset,
int length,
AttributeSet
s,
boolean replace)
offset - the start of the change >= 0length - the length of the change >= 0s - the non-null attributes to change to. Any attributes
defined will be applied to the text for the given range.replace - indicates whether or not the previous
attributes should be cleared before the new attributes
as set. If true, the operation will replace the
previous attributes entirely. If false, the new
attributes will be merged with the previous attributes.

void setParagraphAttributes(int offset,
int length,
AttributeSet
s,
boolean replace)
offset - the start of the change >= 0length - the length of the change >= 0s - the non-null attributes to change to. Any attributes
defined will be applied to the text for the given range.replace - indicates whether or not the previous
attributes should be cleared before the new attributes
are set. If true, the operation will replace the
previous attributes entirely. If false, the new
attributes will be merged with the previous attributes.

void setLogicalStyle(int pos,
Style
s)
pos - the starting position >= 0s - the style to set

Style![]()
![]()
getLogicalStyle(int p)
p - the position >= 0

Element![]()
![]()
getParagraphElement(int pos)
pos - the offset >= 0

Element![]()
![]()
getCharacterElement(int pos)
pos - the offset >= 0

Color![]()
![]()
getForeground(AttributeSet
![]()
![]()
attr)
attr - the set of attributes

Color![]()
![]()
getBackground(AttributeSet
![]()
![]()
attr)
attr - the set of attributes

Font![]()
![]()
getFont(AttributeSet
![]()
![]()
attr)
attr - the set of attributes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||