Highlighter
| Modifier and Type | Class and Description |
|---|---|
| public static class | DefaultHighlighter.
Simple highlight painter that fills a highlighted area with a solid color. |
| pack-priv static class | |
| pack-priv static class | DefaultHighlighter.
LayeredHighlightPainter is used when a drawsLayeredHighlights is true. |
| pack-priv class | DefaultHighlighter.
This class invokes |
| Modifier and Type | Field and Description |
|---|---|
| private JTextComponent | |
| public static final LayeredHighlighter. | DefaultPainter
Default implementation of LayeredHighlighter.LayerPainter that can be used for painting highlights. |
| private boolean | |
| private Vector | |
| private static final Highlighter. | |
| private DefaultHighlighter. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: an object that can be used as a tag to refer to the highlightthe start offset of the range to highlight >= 0 p0, int the end offset of the range to highlight >= p0 p1, Highlighter.the painter to use to actually render the highlight pImplements javax. Adds a highlight to the view. |
| public void | changeHighlight(Object
the highlight tag tag, int the beginning of the range >= 0 p0, int the end of the range >= p0 p1)Implements javax. Changes a highlight. |
| public void | deinstall(JTextComponent
the component c)Implements javax. Called when the UI is being removed from the interface of a JTextComponent. |
| public boolean | |
| public Highlighter. | Returns: the copyImplements javax. Makes a copy of the highlights. |
| public void | install(JTextComponent
the editor component c)Implements javax. Called when the UI is being installed into the interface of a JTextComponent. |
| public void | paint(Graphics
the graphics context g)Implements javax. Renders the highlights. |
| public void | paintLayeredHighlights(Graphics
Graphics used to draw g, int starting offset of view p0, int ending offset of view p1, Shape Bounds of View viewBounds, JTextComponent JTextComponent editor, View View instance being rendered view)Implements abstract javax. When leaf Views (such as LabelView) are rendering they should call into this method. |
| public void | removeAllHighlights()
Implements javax. Removes all highlights. |
| public void | removeHighlight(Object
the reference to the highlight tag)Implements javax. Removes a highlight from the view. |
| private void | safeDamageRange(final Position p0, final Position p1)
Queues damageRange() call into event dispatch thread to be sure that views are in consistent state. |
| private void | safeDamageRange(int a0, int a1)
Queues damageRange() call into event dispatch thread to be sure that views are in consistent state. |
| public void | setDrawsLayeredHighlights(boolean
the new value newValue)If true, highlights are drawn as the Views draw the text. |
| component | back to summary |
|---|---|
| private JTextComponent component | |
| DefaultPainter | back to summary |
|---|---|
| public static final LayeredHighlighter. Default implementation of LayeredHighlighter.LayerPainter that can be used for painting highlights. As of 1.4 this field is final. | |
| drawsLayeredHighlights | back to summary |
|---|---|
| private boolean drawsLayeredHighlights | |
| highlights | back to summary |
|---|---|
| private Vector<DefaultHighlighter. | |
| noHighlights | back to summary |
|---|---|
| private static final Highlighter. | |
| safeDamager | back to summary |
|---|---|
| private DefaultHighlighter. | |
| DefaultHighlighter | back to summary |
|---|---|
| public DefaultHighlighter() Creates a new DefaultHighlighter object. | |
| addHighlight | back to summary |
|---|---|
| public Object addHighlight(int p0, int p1, Highlighter. Implements javax. Adds a highlight to the view. Returns a tag that can be used to refer to the highlight.
| |
| changeHighlight | back to summary |
|---|---|
| public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException Implements javax. Changes a highlight.
| |
| deinstall | back to summary |
|---|---|
| public void deinstall(JTextComponent c) Implements javax. Called when the UI is being removed from the interface of a JTextComponent.
| |
| getDrawsLayeredHighlights | back to summary |
|---|---|
| public boolean getDrawsLayeredHighlights() Return the draw layered highlights.
| |
| getHighlights | back to summary |
|---|---|
| public Highlighter. Implements javax. Makes a copy of the highlights. Does not actually clone each highlight, but only makes references to them.
| |
| install | back to summary |
|---|---|
| public void install(JTextComponent c) Implements javax. Called when the UI is being installed into the interface of a JTextComponent. Installs the editor, and removes any existing highlights.
| |
| paint | back to summary |
|---|---|
| public void paint(Graphics g) Implements javax. Renders the highlights.
| |
| paintLayeredHighlights | back to summary |
|---|---|
| public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) Implements abstract javax. 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.
| |
| removeAllHighlights | back to summary |
|---|---|
| public void removeAllHighlights() Implements javax. Removes all highlights. | |
| removeHighlight | back to summary |
|---|---|
| public void removeHighlight(Object tag) Implements javax. Removes a highlight from the view.
| |
| safeDamageRange | back to summary |
|---|---|
| private void safeDamageRange(final Position p0, final Position p1) Queues damageRange() call into event dispatch thread to be sure that views are in consistent state. | |
| safeDamageRange | back to summary |
|---|---|
| private void safeDamageRange(int a0, int a1) throws BadLocationException Queues damageRange() call into event dispatch thread to be sure that views are in consistent state. | |
| setDrawsLayeredHighlights | back to summary |
|---|---|
| public void setDrawsLayeredHighlights(boolean newValue) If true, highlights are drawn as the Views draw the text. That is
the Views will call into
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Color | |
| public void | paint(Graphics
the graphics context g, int the starting model offset >= 0 offs0, int the ending model offset >= offs1 offs1, Shape the bounding box for the highlight bounds, JTextComponent the editor c)Implements javax. Paints a highlight. |
| public Shape | Returns: region drawing occurred inthe graphics context g, int the starting model offset >= 0 offs0, int the ending model offset >= offs1 offs1, Shape the bounding box of the view, which is not
necessarily the region to paint. bounds, JTextComponent the editor c, View View painting for view)Implements abstract javax. Paints a portion of a highlight. |
| color | back to summary |
|---|---|
| private Color color | |
| DefaultHighlightPainter | back to summary |
|---|---|
| public DefaultHighlightPainter(Color c) Constructs a new highlight painter. If
| |
| getColor | back to summary |
|---|---|
| public Color getColor() Returns the color of the highlight.
| |
| paint | back to summary |
|---|---|
| public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) Implements javax. Paints a highlight.
| |
| paintLayer | back to summary |
|---|---|
| public Shape paintLayer(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c, View view) Implements abstract javax. Paints a portion of a highlight.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Position | |
| pack-priv Position | |
| pack-priv Highlighter. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | getEndOffset()
Implements javax. Gets the ending model offset for the highlight. |
| public Highlighter. | getPainter()
Implements javax. Gets the painter for the highlighter. |
| public int | getStartOffset()
Implements javax. Gets the starting model offset for the highlight. |
| p0 | back to summary |
|---|---|
| pack-priv Position p0 | |
| p1 | back to summary |
|---|---|
| pack-priv Position p1 | |
| painter | back to summary |
|---|---|
| pack-priv Highlighter. | |
| HighlightInfo | back to summary |
|---|---|
| pack-priv HighlightInfo() | |
| getEndOffset | back to summary |
|---|---|
| public int getEndOffset() Implements javax. Doc from javax. Gets the ending model offset for the highlight. | |
| getPainter | back to summary |
|---|---|
| public Highlighter. Implements javax. Doc from javax. Gets the painter for the highlighter. | |
| getStartOffset | back to summary |
|---|---|
| public int getStartOffset() Implements javax. Doc from javax. Gets the starting model offset for the highlight. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view)
Restricts the region based on the receivers offsets and messages the painter to paint the region. |
| pack-priv void |
| height | back to summary |
|---|---|
| pack-priv int height | |
| width | back to summary |
|---|---|
| pack-priv int width | |
| x | back to summary |
|---|---|
| pack-priv int x | |
| y | back to summary |
|---|---|
| pack-priv int y | |
| LayeredHighlightInfo | back to summary |
|---|---|
| pack-priv LayeredHighlightInfo() | |
| paintLayeredHighlights | back to summary |
|---|---|
| pack-priv void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) Restricts the region based on the receivers offsets and messages the painter to paint the region. | |
| union | back to summary |
|---|---|
| pack-priv void union(Shape bounds) | |
mapper.damageRange in
EventDispatchThread. The only one instance per Highlighter
is created. When a number of ranges should be damaged
it collects them into queue and damages
them in consecutive order in run
call.
| Modifier and Type | Field and Description |
|---|---|
| private Document | |
| private Vector | |
| private Vector |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| public synchronized void |
| lastDoc | back to summary |
|---|---|
| private Document lastDoc | |
| p0 | back to summary |
|---|---|
| private Vector<Position> p0 | |
| p1 | back to summary |
|---|---|
| private Vector<Position> p1 | |
| SafeDamager | back to summary |
|---|---|
| pack-priv SafeDamager() | |
| damageRange | back to summary |
|---|---|
| public synchronized void damageRange(Position pos0, Position pos1) Adds the range to be damaged into the range queue. If the range queue is empty (the first call or run() was already invoked) then adds this class instance into EventDispatch queue. The method also tracks if the current document changed or component is null. In this case it removes all ranges added before from range queue. | |
| run | back to summary |
|---|---|
| public synchronized void run() Implements java. Executes range(s) damage and cleans range queue. | |