1signature BOUNDARIES  =
2sig
3  val makeBoundaries:    BasicTypes.style -> BasicTypes.dist -> BasicTypes.dist
4  -> BasicTypes.delim -> BasicTypes.delim -> BoxTypes.node * BoxTypes.node
5  val attachBoundaries:  BasicTypes.style -> BasicTypes.delim ->
6  BasicTypes.delim -> IListTypes.ilist -> IListTypes.ilist
7end  (* signature BOUNDARIES *)
8(*----------*)
9
10structure Boundaries: BOUNDARIES  =
11struct
12  open BasicTypes;  open BoxTypes;  open IListTypes
13  open Const;  open StyleParams;  open Delimiter;  open IListDim
14  open BoxPack; open AxisCenter
15
16  fun delimiterSize axisDist  =
17      Int.max ((axisDist div 500) * delimiterFactor,   (* units of 1000! *)
18           2 * axisDist - delimiterShortfall)
19
20  fun makeBoundaries st height depth left right  =
21  let val axh        =  AxisHeight st
22      val axisDist   =  Int.max (height - axh, depth + axh)
23      val delSize    =  delimiterSize axisDist
24      val leftNode   =  boxList [varDelimiter st delSize left]
25      val rightNode  =  boxList [varDelimiter st delSize right]
26  in  (axisCenter st leftNode, axisCenter st rightNode)  end
27
28  fun attachBoundaries st left right il  =
29  let val height = ilistHeight il  and  depth = ilistDepth il
30      val (leftNode, rightNode)  =  makeBoundaries st height depth left right
31      fun makeIList kind node  =  [INoad (kind, [node])]
32  in  makeIList Open leftNode  @  il  @  makeIList Close rightNode  end
33end  (* structure Boundaries *)
34