Source code: org/dma/ihm/gui/lib/JIhmInternalFrame.java
1 package org.dma.ihm.gui.lib;
2
3 import java.awt.*;
4
5 import javax.swing.JInternalFrame;
6
7 import org.dma.ihm.controller.data.*;
8
9 /**
10 * The JIhmInternalFrame contains: - An owner of this screen - An update
11 * function that cylcles trough every JIhmComponent component on this frame
12 * (recursive) and calls the update routine of them.
13 *
14 * @author Bernhard von Gunten
15 * @created December 29, 2001
16 */
17 public class JIhmInternalFrame extends JInternalFrame implements JIhmComponent {
18 /** The owner of this frame */
19 private User owner = null;
20
21 /** Helper constructor for jbuilder designer issue */
22 public JIhmInternalFrame() { }
23
24
25 /**
26 * Sets the owner of this screen
27 *
28 * @param owner User to show this frame for
29 */
30 public JIhmInternalFrame(User owner) {
31 this.owner = owner;
32 }
33
34
35 /**
36 * Returns the owner of this screen
37 *
38 * @return The owner value
39 */
40 public User getOwner() {
41 return this.owner;
42 }
43
44
45 /** Provides ihmDisable */
46 public void ihmDisable() {
47 }
48
49
50 /** Provides ihmEnable */
51 public void ihmEnable() {
52 }
53
54
55 /** Starts the ihmUpdate(Container) function */
56 public void ihmUpdate() {
57 ihmUpdate(this);
58 }
59
60
61 /**
62 * Search for all JIhmComponents and call the ihmUpdate() function of them
63 *
64 * @param container Container to start from.
65 */
66 public void ihmUpdate(Container container) {
67 Component components[] = container.getComponents();
68 for (int i = 0; i < components.length; i++) {
69 if (components[i] instanceof java.awt.Container) {
70 ihmUpdate((java.awt.Container) components[i]);
71 }
72 if (components[i] instanceof JIhmComponent) {
73 JIhmComponent tmp = (JIhmComponent) components[i];
74 tmp.ihmUpdate();
75 }
76 }
77 ;
78 }
79 }