/** * Repaints a single line in this list. * * @param line The line to repaint. */ private void repaintLine(int line) { int y = textArea.getInsets().top; y += line*cellHeight; repaint(0,y, cellWidth,cellHeight); }
/** * Gets the allocation to give the root View. Due * to an unfortunate set of historical events this * method is inappropriately named. The Rectangle * returned has nothing to do with visibility. * The component must have a non-zero positive size for * this translation to be computed. * * @return the bounding box for the root view */ @Override protected Rectangle getVisibleEditorRect() { Rectangle alloc = textArea.getBounds(); if ((alloc.width > 0) && (alloc.height > 0)) { alloc.x = alloc.y = 0; Insets insets = textArea.getInsets(); alloc.x += insets.left; alloc.y += insets.top; alloc.width -= insets.left + insets.right; alloc.height -= insets.top + insets.bottom; return alloc; } return null; }
/** * Draws the "margin line" if enabled. * * @param g The graphics context to paint with. * @param visibleRect The visible rectangle of this text area. */ protected void paintMarginLine(Graphics g, Rectangle visibleRect) { if (textArea.isMarginLineEnabled()) { g.setColor(textArea.getMarginLineColor()); Insets insets = textArea.getInsets(); int marginLineX = textArea.getMarginLinePixelLocation() + (insets==null ? 0 : insets.left); g.drawLine(marginLineX,visibleRect.y, marginLineX,visibleRect.y+visibleRect.height); } }
textAreaInsets = textArea.getInsets(textAreaInsets); if (visibleRect.y<textAreaInsets.top) { visibleRect.height -= (textAreaInsets.top - visibleRect.y);
textAreaInsets = textArea.getInsets(textAreaInsets); if (visibleRect.y<textAreaInsets.top) { visibleRect.height -= (textAreaInsets.top - visibleRect.y);
textAreaInsets = textArea.getInsets(textAreaInsets); if (visibleRect.y<textAreaInsets.top) { visibleRect.height -= (textAreaInsets.top - visibleRect.y);
textAreaInsets = textArea.getInsets(textAreaInsets); if (visibleRect.y<textAreaInsets.top) { visibleRect.height -= (textAreaInsets.top - visibleRect.y);
/** * Repaints a single line in this list. * * @param line The line to repaint. */ private void repaintLine(int line) { int y = textArea.getInsets().top; y += line*cellHeight; repaint(0,y, cellWidth,cellHeight); }
/** * Repaints a single line in this list. * * @param line The line to repaint. */ private void repaintLine(int line) { int y = textArea.getInsets().top; y += line*cellHeight; repaint(0,y, cellWidth,cellHeight); }
/** * Repaints a single line in this list. * * @param line The line to repaint. */ private void repaintLine(int line) { int y = textArea.getInsets().top; y += line*cellHeight; repaint(0,y, cellWidth,cellHeight); }
/** * Gets the allocation to give the root View. Due * to an unfortunate set of historical events this * method is inappropriately named. The Rectangle * returned has nothing to do with visibility. * The component must have a non-zero positive size for * this translation to be computed. * * @return the bounding box for the root view */ protected Rectangle getVisibleEditorRect() { Rectangle alloc = textArea.getBounds(); if ((alloc.width > 0) && (alloc.height > 0)) { alloc.x = alloc.y = 0; Insets insets = textArea.getInsets(); alloc.x += insets.left; alloc.y += insets.top; alloc.width -= insets.left + insets.right; alloc.height -= insets.top + insets.bottom; return alloc; } return null; }
/** * Gets the allocation to give the root View. Due * to an unfortunate set of historical events this * method is inappropriately named. The Rectangle * returned has nothing to do with visibility. * The component must have a non-zero positive size for * this translation to be computed. * * @return the bounding box for the root view */ protected Rectangle getVisibleEditorRect() { Rectangle alloc = textArea.getBounds(); if ((alloc.width > 0) && (alloc.height > 0)) { alloc.x = alloc.y = 0; Insets insets = textArea.getInsets(); alloc.x += insets.left; alloc.y += insets.top; alloc.width -= insets.left + insets.right; alloc.height -= insets.top + insets.bottom; return alloc; } return null; }
/** * Gets the allocation to give the root View. Due * to an unfortunate set of historical events this * method is inappropriately named. The Rectangle * returned has nothing to do with visibility. * The component must have a non-zero positive size for * this translation to be computed. * * @return the bounding box for the root view */ @Override protected Rectangle getVisibleEditorRect() { Rectangle alloc = textArea.getBounds(); if ((alloc.width > 0) && (alloc.height > 0)) { alloc.x = alloc.y = 0; Insets insets = textArea.getInsets(); alloc.x += insets.left; alloc.y += insets.top; alloc.width -= insets.left + insets.right; alloc.height -= insets.top + insets.bottom; return alloc; } return null; }
/** * Draws the "margin line" if enabled. * * @param g The graphics context to paint with. * @param visibleRect The visible rectangle of this text area. */ protected void paintMarginLine(Graphics g, Rectangle visibleRect) { if (textArea.isMarginLineEnabled()) { g.setColor(textArea.getMarginLineColor()); Insets insets = textArea.getInsets(); int marginLineX = textArea.getMarginLinePixelLocation() + (insets==null ? 0 : insets.left); g.drawLine(marginLineX,visibleRect.y, marginLineX,visibleRect.y+visibleRect.height); } }
/** * Draws the "margin line" if enabled. * * @param g The graphics context to paint with. * @param visibleRect The visible rectangle of this text area. */ protected void paintMarginLine(Graphics g, Rectangle visibleRect) { if (textArea.isMarginLineEnabled()) { g.setColor(textArea.getMarginLineColor()); Insets insets = textArea.getInsets(); int marginLineX = textArea.getMarginLinePixelLocation() + (insets==null ? 0 : insets.left); g.drawLine(marginLineX,visibleRect.y, marginLineX,visibleRect.y+visibleRect.height); } }
/** * Draws the "margin line" if enabled. * * @param g The graphics context to paint with. * @param visibleRect The visible rectangle of this text area. */ protected void paintMarginLine(Graphics g, Rectangle visibleRect) { if (textArea.isMarginLineEnabled()) { g.setColor(textArea.getMarginLineColor()); Insets insets = textArea.getInsets(); int marginLineX = textArea.getMarginLinePixelLocation() + (insets==null ? 0 : insets.left); g.drawLine(marginLineX,visibleRect.y, marginLineX,visibleRect.y+visibleRect.height); } }
/** * 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); }
private void paintList(Graphics g, List highlights) { int len = highlights.size(); for (int i = 0; i < len; i++) { HighlightInfo info = (HighlightInfo)highlights.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)) { Color c = info.getColor(); Highlighter.HighlightPainter p = info.getPainter(); if (c!=null && p instanceof ChangeableColorHighlightPainter) { ((ChangeableColorHighlightPainter)p).setColor(c); } p.paint(g, info.getStartOffset(), info.getEndOffset(), a, textArea); } } } } }
textAreaInsets = textArea.getInsets(textAreaInsets); actualTopY += textAreaInsets.top; int y = actualTopY + ascent;
textAreaInsets = textArea.getInsets(textAreaInsets); if (textAreaInsets!=null) { y += textAreaInsets.top;