1 package fr.ove.openmath.jome.ctrlview.bidim;
2
3 import java.awt.*;
4 import fr.ove.openmath.jome.ctrlview.bidim.*;
5 import fr.ove.openmath.jome.ctrlview.bidim.selection.events.SelectionEvent;
6 import fr.ove.openmath.jome.model.*;
7
8 /***
9 * Layout manager that lays the display of the operator whose symbol is located under its operand
10 *
11 * @author © 1999 DIRAT Laurent
12 * @version 2.0 15/12/1999
13 */
14 public abstract class UnderOperatorLayout extends SuperposedOperatorLayout {
15 /***
16 * Computes the size of the display according to its children size (if any),
17 * and its different attributes.
18 * @return the size of the display.
19 */
20 public Dimension computeAttributes() {
21
22
23 Dimension dim = super.computeAttributes();
24
25 Display displayOperator = (Display) displayToLay.getComponent(0);
26 Display operand = (Display) displayToLay.getComponent(1);
27
28 int ascent = operand.getAscent();
29
30 displayToLay.setAscent(ascent);
31 displayToLay.setDescent(dim.height - ascent);
32
33
34 displayOperator.setShiftY(operand.getHeight());
35
36 operand.setShiftY(-displayOperator.getShiftY() - displayOperator.getHeight());
37
38 displayToLay.setComputeAttributes(false);
39
40 return dim;
41
42
43 }
44 }