From d547f87da5f68c12dede7c9d45618cae11ff5699 Mon Sep 17 00:00:00 2001 From: Matt Windsor Date: Fri, 18 Mar 2011 08:28:09 +0000 Subject: 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). --- src/uk/org/ury/show/ShowChannel.java | 41 +++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'src/uk/org/ury/show/ShowChannel.java') diff --git a/src/uk/org/ury/show/ShowChannel.java b/src/uk/org/ury/show/ShowChannel.java index 6aa3ee8..8448e0f 100644 --- a/src/uk/org/ury/show/ShowChannel.java +++ b/src/uk/org/ury/show/ShowChannel.java @@ -3,6 +3,10 @@ package uk.org.ury.show; import java.util.ArrayList; import java.util.List; +import javax.swing.AbstractListModel; + +import uk.org.ury.show.item.ShowItem; + /** * A channel of ShowItems in a show. @@ -10,8 +14,13 @@ import java.util.List; * @author Matt Windsor */ -public class ShowChannel +public class ShowChannel extends AbstractListModel { + /** + * + */ + private static final long serialVersionUID = -4651104185166068150L; + /* Items enqueued in channel. */ private List items; @@ -50,6 +59,7 @@ public class ShowChannel " out of bounds."); items.add (index, item); + fireIntervalAdded (this, index, index); } @@ -66,6 +76,7 @@ public class ShowChannel throw new IllegalArgumentException ("Item is null."); items.add (item); + fireIntervalAdded (this, items.size () - 1, items.size () - 1); } @@ -89,4 +100,32 @@ public class ShowChannel return items.get (index); } + + + /** + * List model retrieval wrapper for get. + * + * @param index The index of the item to retrieve from the channel. + * + * @return the item at the given index in the list. + */ + + @Override + public Object + getElementAt (int index) + { + return get (index); + } + + + /** + * @return the size of the list. + */ + + @Override + public int + getSize () + { + return items.size (); + } } -- cgit v1.2.3