diff options
author | Matt Windsor <matt@deling.(none)> | 2011-03-18 08:28:09 +0000 |
---|---|---|
committer | Matt Windsor <matt@deling.(none)> | 2011-03-18 08:28:09 +0000 |
commit | d547f87da5f68c12dede7c9d45618cae11ff5699 (patch) | |
tree | 613aa95d94b363c72ba9a7be639c74f76edf81f8 /src/uk/org/ury/frontend/FrontendPanel.java | |
parent | c8bb324e757587e742df0824304144e1eb881cee (diff) |
Mega-commit to the rescue! Added Javadoc snapshot (admittedly old); show UI now fixed-layout; UI uses system selection colours for accents; now uses bapsserver password and can thus talk to show database relations; removed member relation dependencies until further notice; attempted to get application and applet launchers working but having issues with the latter; started working on a server communicating via a minimal implementation of HTTP 1.1 (standardisation required eventually).
Diffstat (limited to 'src/uk/org/ury/frontend/FrontendPanel.java')
-rw-r--r-- | src/uk/org/ury/frontend/FrontendPanel.java | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/src/uk/org/ury/frontend/FrontendPanel.java b/src/uk/org/ury/frontend/FrontendPanel.java index 0ec8003..931f86b 100644 --- a/src/uk/org/ury/frontend/FrontendPanel.java +++ b/src/uk/org/ury/frontend/FrontendPanel.java @@ -6,11 +6,18 @@ import javax.swing.JPanel; import org.swixml.SwingEngine; +import uk.org.ury.frontend.exceptions.UICreationFailureException; + /** * An extension of JPanel providing common functionality for user * interface panels in the URY system frontend. * + * Most notably, this includes automated access to XML-based + * preparation of the user interface provided by the panel, + * using an appropriate constructor call giving the XML file from + * which the user interface form should be read. + * * @author Matt Windsor * */ @@ -27,7 +34,9 @@ public class FrontendPanel extends JPanel /** * Construct a new, blank FrontendPanel. * - * @param master The FrontendMaster driving the frontend. + * @param master The FrontendMaster driving the frontend, if any. + * For direct instantiations of this class, + * providing null here is guaranteed to be safe. */ public @@ -43,17 +52,22 @@ public class FrontendPanel extends JPanel * Construct a new FrontendPanel from an XML layout. * * This is the preferred means of constructing FrontendPanels, and - * uses SWIXml to construct the panel layout. + * uses an XML-based engine to construct the panel layout. * * @param xmlPath The path, relative from this source file, to the * XML file from which this panel will read its * layout. * - * @param master The FrontendMaster driving the frontend. + * @param master The FrontendMaster driving the frontend, if any. + * For direct instantiations of this class, + * providing null here is guaranteed to be safe. + * + * @throws UICreationFailureException if the UI creation fails. */ public FrontendPanel (String xmlPath, FrontendMaster master) + throws UICreationFailureException { super (); @@ -65,8 +79,10 @@ public class FrontendPanel extends JPanel URL path = getClass ().getResource (xmlPath); if (path == null) - FrontendError.reportFatal ("UI creation failure: XML layout " - + xmlPath + " does not exist.", null); + throw new UICreationFailureException ("UI creation failure:" + + "XML layout " + + xmlPath + + " does not exist."); SwingEngine se = new SwingEngine (this); @@ -85,7 +101,21 @@ public class FrontendPanel extends JPanel } catch (Exception e) { - FrontendError.reportFatal ("UI creation failure: " + e.getMessage (), null); + throw new UICreationFailureException ("UI creation failure: " + + e.getMessage ()); } } + + + /** + * Set the frontend master. + * + * @param master The new frontend master to use. + */ + + public void + setMaster (FrontendMaster master) + { + this.master = master; + } } |