--- a/src/Tools/jEdit/src/jedit/PhaseOverviewPanel.scala Tue Sep 15 19:50:10 2009 +0200
+++ b/src/Tools/jEdit/src/jedit/PhaseOverviewPanel.scala Tue Sep 15 20:30:17 2009 +0200
@@ -9,13 +9,13 @@
import isabelle.prover.{Prover, Command}
import isabelle.proofdocument.ProofDocument
-import javax.swing._
-import java.awt.event._
-import java.awt._
+import javax.swing.{JPanel, ToolTipManager}
+import java.awt.event.{MouseAdapter, MouseEvent}
+import java.awt.{BorderLayout, Graphics, Dimension}
+
import org.gjt.sp.jedit.gui.RolloverButton
import org.gjt.sp.jedit.textarea.JEditTextArea
import org.gjt.sp.jedit.buffer.JEditBuffer
-import org.gjt.sp.jedit._
class PhaseOverviewPanel(
@@ -56,26 +56,20 @@
else ""
}
- private def paint_command(command: Command, buffer: JEditBuffer,
- doc: ProofDocument, gfx : Graphics) {
- val line1 = buffer.getLineOfOffset(to_current(doc, command.start(doc)))
- val line2 = buffer.getLineOfOffset(to_current(doc, command.stop(doc))) + 1
- val y = line_to_y(line1)
- val height = HEIGHT * (line2 - line1)
- val color = TheoryView.choose_color(command, doc)
-
- gfx.setColor(color)
- gfx.fillRect(0, y, getWidth - 1, height)
- }
-
override def paintComponent(gfx: Graphics) {
super.paintComponent(gfx)
val buffer = text_area.getBuffer
val theory_view = Isabelle.prover_setup(buffer).get.theory_view
- val document = theory_view.current_document()
+ val doc = theory_view.current_document()
- for (c <- document.commands)
- paint_command(c, buffer, document, gfx)
+ for (command <- doc.commands) {
+ val line1 = buffer.getLineOfOffset(to_current(doc, command.start(doc)))
+ val line2 = buffer.getLineOfOffset(to_current(doc, command.stop(doc))) + 1
+ val y = line_to_y(line1)
+ val height = HEIGHT * (line2 - line1)
+ gfx.setColor(TheoryView.choose_color(command, doc))
+ gfx.fillRect(0, y, getWidth - 1, height)
+ }
}
override def getPreferredSize = new Dimension(WIDTH, 0)