|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.util.swing.HighlightManager
public class HighlightManager
This class has synchronized public methods because it is accessed outside of the event thread.
| Nested Class Summary | |
|---|---|
class |
HighlightManager.HighlightInfo
The public inner class defining a "smart" highlight, which can return the value of its start and end offsets for comparison with other highlights. |
| Field Summary | |
|---|---|
private JTextComponent |
_component
The component necessary for creating positions in in the document, which is also contained within this component. |
private Vector<Stack<HighlightManager.HighlightInfo>> |
_highlights
An unsorted Vector of Stack |
| Constructor Summary | |
|---|---|
HighlightManager(JTextComponent jtc)
Constructor |
|
| Method Summary | |
|---|---|
private Stack<HighlightManager.HighlightInfo> |
_getStackAt(HighlightManager.HighlightInfo h)
Returns the Stack corresponding to the given region in the document, or null in none exists. |
HighlightManager.HighlightInfo |
addHighlight(int startOffset,
int endOffset,
Highlighter.HighlightPainter p)
Adds a highlight using the supplied painter to the vector element(Stack) that exactly corresponds to the specified bounds. |
void |
removeHighlight(HighlightManager.HighlightInfo newLite)
Removes a given highlight (HighlightInfo) from the highlighter |
void |
removeHighlight(int startOffset,
int endOffset,
Highlighter.HighlightPainter p)
Removes a highlight with the specified start/end offsets and the given painter. |
int |
size()
Size of highlight stack; used only for unit testing |
String |
toString()
Overrides to toString() to support unit testing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Vector<Stack<HighlightManager.HighlightInfo>> _highlights
private JTextComponent _component
| Constructor Detail |
|---|
public HighlightManager(JTextComponent jtc)
jtc - the component whose document will have positions created therein.| Method Detail |
|---|
public String toString()
toString in class Objectpublic int size()
public HighlightManager.HighlightInfo addHighlight(int startOffset,
int endOffset,
Highlighter.HighlightPainter p)
startOffset - the offset at which the highlight is to begin.endOffset - the offset at which the highlight is to end.p - the Highlighter.HighlightPainter for painting
private Stack<HighlightManager.HighlightInfo> _getStackAt(HighlightManager.HighlightInfo h)
h - the descriptor for the desired region.
public void removeHighlight(int startOffset,
int endOffset,
Highlighter.HighlightPainter p)
startOffset - the offset at which the desired highlight should start.endOffset - the offset at which the desired highlight shoud end.p - the Highlighter.HighlightPainter for paintingpublic void removeHighlight(HighlightManager.HighlightInfo newLite)
newLite - the HighlightInfo object corresponding to the highlight needed to be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||