1 package fr.ove.openmath.jome.ctrlview.bidim;
2
3 import java.awt.*;
4 import fr.ove.openmath.jome.ctrlview.bidim.*;
5
6 /***
7 * This layout manager lays postfixed unary operators.
8 *
9 * @author © 1999 DIRAT Laurent
10 * @version 2.0 13/12/1999
11 */
12 public abstract class PostfixedUnaryOperatorLayout extends UnaryOperatorLayout {
13 /***
14 * Computes the size of the display according to its children size (if any),
15 * and its different attributes.
16 * @return the size of the display.
17 */
18 public Dimension computeAttributes() {
19 Display dOperator = (Display) displayToLay.getComponent(0);
20 Display dOperand = (Display) displayToLay.getComponent(1);
21
22
23 dOperator.setAttributes(dOperator.getAscent(), dOperator.getDescent(), 0, 0);
24 dOperand.setAttributes(dOperand.getAscent(), dOperand.getDescent(), 0, 0);
25
26
27 Dimension dim = super.computeAttributes();
28
29
30 dOperator.setShiftX(dim.width - dOperator.getWidth());
31 dOperand.setShiftX(-dOperator.getShiftX() - dOperator.getWidth());
32
33 return dim;
34 }
35 }