aboutsummaryrefslogtreecommitdiff
path: root/src/uk/org/ury/show/ShowChannel.java
diff options
context:
space:
mode:
authorMatt Windsor <matt@deling.(none)>2011-03-18 08:28:09 +0000
committerMatt Windsor <matt@deling.(none)>2011-03-18 08:28:09 +0000
commitd547f87da5f68c12dede7c9d45618cae11ff5699 (patch)
tree613aa95d94b363c72ba9a7be639c74f76edf81f8 /src/uk/org/ury/show/ShowChannel.java
parentc8bb324e757587e742df0824304144e1eb881cee (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/show/ShowChannel.java')
-rw-r--r--src/uk/org/ury/show/ShowChannel.java41
1 files changed, 40 insertions, 1 deletions
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<ShowItem> 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 ();
+ }
}