src/Tools/jEdit/src/text_area_painter.scala
changeset 46224 9cb98d34f593
parent 46220 663251a395c2
child 46812 3d55ef732cd7
equal deleted inserted replaced
46223:cf91e1944229 46224:9cb98d34f593
    14 import java.text.AttributedString
    14 import java.text.AttributedString
    15 import java.util.ArrayList
    15 import java.util.ArrayList
    16 
    16 
    17 import org.gjt.sp.jedit.Debug
    17 import org.gjt.sp.jedit.Debug
    18 import org.gjt.sp.jedit.syntax.{DisplayTokenHandler, Chunk}
    18 import org.gjt.sp.jedit.syntax.{DisplayTokenHandler, Chunk}
    19 import org.gjt.sp.jedit.textarea.{TextAreaExtension, TextAreaPainter, JEditTextArea}
    19 import org.gjt.sp.jedit.textarea.{TextAreaExtension, TextAreaPainter}
    20 
    20 
    21 
    21 
    22 class Text_Area_Painter(doc_view: Document_View)
    22 class Text_Area_Painter(doc_view: Document_View)
    23 {
    23 {
    24   private val model = doc_view.model
    24   private val model = doc_view.model
   121               gfx.fillRect(r.x + 2, y + i * line_height + 2, r.length - 4, line_height - 4)
   121               gfx.fillRect(r.x + 2, y + i * line_height + 2, r.length - 4, line_height - 4)
   122             }
   122             }
   123 
   123 
   124             // squiggly underline
   124             // squiggly underline
   125             for {
   125             for {
   126               Text.Info(range, color) <- Isabelle_Rendering.message_color(snapshot, line_range)
   126               Text.Info(range, color) <- Isabelle_Rendering.squiggly_underline(snapshot, line_range)
   127               r <- gfx_range(range)
   127               r <- gfx_range(range)
   128             } {
   128             } {
   129               gfx.setColor(color)
   129               gfx.setColor(color)
   130               val x0 = (r.x / 2) * 2
   130               val x0 = (r.x / 2) * 2
   131               val y0 = r.y + ascent + 1
   131               val y0 = r.y + ascent + 1
   141   }
   141   }
   142 
   142 
   143 
   143 
   144   /* text */
   144   /* text */
   145 
   145 
   146   def char_width(): Int =
   146   private def char_width(): Int =
   147   {
   147   {
   148     val painter = text_area.getPainter
   148     val painter = text_area.getPainter
   149     val font = painter.getFont
   149     val font = painter.getFont
   150     val font_context = painter.getFontRenderContext
   150     val font_context = painter.getFontRenderContext
   151     font.getStringBounds(" ", font_context).getWidth.round.toInt
   151     font.getStringBounds(" ", font_context).getWidth.round.toInt