/** * Sets the EOL marker color. * @param eolMarkerColor The EOL marker color */ public final void setEOLMarkerColor(Color eolMarkerColor) { this.eolMarkerColor = eolMarkerColor; repaint(); }
/** * Sets if EOL markers are to be drawn. * @param eolMarkers True if EOL markers should be drawn, false otherwise */ public final void setEOLMarkersPainted(boolean eolMarkers) { this.eolMarkers = eolMarkers; repaint(); }
/** * Sets the syntax styles used to paint colorized text. Entry <i>n</i> * will be used to paint tokens with id = <i>n</i>. * @param styles The syntax styles * @see Token */ public final void setStyles(SyntaxStyle[] styles) { this.styles = styles; repaint(); }
/** * A fast way of changing both the first line and horizontal * offset. * @param firstLine The new first line * @param horizontalOffset The new horizontal offset * @return True if any of the values were changed, false otherwise */ public boolean setOrigin(int firstLine, int horizontalOffset) { boolean changed = false; if(horizontalOffset != this.horizontalOffset) { this.horizontalOffset = horizontalOffset; changed = true; } if(firstLine != this.firstLine) { this.firstLine = firstLine; changed = true; } if(changed) { updateScrollBars(); painter.repaint(); } return changed; }
/** * Sets the line displayed at the text area's origin without * updating the scroll bars. */ public void setFirstLine(int firstLine) { if(firstLine == this.firstLine) return; this.firstLine = firstLine; if(firstLine != vertical.getValue()) updateScrollBars(); painter.repaint(); }
/** * Sets the horizontal offset of drawn lines. This can be used to * implement horizontal scrolling. * @param horizontalOffset offset The new horizontal offset */ public void setHorizontalOffset(int horizontalOffset) { if(horizontalOffset == this.horizontalOffset) return; this.horizontalOffset = horizontalOffset; if(horizontalOffset != horizontal.getValue()) updateScrollBars(); painter.repaint(); }
/** * Marks a line as needing a repaint. * @param line The line to invalidate */ public final void invalidateLine(int line) { repaint(0,textArea.lineToY(line) + fm.getMaxDescent() + fm.getLeading(), getWidth(),fm.getHeight()); }
/** * Marks a range of lines as needing a repaint. * @param firstLine The first line to invalidate * @param lastLine The last line to invalidate */ public final void invalidateLineRange(int firstLine, int lastLine) { repaint(0,textArea.lineToY(firstLine) + fm.getMaxDescent() + fm.getLeading(), getWidth(),(lastLine - firstLine + 1) * fm.getHeight()); }
/** * Sets the document this text area is editing. * @param document The document */ public void setDocument(SyntaxDocument document) { if(this.document == document) return; if(this.document != null) this.document.removeDocumentListener(documentHandler); this.document = document; document.addDocumentListener(documentHandler); select(0,0); updateScrollBars(); painter.repaint(); }
repaint(0,h,getWidth(),getHeight() - h);