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.DisplayLayout;
6 import fr.ove.openmath.jome.ctrlview.bidim.Display;
7 import fr.ove.openmath.jome.ctrlview.bidim.StringDisplay;
8 import fr.ove.openmath.jome.ctrlview.bidim.SubstitutedDisplayManager;
9 import fr.ove.openmath.jome.ctrlview.bidim.selection.events.SelectionEvent;
10
11 /***
12 * A layout manager that lays display of substitued displays.
13 *
14 * @author © 1999 DIRAT Laurent
15 * @version 2.0 04/08/1999
16 */
17 public class SubstitutionLayout extends AbstractStringLayout implements SubstitutedDisplayManager {
18 /***
19 * The list of the displays that have been iconified.
20 */
21 private Vector substitutedDisplay = new Vector();
22
23 /***
24 * Checks the validity of the selection.
25 */
26 public void validateSelection() {
27 }
28
29 /***
30 * Checks the validity of the deselection.
31 * @param display the display to deselect.
32 */
33 public void validateDeselection(Display display) {
34 }
35
36
37
38
39 public void addSubstitutedDisplay(Display display) {
40 substitutedDisplay.addElement(display);
41 }
42
43
44
45
46
47 public void removeSubstitutedDisplay(Display display) {
48 substitutedDisplay.removeElement(display);
49 }
50
51
52
53
54
55 public void removeSubstitutedDisplay(int rank) {
56 substitutedDisplay.removeElementAt(rank);
57 }
58
59 /***
60 * Returns the substituted display at the specified rank.
61 * @param rank the specified rank.
62 */
63 public Display getSubstitutedDisplay(int rank) {
64 return (Display) substitutedDisplay.elementAt(rank);
65 }
66
67 /***
68 * Returns the number of substituted displays.
69 */
70 public int getNbSubstitutedDisplay() {
71 return substitutedDisplay.size();
72 }
73 }