Methods Summary |
---|
public javax.swing.text.Style | addStyle(java.lang.String nm, javax.swing.text.Style parent)Adds a new style into the logical style hierarchy. Style attributes
resolve from bottom up so an attribute specified in a child
will override an attribute specified in the parent.
|
public java.awt.Color | getBackground(javax.swing.text.AttributeSet attr)Takes a set of attributes and turn it into a background color
specification. This might be used to specify things
like brighter, more hue, etc.
|
public javax.swing.text.Element | getCharacterElement(int pos)Gets the element that represents the character that
is at the given offset within the document.
|
public java.awt.Font | getFont(javax.swing.text.AttributeSet attr)Takes a set of attributes and turn it into a font
specification. This can be used to turn things like
family, style, size, etc into a font that is available
on the system the document is currently being used on.
|
public java.awt.Color | getForeground(javax.swing.text.AttributeSet attr)Takes a set of attributes and turn it into a foreground color
specification. This might be used to specify things
like brighter, more hue, etc.
|
public javax.swing.text.Style | getLogicalStyle(int p)Gets a logical style for a given position in a paragraph.
|
public javax.swing.text.Element | getParagraphElement(int pos)Gets the element that represents the paragraph that
encloses the given offset within the document.
|
public javax.swing.text.Style | getStyle(java.lang.String nm)Fetches a named style previously added.
|
public void | removeStyle(java.lang.String nm)Removes a named style previously added to the document.
|
public void | setCharacterAttributes(int offset, int length, javax.swing.text.AttributeSet s, boolean replace)Changes the content element attributes used for the given range of
existing content in the document. All of the attributes
defined in the given Attributes argument are applied to the
given range. This method can be used to completely remove
all content level attributes for the given range by
giving an Attributes argument that has no attributes defined
and setting replace to true.
|
public void | setLogicalStyle(int pos, javax.swing.text.Style s)Sets the logical style to use for the paragraph at the
given position. If attributes aren't explicitly set
for character and paragraph attributes they will resolve
through the logical style assigned to the paragraph, which
in turn may resolve through some hierarchy completely
independent of the element hierarchy in the document.
|
public void | setParagraphAttributes(int offset, int length, javax.swing.text.AttributeSet s, boolean replace)Sets paragraph attributes.
|