/** * Removes all line highlights. * * @see #removeLineHighlight(Object) */ public void removeAllLineHighlights() { if (lineHighlights!=null) { lineHighlights.clear(); textArea.repaint(); } }
/** * Removes all of the highlights for a specific parser. * * @param parser The parser. */ public void clearParserHighlights(Parser parser) { Iterator<SyntaxLayeredHighlightInfoImpl> i = parserHighlights.iterator(); while (i.hasNext()) { SyntaxLayeredHighlightInfoImpl info = i.next(); if (info.notice.getParser()==parser) { if (info.width > 0 && info.height > 0) { textArea.repaint(info.x, info.y, info.width, info.height); } i.remove(); } } }
/** * Clears any "mark all" highlights, if any. * * @see #markAll(List) * @see #getMarkAllHighlightColor() * @see #setMarkAllHighlightColor(Color) */ void clearMarkAllHighlights() { ((RTextAreaHighlighter)getHighlighter()).clearMarkAllHighlights(); //markedWord = null; repaint(); }
@Override public void mouseClicked(MouseEvent e) { Point p = e.getPoint(); int line = rowAtPoint(p); RSyntaxTextArea rsta = (RSyntaxTextArea)textArea; FoldManager fm = rsta.getFoldManager(); Fold fold = fm.getFoldForLine(line); if (fold!=null) { fold.toggleCollapsedState(); getGutter().repaint(); textArea.repaint(); } }
protected void repaintListHighlight(HighlightInfo info) { // Note: We're relying on implementation here, not interface. Yuck... if (info instanceof LayeredHighlightInfoImpl) { LayeredHighlightInfoImpl lhi = (LayeredHighlightInfoImpl)info; if (lhi.width > 0 && lhi.height > 0) { textArea.repaint(lhi.x, lhi.y, lhi.width, lhi.height); } } else { TextUI ui = textArea.getUI(); ui.damageRange(textArea, info.getStartOffset(),info.getEndOffset()); //safeDamageRange(info.p0, info.p1); } }
/** * Sets the color used for "mark all." This fires a property change of * type {@link #MARK_ALL_COLOR_PROPERTY}. * * @param color The color to use for "mark all." * @see #getMarkAllHighlightColor() */ public void setMarkAllHighlightColor(Color color) { Color old = (Color)markAllHighlightPainter.getPaint(); if (old!=null && !old.equals(color)) { markAllHighlightPainter.setPaint(color); RTextAreaHighlighter h = (RTextAreaHighlighter)getHighlighter(); if (h.getMarkAllHighlightCount()>0) { repaint(); // Repaint if words are highlighted. } firePropertyChange(MARK_ALL_COLOR_PROPERTY, old, color); } }
/** * Repaints the line pointed to by the specified highlight information. * * @param lhi The highlight information. */ private void repaintLine(LineHighlightInfo lhi) { int offs = lhi.getOffset(); // May be > length if they deleted text including the highlight if (offs>=0 && offs<=textArea.getDocument().getLength()) { try { int y = textArea.yForLineContaining(offs); if (y>-1) { textArea.repaint(0, y, textArea.getWidth(), textArea.getLineHeight()); } } catch (BadLocationException ble) { ble.printStackTrace(); // Never happens } } }
repaint(); firePropertyChange(MARK_ALL_OCCURRENCES_CHANGED_PROPERTY, null, ranges);
/** * Removes all line highlights. * * @see #removeLineHighlight(Object) */ public void removeAllLineHighlights() { if (lineHighlights!=null) { lineHighlights.clear(); textArea.repaint(); } }
/** * Removes all line highlights. * * @see #removeLineHighlight(Object) */ public void removeAllLineHighlights() { if (lineHighlights!=null) { lineHighlights.clear(); textArea.repaint(); } }
/** * Removes all line highlights. * * @see #removeLineHighlight(Object) */ public void removeAllLineHighlights() { if (lineHighlights!=null) { lineHighlights.clear(); textArea.repaint(); } }
/** * Clears any "mark all" highlights, if any. * * @see #markAll * @see #getMarkAllHighlightColor * @see #setMarkAllHighlightColor */ public void clearMarkAllHighlights() { Highlighter h = getHighlighter(); if (h!=null && markAllHighlights!=null) { int count = markAllHighlights.size(); for (int i=0; i<count; i++) h.removeHighlight(markAllHighlights.get(i)); markAllHighlights.clear(); } markedWord = null; repaint(); }
/** * Clears any "mark all" highlights, if any. * * @see #markAll * @see #getMarkAllHighlightColor * @see #setMarkAllHighlightColor */ public void clearMarkAllHighlights() { Highlighter h = getHighlighter(); if (h!=null && markAllHighlights!=null) { int count = markAllHighlights.size(); for (int i=0; i<count; i++) h.removeHighlight(markAllHighlights.get(i)); markAllHighlights.clear(); } markedWord = null; repaint(); }
/** * Clears any "mark all" highlights, if any. * * @see #markAll(List) * @see #getMarkAllHighlightColor() * @see #setMarkAllHighlightColor(Color) */ void clearMarkAllHighlights() { ((RTextAreaHighlighter)getHighlighter()).clearMarkAllHighlights(); //markedWord = null; repaint(); }
/** * Sets the color used for "mark all." This fires a property change of * type {@link #MARK_ALL_COLOR_PROPERTY}. * * @param color The color to use for "mark all." * @see #getMarkAllHighlightColor() */ public void setMarkAllHighlightColor(Color color) { Color old = (Color)markAllHighlightPainter.getPaint(); if (old!=null && !old.equals(color)) { markAllHighlightPainter.setPaint(color); if (markedWord!=null) repaint(); // Repaint if words are highlighted. firePropertyChange(MARK_ALL_COLOR_PROPERTY, old, color); } }
/** * Sets the color used for "mark all." This fires a property change of * type {@link #MARK_ALL_COLOR_PROPERTY}. * * @param color The color to use for "mark all." * @see #getMarkAllHighlightColor() */ public void setMarkAllHighlightColor(Color color) { Color old = (Color)markAllHighlightPainter.getPaint(); if (old!=null && !old.equals(color)) { markAllHighlightPainter.setPaint(color); if (markedWord!=null) repaint(); // Repaint if words are highlighted. firePropertyChange(MARK_ALL_COLOR_PROPERTY, old, color); } }
private void removeListHighlight(List list, Object tag) { if (tag instanceof LayeredHighlightInfo) { LayeredHighlightInfo lhi = (LayeredHighlightInfo)tag; if (lhi.width > 0 && lhi.height > 0) { textArea.repaint(lhi.x, lhi.y, lhi.width, lhi.height); } } else { HighlightInfo info = (HighlightInfo) tag; TextUI ui = textArea.getUI(); ui.damageRange(textArea, info.getStartOffset(),info.getEndOffset()); //safeDamageRange(info.p0, info.p1); } list.remove(tag); }
@Override public void mouseClicked(MouseEvent e) { Point p = e.getPoint(); int line = rowAtPoint(p); RSyntaxTextArea rsta = (RSyntaxTextArea)textArea; FoldManager fm = rsta.getFoldManager(); Fold fold = fm.getFoldForLine(line); if (fold!=null) { fold.toggleCollapsedState(); getGutter().repaint(); textArea.repaint(); } }
protected void repaintListHighlight(HighlightInfo info) { // Note: We're relying on implementation here, not interface. Yuck... if (info instanceof LayeredHighlightInfoImpl) { LayeredHighlightInfoImpl lhi = (LayeredHighlightInfoImpl)info; if (lhi.width > 0 && lhi.height > 0) { textArea.repaint(lhi.x, lhi.y, lhi.width, lhi.height); } } else { TextUI ui = textArea.getUI(); ui.damageRange(textArea, info.getStartOffset(),info.getEndOffset()); //safeDamageRange(info.p0, info.p1); } }
/** * Repaints the line pointed to by the specified highlight information. * * @param lhi The highlight information. */ private void repaintLine(LineHighlightInfo lhi) { int offs = lhi.getOffset(); // May be > length if they deleted text including the highlight if (offs>=0 && offs<=textArea.getDocument().getLength()) { try { int y = textArea.yForLineContaining(offs); if (y>-1) { textArea.repaint(0, y, textArea.getWidth(), textArea.getLineHeight()); } } catch (BadLocationException ble) { ble.printStackTrace(); // Never happens } } }