aboutsummaryrefslogtreecommitdiff
path: root/src/uk/org/ury/show/viewer/ShowViewerPanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/uk/org/ury/show/viewer/ShowViewerPanel.java')
-rw-r--r--src/uk/org/ury/show/viewer/ShowViewerPanel.java44
1 files changed, 37 insertions, 7 deletions
diff --git a/src/uk/org/ury/show/viewer/ShowViewerPanel.java b/src/uk/org/ury/show/viewer/ShowViewerPanel.java
index e9cce90..ce1b794 100644
--- a/src/uk/org/ury/show/viewer/ShowViewerPanel.java
+++ b/src/uk/org/ury/show/viewer/ShowViewerPanel.java
@@ -4,17 +4,23 @@
package uk.org.ury.show.viewer;
import java.awt.GridLayout;
+import java.util.List;
import javax.swing.JPanel;
-import javax.swing.JSplitPane;
+import uk.org.ury.database.exceptions.QueryFailureException;
import uk.org.ury.frontend.FrontendMaster;
import uk.org.ury.frontend.FrontendModulePanel;
+import uk.org.ury.frontend.exceptions.LoadFailureException;
+import uk.org.ury.frontend.exceptions.UICreationFailureException;
import uk.org.ury.show.ShowChannel;
/**
- * Frontend panel providing access to an underlying lshow viewer.
+ * Frontend panel providing access to an underlying show viewer.
+ *
+ * The various show user interfaces (show editor, playout etc.)
+ * are derived from this.
*
* @author Matt Windsor, Nathan Lasseter
*/
@@ -29,21 +35,27 @@ public class ShowViewerPanel extends FrontendModulePanel
/* Panel widgets exposed by the SwiXML user interface. */
- private JSplitPane mainSplit;
- private JSplitPane binSplit;
private JPanel channelGroupPanel;
private JPanel binGroupPanel;
+
/**
* Construct a new ShowViewerPanel.
*
+ * The panel will interface with the given show viewer and is
+ * expected to be placed as a sub-component in the given
+ * FrontendMaster.
+ *
* @param viewer The ShowViewer controlling this LibraryViewerPanel.
*
* @param master The FrontendMaster driving the frontend.
+ *
+ * @throws UICreationFailureException if the UI creation fails.
*/
public
ShowViewerPanel (ShowViewer viewer, FrontendMaster master)
+ throws UICreationFailureException
{
super (viewer, "show_viewer_gui.xml", master);
@@ -62,7 +74,17 @@ public class ShowViewerPanel extends FrontendModulePanel
// TEST
- String binNames[] = {"Jingles", "Beds", "Adverts"};
+ List<String> binNames = null;
+
+ try
+ {
+ binNames = viewer.getBins ();
+ }
+ catch (QueryFailureException e)
+ {
+ master.fatalError (e.getMessage ());
+ }
+
TrackBin tb;
for (String name : binNames)
@@ -72,7 +94,7 @@ public class ShowViewerPanel extends FrontendModulePanel
binGroupPanel.add (tb);
}
- binGroupPanel.setLayout (new GridLayout (1, 3));
+ binGroupPanel.setLayout (new GridLayout (1, binNames.size ()));
}
@@ -98,6 +120,14 @@ public class ShowViewerPanel extends FrontendModulePanel
public void
search ()
{
- master.loadModule ("library.viewer.LibraryViewer", "show.viewer.LibraryControlPanel");
+ try
+ {
+ master.loadModule ("library.viewer.LibraryViewer",
+ "show.viewer.LibraryControlPanel");
+ }
+ catch (LoadFailureException e)
+ {
+ master.fatalError (e.getMessage ());
+ }
}
}