one more comment
authorWalther Neuper <wneuper@ist.tugraz.at>
Thu, 07 Sep 2017 10:49:55 +0200
changeset 5204c51889cb8165
parent 5203 8fcdb69044d9
child 5205 db502ee98055
child 5207 958762fb43ff
one more comment
isac-java/src/java/isac/gui/mawen/editor/CalcUtil.scala
     1.1 --- a/isac-java/src/java/isac/gui/mawen/editor/CalcUtil.scala	Thu Sep 07 10:43:41 2017 +0200
     1.2 +++ b/isac-java/src/java/isac/gui/mawen/editor/CalcUtil.scala	Thu Sep 07 10:49:55 2017 +0200
     1.3 @@ -68,7 +68,7 @@
     1.4      val str = AstInfoUtil.VariableString(emptybox.ast)
     1.5      val box : Rectangle =  Settings.getStringBoundOf(str, level, x0, y0) //  getStringBounds(g.asInstanceOf[Graphics2D], str, x0, y0) // TODO: Why does this work without x0,y0?
     1.6      val b = DrawBox(str, level, box.x, box.y + box.height, box.width, box.height, x0, y0, ast)
     1.7 -    f(b) // makes call-back to <code>AstComponent</code> for <code>mouseMoved</code>
     1.8 +    f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
     1.9      b
    1.10    }
    1.11    def calcConstant( emptyBox: EmptyLeafOpBox, f:(DrawBox) => Unit) = {
    1.12 @@ -81,7 +81,7 @@
    1.13      val midline = y0 - (fontsizeOf(level) * (2f / 3f)*(1f / 3f)).round
    1.14      val newY = ((box.y - y0) * -1) - box.height /2 + midline
    1.15      val b = DrawBox(op, level, box.x, y0, box.width, fontWidthOf(fontsizeOf(level)),x0, newY, ast)
    1.16 -    f(b) // makes call-back to <code>AstComponent</code> for <code>mouseMoved</code>
    1.17 +    f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
    1.18      b
    1.19    }
    1.20    def calcGAP( emptyBox: EmptyLeafOpBox, f:(DrawBox) => Unit) = {
    1.21 @@ -91,7 +91,7 @@
    1.22      val ast =  emptyBox.ast
    1.23      val box : Rectangle = Settings.getStringBoundOf("xx", level, x0, y0) //getStringBounds(g.asInstanceOf[Graphics2D], "xx", x0, y0)
    1.24      val b = new DrawBox("GAP", level, box.x, y0, box.width, fontWidthOf(fontsizeOf(level)),x0, y0, ast)
    1.25 -    f(b) // makes call-back to <code>AstComponent</code> for <code>mouseMoved</code>
    1.26 +    f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
    1.27      b
    1.28    }
    1.29    def CalcBox( str: String, emptyBox: EmptyUniOpBox, f:(DrawBox) => Unit) = {
    1.30 @@ -114,7 +114,7 @@
    1.31      val param = emptyBox.param
    1.32      val childBox = assembleBoxesRec( new EmptyBox(level, x0, y0, param), f)
    1.33      val b = new DrawBox("CURSOR", level, childBox.x - 1, childBox.y + 1, childBox.width + 2,  childBox.height + 2, x0, y0, ast)
    1.34 -    f(b) // makes call-back to <code>AstComponent</code> for <code>mouseMoved</code>
    1.35 +    f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
    1.36      b.children = List(childBox)
    1.37      b
    1.38    }
    1.39 @@ -188,7 +188,7 @@
    1.40       
    1.41        b.children =  openBracketR :: closeBracketR :: b.children
    1.42      }
    1.43 -    f(b) // makes call-back to <code>AstComponent</code> for <code>mouseMoved</code>
    1.44 +    f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
    1.45      b
    1.46    }
    1.47    /*
    1.48 @@ -213,7 +213,7 @@
    1.49      
    1.50      val b = DrawBox ("", level, x0, y0, l_width + Settings.POWHORIZONTALSPACE + r_width, l_height + r_height,x0, y0,ast)
    1.51      b.children =  l_box :: r_box :: List.empty[DrawBox]
    1.52 -    f(b) // makes call-back to <code>AstComponent</code> for <code>mouseMoved</code>
    1.53 +    f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
    1.54      b
    1.55    }
    1.56    
    1.57 @@ -259,7 +259,7 @@
    1.58          u_res_box.height + l_res_box.height + line_box.height + Settings.FRACVERTIKALSPACE + Settings.FRACVERTIKALSPACE, 
    1.59          x0, y0, ast)
    1.60      b.children = line_box :: u_res_box :: l_res_box :: List.empty[DrawBox]
    1.61 -    f(b) // makes call-back to <code>AstComponent</code> for <code>mouseMoved</code>
    1.62 +    f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
    1.63      b
    1.64    }
    1.65    def calcDefault( str: String, param: List[Ast], x0: Int, y0: Int, level: Int, ast : Ast, f:(DrawBox) => Unit) = {
    1.66 @@ -287,7 +287,7 @@
    1.67      }
    1.68      val resultBox = new DrawBox(XSyntax.isa_ast(str) + "(", level, x0, y0, x - x0 , boxes.map(mb => mb.height).max, x0, y0, ast);
    1.69      resultBox.children = resBoxes
    1.70 -    f(resultBox) // makes call-back to <code>AstComponent</code> for <code>mouseMoved</code>
    1.71 +    f(resultBox) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
    1.72      resultBox
    1.73    }
    1.74    
    1.75 @@ -318,7 +318,7 @@
    1.76  
    1.77      val b = new DrawBox("", level, x0, y0, l_width + Settings.LARGESPACE + operator_width + Settings.LARGESPACE + r_width, Math.max(l_height, r_height),x0, y0, ast)
    1.78      b.children =  o_box :: l_box :: r_box :: List.empty[DrawBox]
    1.79 -    f(b) // makes call-back to <code>AstComponent</code> for <code>mouseMoved</code>
    1.80 +    f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
    1.81      b
    1.82    }
    1.83    def lowestY0(b: DrawBox): Int = {