aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/uk/org/ury/frontend/FrontendBanner.java13
-rw-r--r--src/uk/org/ury/frontend/FrontendFrame.java27
-rw-r--r--src/uk/org/ury/frontend/FrontendPanel.java1
-rw-r--r--src/uk/org/ury/frontend/FrontendSubBanner.java47
-rw-r--r--src/uk/org/ury/frontend/images/ury.pngbin6566 -> 7756 bytes
-rw-r--r--src/uk/org/ury/library/viewer/LibraryViewerPanel.java1
-rw-r--r--src/uk/org/ury/show/viewer/ChannelPanel.java20
-rw-r--r--src/uk/org/ury/show/viewer/ShowViewer.java1
-rw-r--r--src/uk/org/ury/show/viewer/ShowViewerPanel.java27
-rw-r--r--src/uk/org/ury/show/viewer/TrackBin.java73
-rw-r--r--src/uk/org/ury/show/viewer/channel_panel.xml50
-rw-r--r--src/uk/org/ury/show/viewer/show_viewer_gui.xml49
-rw-r--r--src/uk/org/ury/show/viewer/track_bin.xml10
13 files changed, 260 insertions, 59 deletions
diff --git a/src/uk/org/ury/frontend/FrontendBanner.java b/src/uk/org/ury/frontend/FrontendBanner.java
index f3ce502..b717c37 100644
--- a/src/uk/org/ury/frontend/FrontendBanner.java
+++ b/src/uk/org/ury/frontend/FrontendBanner.java
@@ -1,12 +1,12 @@
package uk.org.ury.frontend;
-import java.awt.Color;
import java.awt.FlowLayout;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
+import javax.swing.UIManager;
/**
@@ -23,8 +23,8 @@ public class FrontendBanner extends JPanel
*/
private static final long serialVersionUID = -3636933349004358394L;
- private static final String TITLE_PREFIX = "<html><h1><font color=white>";
- private static final String TITLE_SUFFIX = "</font></h1></html>";
+ private static final String TITLE_PREFIX = "<html><h1>";
+ private static final String TITLE_SUFFIX = "</h1></html>";
private JLabel titleLabel;
@@ -39,14 +39,15 @@ public class FrontendBanner extends JPanel
FrontendBanner (String title)
{
setLayout (new FlowLayout (FlowLayout.LEFT));
- setBackground (new Color (0, 0, 0));
-
+ setBackground (UIManager.getColor ("textHighlight"));
+ setOpaque (true);
JLabel logo = new JLabel (new ImageIcon (getClass ().getResource ("images/ury.png")));
titleLabel = new JLabel (TITLE_PREFIX + title + TITLE_SUFFIX);
- titleLabel.setBorder (BorderFactory.createEmptyBorder (5, 15, 5, 5));
+ titleLabel.setBorder (BorderFactory.createEmptyBorder (0, 15, 0, 0));
+ titleLabel.setForeground (UIManager.getColor ("textHighlightText"));
add (logo);
diff --git a/src/uk/org/ury/frontend/FrontendFrame.java b/src/uk/org/ury/frontend/FrontendFrame.java
index ef2a31a..aabdfbd 100644
--- a/src/uk/org/ury/frontend/FrontendFrame.java
+++ b/src/uk/org/ury/frontend/FrontendFrame.java
@@ -8,6 +8,8 @@ import java.awt.Container;
import java.awt.Dimension;
import javax.swing.JFrame;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
/**
* A frame that hosts a FrontendModulePanel, used for serving frontend
@@ -33,6 +35,28 @@ public class FrontendFrame extends JFrame implements FrontendMaster
FrontendFrame (FrontendModulePanel parent)
{
super (parent.getName ());
+
+ try
+ {
+ // Set System L&F
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName ());
+ }
+ catch (UnsupportedLookAndFeelException e)
+ {
+ // handle exception
+ }
+ catch (ClassNotFoundException e)
+ {
+ // handle exception
+ }
+ catch (InstantiationException e)
+ {
+ // handle exception
+ }
+ catch (IllegalAccessException e)
+ {
+ // handle exception
+ }
setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
@@ -49,7 +73,8 @@ public class FrontendFrame extends JFrame implements FrontendMaster
cp.add (banner, BorderLayout.NORTH);
cp.add (parent, BorderLayout.CENTER);
- setPreferredSize (new Dimension (640, 480));
+ setPreferredSize (new Dimension (800, 600));
+ setMinimumSize (new Dimension (800, 600));
pack ();
setVisible (true);
diff --git a/src/uk/org/ury/frontend/FrontendPanel.java b/src/uk/org/ury/frontend/FrontendPanel.java
index 1617ab0..0ec8003 100644
--- a/src/uk/org/ury/frontend/FrontendPanel.java
+++ b/src/uk/org/ury/frontend/FrontendPanel.java
@@ -74,6 +74,7 @@ public class FrontendPanel extends JPanel
// Custom UI element tag registration.
se.getTaglib ().registerTag ("hint", HintField.class);
+ se.getTaglib ().registerTag ("subbanner", FrontendSubBanner.class);
// Read the XML.
diff --git a/src/uk/org/ury/frontend/FrontendSubBanner.java b/src/uk/org/ury/frontend/FrontendSubBanner.java
new file mode 100644
index 0000000..da162bb
--- /dev/null
+++ b/src/uk/org/ury/frontend/FrontendSubBanner.java
@@ -0,0 +1,47 @@
+package uk.org.ury.frontend;
+
+import javax.swing.BorderFactory;
+import javax.swing.JLabel;
+import javax.swing.JTextArea;
+import javax.swing.UIManager;
+
+
+/**
+ * A banner, displaying a title, intended for use at the top of
+ * subsections.
+ *
+ * @author Matt Windsor
+ */
+
+public class FrontendSubBanner extends JLabel
+{
+ private static final String TITLE_PREFIX = "<html><b>";
+ private static final String TITLE_SUFFIX = "</b></html>";
+
+
+ /**
+ * Construct a new FrontendSubBanner.
+ */
+
+ public
+ FrontendSubBanner ()
+ {
+ super ();
+
+ //setLineWrap (true);
+ //setWrapStyleWord (true);
+ //setEditable (false);
+
+ setBackground (UIManager.getColor ("textHighlight"));
+ setForeground (UIManager.getColor ("textHighlightText"));
+ setBorder (BorderFactory.createEmptyBorder (3, 6, 3, 6));
+ setOpaque (true);
+ }
+
+
+ public void
+ setText (String text)
+ {
+ super.setText (TITLE_PREFIX + text + TITLE_SUFFIX);
+ }
+}
diff --git a/src/uk/org/ury/frontend/images/ury.png b/src/uk/org/ury/frontend/images/ury.png
index b1f85a1..daf13b5 100644
--- a/src/uk/org/ury/frontend/images/ury.png
+++ b/src/uk/org/ury/frontend/images/ury.png
Binary files differ
diff --git a/src/uk/org/ury/library/viewer/LibraryViewerPanel.java b/src/uk/org/ury/library/viewer/LibraryViewerPanel.java
index d6a00d9..7638822 100644
--- a/src/uk/org/ury/library/viewer/LibraryViewerPanel.java
+++ b/src/uk/org/ury/library/viewer/LibraryViewerPanel.java
@@ -7,7 +7,6 @@ package uk.org.ury.library.viewer;
import java.util.concurrent.ExecutionException;
import javax.swing.JButton;
-import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
diff --git a/src/uk/org/ury/show/viewer/ChannelPanel.java b/src/uk/org/ury/show/viewer/ChannelPanel.java
index 187aa86..99a616a 100644
--- a/src/uk/org/ury/show/viewer/ChannelPanel.java
+++ b/src/uk/org/ury/show/viewer/ChannelPanel.java
@@ -11,11 +11,11 @@ import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
-import javax.swing.ListModel;
import org.swixml.SwingEngine;
import uk.org.ury.frontend.FrontendError;
+import uk.org.ury.frontend.FrontendSubBanner;
import uk.org.ury.show.ShowChannel;
@@ -59,7 +59,7 @@ public class ChannelPanel extends JPanel
FrontendError.reportFatal ("UI creation failure: XML layout does not exist.", null);
SwingEngine se = new SwingEngine (this);
-
+ se.getTaglib ().registerTag ("subbanner", FrontendSubBanner.class);
// Read the XML.
@@ -74,20 +74,20 @@ public class ChannelPanel extends JPanel
// Tweak buttons to add function key mnemonics, if function keys are available.
- if (number <= 4)
+ if (number <= 3)
{
- int base = number * 3;
+ int base = (number - 1) * 4;
- playButton.setText ("Play (F" + (base - 2) + ")");
- playButton.setMnemonic (KeyEvent.VK_F1 + (base - 1));
+ playButton.setText ("Play (F" + (base + 1) + ")");
+ playButton.setMnemonic (KeyEvent.VK_F1 + (base ));
playButton.setDisplayedMnemonicIndex (7);
- pauseButton.setText ("Stop (F" + (base - 1) + ")");
- pauseButton.setMnemonic (KeyEvent.VK_F2 + (base - 1));
+ pauseButton.setText ("Stop (F" + (base + 2) + ")");
+ pauseButton.setMnemonic (KeyEvent.VK_F2 + (base ));
pauseButton.setDisplayedMnemonicIndex (7);
- stopButton.setText ("Pause (F" + (base ) + ")");
- stopButton.setMnemonic (KeyEvent.VK_F3 + (base - 1));
+ stopButton.setText ("Pause (F" + (base + 3) + ")");
+ stopButton.setMnemonic (KeyEvent.VK_F3 + (base ));
stopButton.setDisplayedMnemonicIndex (8);
}
diff --git a/src/uk/org/ury/show/viewer/ShowViewer.java b/src/uk/org/ury/show/viewer/ShowViewer.java
index 8b3f2db..8a0e46a 100644
--- a/src/uk/org/ury/show/viewer/ShowViewer.java
+++ b/src/uk/org/ury/show/viewer/ShowViewer.java
@@ -12,7 +12,6 @@ import uk.org.ury.frontend.AbstractFrontendModule;
import uk.org.ury.frontend.FrontendError;
import uk.org.ury.frontend.FrontendFrame;
import uk.org.ury.frontend.FrontendMaster;
-import uk.org.ury.frontend.FrontendModule;
import uk.org.ury.frontend.FrontendModulePanel;
import uk.org.ury.show.ShowChannel;
diff --git a/src/uk/org/ury/show/viewer/ShowViewerPanel.java b/src/uk/org/ury/show/viewer/ShowViewerPanel.java
index d276420..e9cce90 100644
--- a/src/uk/org/ury/show/viewer/ShowViewerPanel.java
+++ b/src/uk/org/ury/show/viewer/ShowViewerPanel.java
@@ -3,8 +3,10 @@
*/
package uk.org.ury.show.viewer;
-import javax.swing.JButton;
+import java.awt.GridLayout;
+
import javax.swing.JPanel;
+import javax.swing.JSplitPane;
import uk.org.ury.frontend.FrontendMaster;
import uk.org.ury.frontend.FrontendModulePanel;
@@ -23,11 +25,14 @@ public class ShowViewerPanel extends FrontendModulePanel
*
*/
private static final long serialVersionUID = -2441616418398056712L;
-
- private JPanel channelGroupPanel;
+
/* Panel widgets exposed by the SwiXML user interface. */
+ private JSplitPane mainSplit;
+ private JSplitPane binSplit;
+ private JPanel channelGroupPanel;
+ private JPanel binGroupPanel;
/**
* Construct a new ShowViewerPanel.
@@ -52,6 +57,22 @@ public class ShowViewerPanel extends FrontendModulePanel
channelGroupPanel.add (cp);
channelNumber++;
}
+
+ channelGroupPanel.setLayout (new GridLayout (1, channelNumber - 1));
+
+
+ // TEST
+ String binNames[] = {"Jingles", "Beds", "Adverts"};
+ TrackBin tb;
+
+ for (String name : binNames)
+ {
+ tb = new TrackBin (name);
+
+ binGroupPanel.add (tb);
+ }
+
+ binGroupPanel.setLayout (new GridLayout (1, 3));
}
diff --git a/src/uk/org/ury/show/viewer/TrackBin.java b/src/uk/org/ury/show/viewer/TrackBin.java
new file mode 100644
index 0000000..a95b183
--- /dev/null
+++ b/src/uk/org/ury/show/viewer/TrackBin.java
@@ -0,0 +1,73 @@
+/**
+ *
+ */
+package uk.org.ury.show.viewer;
+
+import java.net.URL;
+
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+
+import org.swixml.SwingEngine;
+
+import uk.org.ury.frontend.FrontendError;
+import uk.org.ury.frontend.FrontendSubBanner;
+
+
+/**
+ * A panel displaying track bin contents.
+ *
+ * @author Matt Windsor.
+ */
+
+public class TrackBin extends JPanel
+{
+ private JLabel binName;
+ private JList itemList;
+
+
+ /**
+ * Construct a new TrackBin.
+ *
+ * This constructor reads the channel panel layout from the
+ * XML manifest "track_bin.xml" in the same directory as
+ * this class file.
+ *
+ * @param name The name of the bin.
+ *
+ * TODO: add track list into constructor
+ */
+
+ public
+ TrackBin (String name)
+ {
+ super ();
+
+ // Acquire path.
+
+ URL path = getClass ().getResource ("track_bin.xml");
+
+ if (path == null)
+ FrontendError.reportFatal ("UI creation failure: XML layout does not exist.", null);
+
+ SwingEngine se = new SwingEngine (this);
+ se.getTaglib ().registerTag ("subbanner", FrontendSubBanner.class);
+
+ // Read the XML.
+
+ try
+ {
+ se.insert (path, this);
+ }
+ catch (Exception e)
+ {
+ FrontendError.reportFatal ("UI creation failure: " + e.getMessage (), null);
+ }
+
+ // Tweak name.
+
+ binName.setText (name);
+
+ }
+}
diff --git a/src/uk/org/ury/show/viewer/channel_panel.xml b/src/uk/org/ury/show/viewer/channel_panel.xml
index f739c7a..2aac663 100644
--- a/src/uk/org/ury/show/viewer/channel_panel.xml
+++ b/src/uk/org/ury/show/viewer/channel_panel.xml
@@ -1,36 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
-<panel border="RaisedBevelBorder" size="100,250">
- <vbox>
- <hbox>
- <label id ="channelName"
- border="EmptyBorder(5,5,5,5)"
- text="Channel x" font="Verdana-BOLD-14" />
- </hbox>
- <scrollpane id="itemScroller">
+<panel border="EmptyBorder(5,5,5,5)" layout="BorderLayout">
+ <subbanner id="channelName" text="Channel x"
+ constraints="BorderLayout.NORTH" />
+ <vbox constraints="BorderLayout.CENTER">
+ <scrollpane id="itemScroller" constraints="BorderLayout.CENTER">
<list id="itemList" />
- </scrollpane>
- <hbox>
+ </scrollpane>
+ </vbox>
+ <vbox constraints="BorderLayout.SOUTH">
+ <panel layout="GridLayout(1,3)">
<button id="playButton" text="Play" />
<button id="pauseButton" text="Pause" />
<button id="stopButton" text="Stop" />
- </hbox>
- <hbox>
+ </panel>
+ <panel layout="GridLayout(3, 1)">
<label text="Name of track" />
- </hbox>
- <hbox>
- <label text="Duration chart" />
- </hbox>
- <hbox>
<hbox border="EtchedBorder">
- <vbox border="EmptyBorder(5,5,5,5)">
- <label text="Elapsed" />
- </vbox>
+ <label text="Duration chart" />
</hbox>
- <hbox border="EtchedBorder">
- <vbox border="EmptyBorder(5,5,5,5)">
- <label text="Remaining" />
- </vbox>
+ <hbox>
+ <glue />
+ <hbox border="EmptyBorder(5,5,5,5)">
+ <label text="Elapsed: " />
+ <label text="0:00:00" font="Verdana-BOLD-14" />
+ </hbox>
+ <glue />
+ <hbox border="EmptyBorder(5,5,5,5)">
+ <label text="Remaining: " />
+ <label text="0:00:00" font="Verdana-BOLD-14" />
+ </hbox>
+ <glue />
</hbox>
- </hbox>
+ </panel>
</vbox>
</panel> \ No newline at end of file
diff --git a/src/uk/org/ury/show/viewer/show_viewer_gui.xml b/src/uk/org/ury/show/viewer/show_viewer_gui.xml
index a4f0f5b..67c9cb4 100644
--- a/src/uk/org/ury/show/viewer/show_viewer_gui.xml
+++ b/src/uk/org/ury/show/viewer/show_viewer_gui.xml
@@ -2,24 +2,49 @@
<panel layout="BorderLayout">
<hbox constraints="BorderLayout.NORTH" border="EmptyBorder(5,5,5,5)" size="640,32">
<button id="loadButton" text="Load Show or Template..." mnemonic="VK_L"
- action="load"
- font="Verdana-BOLD-14" />
+ action="load"
+ font="Verdana-BOLD-14" />
<button id="searchButton" text="Search Record Library" mnemonic="VK_S"
- action="search"
- font="Verdana-BOLD-14" />
+ action="search"
+ font="Verdana-BOLD-14" />
+ <glue />
+ <button id="helpButton" text="Help..." mnemonic="VK_H"
+ action="help"
+ font="Verdana-BOLD-14" />
+ <button id="feedbackButton" text="Feedback..." mnemonic="VK_F"
+ action="feedback"
+ font="Verdana-BOLD-14" />
</hbox>
<splitpane constraints="BorderLayout.CENTER" border="EmptyBorder(0,5,0,5)"
- orientation="0">
- <scrollpane id="binScrollPane">
- <label text="Bins will go here." />
- </scrollpane>
- <scrollpane id="channelScrollPane">
- <panel id="channelGroupPanel" />
- </scrollpane>
+ id="mainSplit" orientation="0" dividerlocation="400">
+ <splitpane orientation="0" size="640,340" id="binSplit" dividerlocation="100">
+ <panel layout="BorderLayout">
+ <subbanner text="Useful Tracks"
+ constraints="BorderLayout.NORTH" />
+ <scrollpane id="binScrollPane" size="640,150"
+ constraints="BorderLayout.CENTER">
+ <panel id="binGroupPanel" />
+ </scrollpane>
+ </panel>
+ <panel layout="BorderLayout">
+ <subbanner text="Sound Channels"
+ constraints="BorderLayout.NORTH" />
+ <scrollpane id="channelScrollPane" size="640,360"
+ constraints="BorderLayout.CENTER">
+ <panel id="channelGroupPanel" />
+ </scrollpane>
+ </panel>
+ </splitpane>
+ <panel layout="BorderLayout">
+ <subbanner text="Quick Notes"
+ constraints="BorderLayout.NORTH" />
+ <textarea id="noteArea" size="640,100" border="LoweredBevelBorder"
+ text="Type quick notes here..." />
+ </panel>
</splitpane>
<hbox constraints="BorderLayout.SOUTH" border="EmptyBorder(5,5,5,5)">
- <hint text="Hint goes here." />
+ <hint text="For help, click the Help button." />
</hbox>
</panel>
diff --git a/src/uk/org/ury/show/viewer/track_bin.xml b/src/uk/org/ury/show/viewer/track_bin.xml
new file mode 100644
index 0000000..988c1a4
--- /dev/null
+++ b/src/uk/org/ury/show/viewer/track_bin.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<panel border="EmptyBorder(5,5,5,5)" layout="BorderLayout">
+ <subbanner id="binName" text="Bin"
+ constraints="BorderLayout.NORTH" />
+ <vbox>
+ <scrollpane id="itemScroller">
+ <list id="itemList" />
+ </scrollpane>
+ </vbox>
+</panel> \ No newline at end of file