|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.editor.underline.UnderlineLayer
An UnderlineLayer
is a container for underlines added
to an editor pane. Underlines are used to draw the user's
attention to a region of text - this can be either an entire line,
or short runs of text. These underlines are created in different
contains, or layers, so that different modules can maintain and
manipulate their underlines in separate layers without affecting
each other.
An underline consists of 2 pieces - an underline style (enabled, priority level, color, underline shape), and a line number or n offset range.
There are two types of underlines, line or text. A "line" type is used as a separator to separate portions of the editor, and span across an entire line. They are drawn below the specified line. A "text" type is used to "mark" a run of text to draw the user's attention to it, and is specified using a start offset (inclusive) and an end offset (exclusive.)
Note that "text" type underlines are always higher priority than "line" type underlines. When rendering a given region or line of text, the highest priority "line" type and highest priority "text" types are chosen. The "line" type underline is drawn first, followed by the "text" type on top.
Constructor Summary | |
UnderlineLayer(BasicEditorPane editor)
Constructs a new underline layer associated with the given editor. |
Method Summary | |
UnderlinedLine |
addUnderlinedLine(UnderlineStyle style,
int line)
Adds an underline across the entire line using the specified style and offsets. |
UnderlinedText |
addUnderlinedText(UnderlineStyle style,
int startOffset,
int endOffset)
Adds an underline to a run of text using the specified style and offsets. |
void |
changeUnderline(UnderlinedLine underlinedLine,
UnderlineStyle style,
int line)
Moves the underlined line of text to a new location, and changes the underline style used. |
void |
changeUnderline(UnderlinedText underlinedText,
UnderlineStyle style,
int startOffset,
int endOffset)
Moves the underlined run of text to a new location, and changes the underline style used. |
void |
removeAllUnderlines()
Removes all underlines in this layer from the associated editor pane. |
void |
removeUnderline(UnderlinedLine underlinedLine)
Removes the given underline from the editor. |
void |
removeUnderline(UnderlinedText underlinedText)
Removes the given underline from the editor. |
void |
renderUnderlinedLines(UnderlinedFragmentsList fragmentsList,
int startLine,
int endLine)
This routine is used by the editor view to obtain the underlines in this underline layer for only line underlines in the given line range. |
void |
renderUnderlinedText(UnderlinedFragmentsList fragmentsList,
int startOffset,
int endOffset)
This routine is used by the editor view to obtain the underlines in this underline layer for only text underlines in the given offset range. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UnderlineLayer(BasicEditorPane editor)
Method Detail |
public UnderlinedText addUnderlinedText(UnderlineStyle style, int startOffset, int endOffset)
style
- the underline style to usestartOffset
- the start of the run of textendOffset
- the end of the run of textpublic UnderlinedLine addUnderlinedLine(UnderlineStyle style, int line)
style
- the underline style to useline
- the (0-based) line to underlinepublic void removeUnderline(UnderlinedText underlinedText)
underlinedText
- the underlined segment to removepublic void removeUnderline(UnderlinedLine underlinedLine)
underlinedLine
- the underlined line to removepublic void removeAllUnderlines()
public void changeUnderline(UnderlinedText underlinedText, UnderlineStyle style, int startOffset, int endOffset)
underlinedText
- the underline that was previously createdstyle
- the new underline style (can be same as old)startOffset
- the new start offsetendOffset
- the new end offsetpublic void changeUnderline(UnderlinedLine underlinedLine, UnderlineStyle style, int line)
underlinedLine
- the underline that was previously createdstyle
- the new underline style (can be same as old)line
- the new (0-based) linepublic void renderUnderlinedText(UnderlinedFragmentsList fragmentsList, int startOffset, int endOffset)
fragmentsList
- the list to add the fragments tostartOffset
- the start of the painting area (inclusive)endOffset
- the end of the painting area (exclusive)public void renderUnderlinedLines(UnderlinedFragmentsList fragmentsList, int startLine, int endLine)
fragmentsList
- the list to add the fragments tostartLine
- the 0-based starting line (inclusive)endLine
- the 0-based ending line (exclusive)
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.