aboutsummaryrefslogtreecommitdiff
path: root/src/uk/org/ury/frontend/FrontendControlPanel.java
blob: b79021ada7c2de82bd58cc70331d86e2fb96527a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
 * 
 */
package uk.org.ury.frontend;

import uk.org.ury.frontend.exceptions.UICreationFailureException;


/**
 * Abstract class for frontend module control panels.
 * 
 * Control panels are installed as a means of exposing module 
 * intercommunication to the user.  For example, when the library 
 * viewer is launched from the playout module, a control panel 
 * is installed allowing the user to add library items to the 
 * playout system.
 * 
 * @author  Matt Windsor
 */

public abstract class FrontendControlPanel extends FrontendPanel
{
  /**
   * 
   */
  private static final long serialVersionUID = -5628250552779928189L;
  
  protected FrontendControlPanel prevCPanel;
  protected FrontendModulePanel parent;
  protected FrontendModulePanel child;
  
  
  /**
   * Alternative constructor allowing an XML file to be used to 
   * create the layout of the ControlPanel.
   * 
   * This is provided for the benefit of subclasses of this class 
   * that use it in their default constructors.
   *
   * @param xmlPath  The path, relative from this source file, to the
   *                 XML file from which this panel will read its 
   *                 layout.
   *                 
   * @throws         UICreationFailureException if the UI creation fails.
   */
     
  public
  FrontendControlPanel (String xmlPath)
  throws UICreationFailureException
  {
     super (xmlPath, null);
  }
  
  
  /**
   * Set the parent and child panels that this ControlPanel 
   * facilitates intercommunication.
   * 
   * @param parent  The panel belonging to the parent module, 
   *                or the module that was switched out in place of 
   *                the child.
   *                
   * @param child   The panel belonging to the child module,
   *                or the module that was switched in in place of
   *                the parent.
   */

  public void
  setPanels (FrontendModulePanel parent, FrontendModulePanel child)
  {
    this.parent = parent;
    this.child = child;
  }


  /**
   * Set the previous control panel (if any), so that it can be 
   * restored when this control panel returns control to the 
   * parent.
   * 
   * @param cpanel  The previous control panel.
   */
  
  public void
  setPreviousCPanel (FrontendControlPanel cpanel)
  {
    prevCPanel = cpanel;
  }
}