01: package org.gui4j.core.swing;
02:
03: import java.awt.Container;
04:
05: /**
06: * Interface to be implemented by components that need to be notified about
07: * the keyboard focus being inside or outside their own container hierarchy.
08: * The classes {@link org.gui4j.core.swing.IViewListener} and {@link org.gui4j.core.swing.IViewTracker}
09: * implement the notification mechanism.
10: */
11: public interface IView {
12:
13: /**
14: * Notifies this <code>IView</code> that the keyboard focus has moved out of or into its
15: * container hierarchy. Called by the notification mechanism implemented by
16: * {@link IViewListener} and {@link IViewTracker}.
17: * The component can then decide to react by altering its visual
18: * appearance (Typical example: simple internal frames only paint their headers coloured
19: * if they contain the focussed component, i.e. they are active).
20: * @param active <code>true</code>, if the focus has moved to a component inside this <code>IView</code>s
21: * container hierarchy. <code>false</code>, if the focus has moved to a component outside this
22: * <code>IView</code>s container hierarchy.
23: */
24: void setActive(boolean active);
25:
26: /**
27: * Returns the current active state of the <code>IView</code>.
28: * @return <code>true</code>, if the <code>IView</code> is currently active,
29: * <code>false</code> otherwise.
30: */
31: boolean isActive();
32:
33: /**
34: * Defines this <code>IView</code>s container hierarchy.
35: * @return The <code>Container</code> representing this <code>IView</code>s
36: * containment hierarchy.
37: */
38: Container getContainer();
39: }
|