aboutsummaryrefslogtreecommitdiff
path: root/src/uk/org/ury/frontend/FrontendMaster.java
blob: 0a89e89a116e18e345f188daada83c4292757210 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
 * 
 */
package uk.org.ury.frontend;

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


/**
 * Interface for classes providing the parent unit of a frontend 
 * session.
 * 
 * This includes the FrontendFrame used in application mode as 
 * well as applets.
 * 
 * @author  Matt Windsor
 */

public interface FrontendMaster
{
  /**
   * Load a module into the frontend frame.
   * 
   * Loading will fail with a fatal error if the class is not found,
   * or is not an implementor of FrontendModule.
   * 
   * @param moduleName  The fully qualified class-name of the module,
   *                    minus the leading "uk.org.ury." domain.
   *                    
   * @throws            LoadFailureException if the class is 
   *                    not found, or is not an implementor of 
   *                    FrontendModule.
   */
  
  public void
  loadModule (String moduleName)
  throws LoadFailureException;

  
  /**
   * Load a module into the frontend frame, additionally installing 
   * a control panel to communicate with the previous module.
   * 
   * Loading will fail with a fatal error if the class is not found,
   * or is not an implementor of FrontendModule.
   * 
   * @param moduleName  The fully qualified class-name of the module,
   *                    minus the leading "uk.org.ury." domain.
   *                 
   * @param cPanelName  The fully qualified class-name of the control
   *                    panel to install, minus the leading 
   *                    "uk.org.ury." domain.
   *                    
   * @throws            LoadFailureException if the class is 
   *                    not found, or is not an implementor of 
   *                    FrontendModule.
   */
  
  public void 
  loadModule (String moduleName, String cPanelName)
  throws LoadFailureException;
  
  
  /**
   * Restore an existing module and control panel into the frontend 
   * master.
   * 
   * @param mpanel  The module panel to restore.
   * 
   * @param cpanel  The control panel to restore.
   * 
   * @throws        IllegalArgumentException if either are null.
   */
  
  public void
  restoreModule (FrontendModulePanel mpanel, FrontendControlPanel cpanel);
  
  
  /**
   * Report a fatal error,
   * 
   * @param message  The message, eg the exception message, to report
   *                 to the user.
   */
  
  public void
  fatalError (String message);
  
  
  /**
   * Set up the frontend master's user interface.
   */
  
  public void
  setupUI ();
  
  
  /**
   * @return  the resource directory.
   */
  
  public String
  getResourceDirectory ();
}