1.1 --- a/isac-java/src/java/isac/gui/mawen/editor/CalcUtil.scala Thu Sep 07 10:49:55 2017 +0200
1.2 +++ b/isac-java/src/java/isac/gui/mawen/editor/CalcUtil.scala Tue Sep 12 09:27:12 2017 +0200
1.3 @@ -60,6 +60,7 @@
1.4 case "Frac" => calcFrac( emptyBox, f)
1.5 case _ => calcDefault( operatorString, List(emptyBox.paramr, emptyBox.paraml), emptyBox.x0, emptyBox.y0, emptyBox.level, emptyBox.ast, f)
1.6 }
1.7 + // TODOWN rename f
1.8 def calcVariable( emptybox: EmptyLeafOpBox, f:(DrawBox) => Unit) = {
1.9 val level = emptybox.level
1.10 val x0 = emptybox.x0
1.11 @@ -71,6 +72,7 @@
1.12 f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
1.13 b
1.14 }
1.15 + // TODOWN rename f
1.16 def calcConstant( emptyBox: EmptyLeafOpBox, f:(DrawBox) => Unit) = {
1.17 val level = emptyBox.level
1.18 val x0 = emptyBox.x0
1.19 @@ -84,6 +86,7 @@
1.20 f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
1.21 b
1.22 }
1.23 + // TODOWN rename f
1.24 def calcGAP( emptyBox: EmptyLeafOpBox, f:(DrawBox) => Unit) = {
1.25 val level = emptyBox.level
1.26 val x0 = emptyBox.x0
1.27 @@ -94,6 +97,7 @@
1.28 f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
1.29 b
1.30 }
1.31 + // TODOWN why no f ?
1.32 def CalcBox( str: String, emptyBox: EmptyUniOpBox, f:(DrawBox) => Unit) = {
1.33 val box = assembleBoxesRec( new EmptyBox(emptyBox.level, emptyBox.x0, emptyBox.y0, emptyBox.param), f)
1.34 box.isBoxed = true
1.35 @@ -106,6 +110,7 @@
1.36 }
1.37 box
1.38 }
1.39 + // TODOWN rename f
1.40 def calcCursor( emptyBox: EmptyUniOpBox, f:(DrawBox) => Unit) = {
1.41 val x0 = emptyBox.x0
1.42 val y0 = emptyBox.y0
1.43 @@ -121,6 +126,7 @@
1.44 /*
1.45 * layout of horizontal type +, (binary)-, *, =
1.46 */
1.47 + // TODOWN rename f
1.48 def calcDefaultBinOp( emptyBox: EmptyBinOpBox, f:(DrawBox) => Unit) = {
1.49 val operator = emptyBox.operator
1.50 val paraml = emptyBox.paraml
1.51 @@ -194,6 +200,7 @@
1.52 /*
1.53 * layout of vertical type ^
1.54 */
1.55 + // TODOWN rename f
1.56 def calcPow( emptyBox: EmptyBinOpBox, f:(DrawBox) => Unit) = {
1.57 val operator = emptyBox.operator
1.58 val paraml = emptyBox.paraml
1.59 @@ -220,6 +227,7 @@
1.60 /*
1.61 * layout of vertical type with horizontal fraction bar
1.62 */
1.63 + // TODOWN rename f
1.64 def calcFrac( emptyBox: EmptyBinOpBox, f:(DrawBox) => Unit) = {
1.65 val operator = emptyBox.operator
1.66 val paramUpper = emptyBox.paraml
1.67 @@ -262,6 +270,7 @@
1.68 f(b) // see mmahringer $4.3.1 p.53/54 and $4.3.2 p.56
1.69 b
1.70 }
1.71 + // TODOWN rename f
1.72 def calcDefault( str: String, param: List[Ast], x0: Int, y0: Int, level: Int, ast : Ast, f:(DrawBox) => Unit) = {
1.73 val boxes = param.map(x => assembleBoxesRec( new EmptyBox(level, x0, y0, x),emptyFunc))
1.74
1.75 @@ -295,6 +304,7 @@
1.76 * calculate Boxes with the form Appl(Constant("HOL.eq"), Variable(str), Variable(str)) --> str = str
1.77 * nearly similar to calcPlus() but with more Space between Variable and Constant (LARGESPACE instance of MEDIUMSPACE)
1.78 */
1.79 + // TODOWN unify with calcDefaultBinOp , rename f
1.80 def calcEqualation( emptyBox: EmptyBinOpBox, f:(DrawBox) => Unit) = {
1.81 val operator = emptyBox.operator
1.82 val paraml = emptyBox.paraml