/** * 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. * * @param g Graphics used to draw * @param p0 starting offset of view * @param p1 ending offset of view * @param viewBounds Bounds of View * @param editor JTextComponent * @param view View instance being rendered */ public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) { for (int i=markedOccurrences.size()-1; i>=0; i--) { Object tag = markedOccurrences.get(i); if (tag instanceof LayeredHighlightInfo) { LayeredHighlightInfo lhi = (LayeredHighlightInfo)tag; int start = lhi.getStartOffset(); int end = lhi.getEndOffset(); if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) { lhi.paintLayeredHighlights(g, p0, p1, viewBounds, editor, view); } } } super.paintLayeredHighlights(g, p0, p1, viewBounds, editor, view); }
/** * Renders the highlights. * * @param g the graphics context */ public void paint(Graphics g) { int len = markedOccurrences.size(); for (int i = 0; i < len; i++) { HighlightInfo info = (HighlightInfo) markedOccurrences.get(i); if (!(info instanceof LayeredHighlightInfo)) { // Avoid allocating unless we need it. Rectangle a = textArea.getBounds(); Insets insets = textArea.getInsets(); a.x = insets.left; a.y = insets.top; a.width -= insets.left + insets.right; a.height -= insets.top + insets.bottom; for (; i < len; i++) { info = (HighlightInfo)markedOccurrences.get(i); if (!(info instanceof LayeredHighlightInfo)) { Highlighter.HighlightPainter p = info.getPainter(); p.paint(g, info.getStartOffset(), info.getEndOffset(), a, textArea); } } } } super.paint(g); }
/** * 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. * * @param g Graphics used to draw * @param p0 starting offset of view * @param p1 ending offset of view * @param viewBounds Bounds of View * @param editor JTextComponent * @param view View instance being rendered */ public void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view) { paintListLayered(g, p0,p1, viewBounds, editor, view, markedOccurrences); super.paintLayeredHighlights(g, p0, p1, viewBounds, editor, view); paintListLayered(g, p0,p1, viewBounds, editor, view, parserHighlights); }
/** * 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. * * @param g Graphics used to draw * @param lineStart starting offset of view * @param lineEnd ending offset of view * @param viewBounds Bounds of View * @param editor JTextComponent * @param view View instance being rendered */ @Override public void paintLayeredHighlights(Graphics g, int lineStart, int lineEnd, Shape viewBounds, JTextComponent editor, View view) { paintListLayered(g, lineStart,lineEnd, viewBounds, editor, view, markAllHighlights); super.paintLayeredHighlights(g, lineStart, lineEnd, viewBounds, editor, view); }
/** * {@inheritDoc} */ public void install(JTextComponent c) { super.install(c); this.textArea = (RTextArea)c; }
/** * Renders the highlights. * * @param g the graphics context */ public void paint(Graphics g) { paintList(g, markedOccurrences); super.paint(g); paintList(g, parserHighlights); }
/** * {@inheritDoc} */ public void install(JTextComponent c) { super.install(c); this.textArea = (RTextArea)c; }
/** * {@inheritDoc} */ @Override public void install(JTextComponent c) { super.install(c); this.textArea = (RTextArea)c; }
/** * 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. * * @param g Graphics used to draw * @param lineStart starting offset of view * @param lineEnd ending offset of view * @param viewBounds Bounds of View * @param editor JTextComponent * @param view View instance being rendered */ @Override public void paintLayeredHighlights(Graphics g, int lineStart, int lineEnd, Shape viewBounds, JTextComponent editor, View view) { paintListLayered(g, lineStart,lineEnd, viewBounds, editor, view, markAllHighlights); super.paintLayeredHighlights(g, lineStart, lineEnd, viewBounds, editor, view); }
/** * {@inheritDoc} */ @Override public void install(JTextComponent c) { super.install(c); this.textArea = (RTextArea)c; }