respect current offsets
authorimmler@in.tum.de
Sun Feb 01 13:14:36 2009 +0100 (2009-02-01)
changeset 34513411017e76e98
parent 34512 14d70378f1c7
child 34514 2104a836b415
respect current offsets
src/Tools/jEdit/src/jedit/PhaseOverviewPanel.scala
src/Tools/jEdit/src/jedit/TheoryView.scala
     1.1 --- a/src/Tools/jEdit/src/jedit/PhaseOverviewPanel.scala	Sun Feb 01 12:50:21 2009 +0100
     1.2 +++ b/src/Tools/jEdit/src/jedit/PhaseOverviewPanel.scala	Sun Feb 01 13:14:36 2009 +0100
     1.3 @@ -17,7 +17,7 @@
     1.4  import org.gjt.sp.jedit.buffer.JEditBuffer;
     1.5  import org.gjt.sp.jedit._
     1.6  
     1.7 -class PhaseOverviewPanel(prover : isabelle.prover.Prover) extends JPanel(new BorderLayout) {
     1.8 +class PhaseOverviewPanel(prover: isabelle.prover.Prover, to_current: Int => Int) extends JPanel(new BorderLayout) {
     1.9  
    1.10    private val WIDTH = 10
    1.11  	private val HILITE_HEIGHT = 2
    1.12 @@ -25,7 +25,7 @@
    1.13  
    1.14    val repaint_delay = new isabelle.utils.Delay(100, () => repaint())
    1.15    prover.command_info += (_ => repaint_delay.delay_or_ignore())
    1.16 -    
    1.17 +
    1.18    setRequestFocusEnabled(false);
    1.19  
    1.20    addMouseListener(new MouseAdapter {
    1.21 @@ -59,8 +59,8 @@
    1.22  	}
    1.23  
    1.24    private def paintCommand(command : Command, buffer : JEditBuffer, gfx : Graphics) {
    1.25 -      val line1 = buffer.getLineOfOffset(command.start)
    1.26 -      val line2 = buffer.getLineOfOffset(command.stop - 1) + 1
    1.27 +      val line1 = buffer.getLineOfOffset(to_current(command.start))
    1.28 +      val line2 = buffer.getLineOfOffset(to_current(command.stop - 1)) + 1
    1.29        val y = lineToY(line1)
    1.30        val height = lineToY(line2) - y - 1
    1.31        val (light, dark) = command.status match {
    1.32 @@ -84,7 +84,7 @@
    1.33  		val buffer = textarea.getBuffer
    1.34      for (c <- prover.document.commands)
    1.35        paintCommand(c, buffer, gfx)
    1.36 -    
    1.37 +
    1.38  	}
    1.39  
    1.40  	override def getPreferredSize : Dimension =
     2.1 --- a/src/Tools/jEdit/src/jedit/TheoryView.scala	Sun Feb 01 12:50:21 2009 +0100
     2.2 +++ b/src/Tools/jEdit/src/jedit/TheoryView.scala	Sun Feb 01 13:14:36 2009 +0100
     2.3 @@ -85,7 +85,7 @@
     2.4    col_timer.setRepeats(true)
     2.5  
     2.6  
     2.7 -  private val phase_overview = new PhaseOverviewPanel(prover)
     2.8 +  private val phase_overview = new PhaseOverviewPanel(prover, to_current(_))
     2.9  
    2.10  
    2.11    /* activation */