1 22 23 package org.gjt.sp.jedit.textarea; 24 25 import org.gjt.sp.jedit.Debug; 26 import org.gjt.sp.util.Log; 27 28 31 class ScrollLineCount extends Anchor 32 { 33 ScrollLineCount(DisplayManager displayManager, 35 TextArea textArea) 36 { 37 super(displayManager,textArea); 38 } 40 public void changed() {} 41 42 public void reset() 44 { 45 if(Debug.SCROLL_DEBUG) 46 Log.log(Log.DEBUG,this,"reset()"); 47 48 physicalLine = displayManager.getFirstVisibleLine(); 49 int scrollLine = 0; 50 while(physicalLine != -1) 51 { 52 int before = scrollLine; 53 displayManager.updateScreenLineCount(physicalLine); 54 if(before != scrollLine) 55 throw new RuntimeException (this + " nudged"); 56 scrollLine += displayManager 57 .getScreenLineCount(physicalLine); 58 physicalLine = displayManager 59 .getNextVisibleLine(physicalLine); 60 } 61 62 this.scrollLine = scrollLine; 63 physicalLine = displayManager.getBuffer().getLineCount(); 64 } } 66 | Popular Tags |