1 package fr.ove.openmath.jome.ctrlview.bidim;
2
3 import java.awt.*;
4 import java.util.Vector;
5 import fr.ove.openmath.jome.ctrlview.bidim.SymbolDisplay;
6 import fr.ove.openmath.jome.ctrlview.bidim.Display;
7 import fr.ove.openmath.jome.ctrlview.bidim.SubstitutedDisplayManager;
8
9 /***
10 * A layout manager for the display of of an icon
11 *
12 * @author © 1999 DIRAT Laurent
13 * @version 2.0 19/07/1999
14 */
15 public class IconLayout extends SymbolLayout implements SubstitutedDisplayManager {
16 /***
17 * The list of the displays that have been substituted.
18 */
19 private Vector substitutedDisplay = new Vector();
20
21
22
23
24 public void addSubstitutedDisplay(Display display) {
25 substitutedDisplay.addElement(display);
26 }
27
28
29
30
31
32 public void removeSubstitutedDisplay(Display display) {
33 substitutedDisplay.removeElement(display);
34 }
35
36
37
38
39
40 public void removeSubstitutedDisplay(int rank) {
41 substitutedDisplay.removeElementAt(rank);
42 }
43
44 /***
45 * Returns the substituted display at the specified rank.
46 * @param rank the specified rank.
47 */
48 public Display getSubstitutedDisplay(int rank) {
49 return (Display) substitutedDisplay.elementAt(rank);
50 }
51
52 /***
53 * Returns the number of substituted displays.
54 */
55 public int getNbSubstitutedDisplay() {
56 return substitutedDisplay.size();
57 }
58 }