Logo Search packages:      
Sourcecode: jedit version File versions  Download package

void org::gjt::sp::jedit::textarea::TextArea::invalidateLineRange ( int  start,
int  end 
) [inline]

Marks a range of physical lines as needing a repaint.

Parameters:
start The first line to invalidate
end The last line to invalidate

Definition at line 1190 of file TextArea.java.

References getFirstPhysicalLine(), getLastPhysicalLine(), org::gjt::sp::jedit::textarea::ChunkCache::getLineInfo(), invalidateScreenLineRange(), org::gjt::sp::jedit::buffer::JEditBuffer::isLoading(), org::gjt::sp::jedit::textarea::ChunkCache::needFullRepaint, and visibleLines.

Referenced by extendSelection(), org::gjt::sp::jedit::textarea::BufferHandler::foldLevelChanged(), invalidateSelectedLines(), and resizeSelection().

      {
            if(!isShowing() || buffer.isLoading())
                  return;

            if(end < start)
            {
                  int tmp = end;
                  end = start;
                  start = tmp;
            }

            if(end < getFirstPhysicalLine() || start > getLastPhysicalLine())
                  return;

            int startScreenLine = -1;
            int endScreenLine = -1;

            for(int i = 0; i < visibleLines; i++)
            {
                  ChunkCache.LineInfo info = chunkCache.getLineInfo(i);

                  if((info.physicalLine >= start || info.physicalLine == -1)
                        && startScreenLine == -1)
                  {
                        startScreenLine = i;
                  }

                  if((info.physicalLine >= end && info.lastSubregion)
                        || info.physicalLine == -1)
                  {
                        endScreenLine = i;
                        break;
                  }
            }

            if(startScreenLine == -1)
                  startScreenLine = 0;

            if(chunkCache.needFullRepaint() || endScreenLine == -1)
                  endScreenLine = visibleLines;

            invalidateScreenLineRange(startScreenLine,endScreenLine);
      } //}}}


Generated by  Doxygen 1.6.0   Back to index