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.model.*;
6
7 /***
8 * Layout manager that lays the display of an operator whose symbol is located between its 2 operands.<BR>
9 * Rendering is done vertically, the first operand on top, the symbol in the middle and the second operand
10 * under the 2 previous.<BR>
11 * The symbol is rendered with an image.
12 *
13 * @author © 1999 DIRAT Laurent
14 * @version 2.0 15/12/1999
15 */
16 public class ImageBetweenOperatorLayout extends BetweenOperatorLayout {
17 /***
18 * The symbol we have to insert between each component if necessary.
19 */
20 private ImageSymbol symbolOperator = null;
21
22 /***
23 * Returns the display of the operator
24 */
25 public Display createOperatorDisplay() {
26 if (symbolOperator == null) {
27 Operator fts = (Operator) displayToLay.getListener();
28
29 symbolOperator = new ImageSymbol(fts.getResourceIdentifier(), displayToLay);
30 }
31
32
33 SymbolDisplay operatorDisplay = new SymbolDisplay(displayToLay.getGraphicContext(), symbolOperator);
34 operatorDisplay.setIsSymbolOperatorDisplay(true);
35
36 return operatorDisplay;
37 }
38 }