| java.lang.Object javax.swing.text.LayeredHighlighter javax.swing.text.DefaultHighlighter edu.rice.cs.drjava.ui.ReverseHighlighter
ReverseHighlighter | public class ReverseHighlighter extends DefaultHighlighter (Code) | | Implements the Highlighter interfaces. Implements a simple highlight painter, but stores
the highlights in reverse order. That means that the selection (for copying) is always
the foremost hightlight, and after that, the highlights are drawn from most recent
to oldest.
Based on DefaultHighlighter by Timothy Prinzing, version 1.39 12/19/03
Unfortunately, as the vector of highlights in DefaultHighlighter was private, there was
no efficient way to make use of inheritance.
|
Inner Class :public static class DrJavaHighlightPainter extends DefaultHighlightPainter | |
Inner Class :class LayeredHighlightInfo extends HighlightInfo | |
Inner Class :class SafeDamager implements Runnable | |
Method Summary | |
public Object | addHighlight(int p0, int p1, Highlighter.HighlightPainter p) Adds a highlight to the view. | public void | changeHighlight(Object tag, int p0, int p1) Changes a highlight. | public void | deinstall(JTextComponent c) Called when the UI is being removed from the interface of a JTextComponent. | public boolean | getDrawsLayeredHighlights() | public Highlighter.Highlight[] | getHighlights() Makes a copy of the highlights. | public void | install(JTextComponent c) Called when the UI is being installed into the interface of a JTextComponent. | public void | paint(Graphics g) Renders the highlights. | public void | paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) When leaf Views (such as LabelView) are rendering they should
call into this method. | public void | removeAllHighlights() Removes all highlights. | public void | removeHighlight(Object tag) Removes a highlight from the view. | public void | setDrawsLayeredHighlights(boolean newValue) If true, highlights are drawn as the Views draw the text. |
ReverseHighlighter | public ReverseHighlighter()(Code) | | Creates a new ReverseHighlighter object.
|
addHighlight | public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter p) throws BadLocationException(Code) | | Adds a highlight to the view. Returns a tag that can be used to refer to the highlight.
Parameters: p0 - the start offset of the range to highlight >= 0 Parameters: p1 - the end offset of the range to highlight >= p0 Parameters: p - the painter to use to actually render the highlight an object that can be used as a tag to refer to the highlight exception: BadLocationException - if the specified location is invalid |
changeHighlight | public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException(Code) | | Changes a highlight.
Parameters: tag - the highlight tag Parameters: p0 - the beginning of the range >= 0 Parameters: p1 - the end of the range >= p0 exception: BadLocationException - if the specified location is invalid |
getDrawsLayeredHighlights | public boolean getDrawsLayeredHighlights()(Code) | | |
install | public void install(JTextComponent c)(Code) | | Called when the UI is being installed into the interface of a JTextComponent. Installs the editor, and
removes any existing highlights.
Parameters: c - the editor component See Also: Highlighter.install |
paint | public void paint(Graphics g)(Code) | | Renders the highlights.
Parameters: g - the graphics context |
paintLayeredHighlights | public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view)(Code) | | When leaf Views (such as LabelView) are rendering they should
call into this method. If a highlight is in the given region it will
be drawn immediately.
Parameters: g - Graphics used to draw Parameters: p0 - starting offset of view Parameters: p1 - ending offset of view Parameters: viewBounds - Bounds of View Parameters: editor - JTextComponent Parameters: view - View instance being rendered |
removeAllHighlights | public void removeAllHighlights()(Code) | | Removes all highlights.
|
removeHighlight | public void removeHighlight(Object tag)(Code) | | Removes a highlight from the view.
Parameters: tag - the reference to the highlight |
setDrawsLayeredHighlights | public void setDrawsLayeredHighlights(boolean newValue)(Code) | | If true, highlights are drawn as the Views draw the text. That is
the Views will call into paintLayeredHighlight which
will result in a rectangle being drawn before the text is drawn
(if the offsets are in a highlighted region that is). For this to
work the painter supplied must be an instance of
LayeredHighlightPainter.
|
|
|