/** * 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 counter = highlights.size() - 1; counter >= 0; counter--) { HighlightInfo tag = highlights.elementAt(counter); 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); } } } }