diff options
author | Matt Windsor <mbw500@student.cs.york.ac.uk> | 2011-03-12 00:40:54 +0000 |
---|---|---|
committer | Matt Windsor <mbw500@student.cs.york.ac.uk> | 2011-03-12 00:40:54 +0000 |
commit | c8bb324e757587e742df0824304144e1eb881cee (patch) | |
tree | 87adcb64ba09c563ff78c5c5694ec688f9b58153 /src/uk/org/ury/show/viewer/TrackBin.java | |
parent | 9b4647f1ae8c3f41163d0d4053504dab861d0c94 (diff) |
Some more ShowViewer refinements; banners and sub-banners now for a trial run use system colours; shrunken banner a bit.
Diffstat (limited to 'src/uk/org/ury/show/viewer/TrackBin.java')
-rw-r--r-- | src/uk/org/ury/show/viewer/TrackBin.java | 73 |
1 files changed, 73 insertions, 0 deletions
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); + + } +} |