diff options
| author | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
|---|---|---|
| committer | abranson <andrew.branson@cern.ch> | 2011-08-04 00:42:34 +0200 |
| commit | 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch) | |
| tree | 5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/gui/tabs/CollectionPane.java | |
| parent | 036cbdba66f804743c4c838ed598d6972c4b3e17 (diff) | |
More code cleanup:
Refactored Entity Proxy Subscription to handle generics better
Rewrote RemoteMap to use TreeMap instead of the internal array for
order. It now sorts its keys by number if they parse, else as strings.
Removed a no-longer-in-progress outcome form class
Diffstat (limited to 'source/com/c2kernel/gui/tabs/CollectionPane.java')
| -rw-r--r--[-rwxr-xr-x] | source/com/c2kernel/gui/tabs/CollectionPane.java | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/source/com/c2kernel/gui/tabs/CollectionPane.java b/source/com/c2kernel/gui/tabs/CollectionPane.java index 92492fc..7511a97 100755..100644 --- a/source/com/c2kernel/gui/tabs/CollectionPane.java +++ b/source/com/c2kernel/gui/tabs/CollectionPane.java @@ -6,9 +6,9 @@ import javax.swing.JTabbedPane; import com.c2kernel.collection.Aggregation;
import com.c2kernel.collection.Collection;
import com.c2kernel.collection.Dependency;
-import com.c2kernel.entity.C2KLocalObject;
import com.c2kernel.entity.proxy.EntityProxyObserver;
import com.c2kernel.entity.proxy.ItemProxy;
+import com.c2kernel.entity.proxy.MemberSubscription;
import com.c2kernel.gui.tabs.collection.AggregationView;
import com.c2kernel.gui.tabs.collection.CollectionView;
import com.c2kernel.gui.tabs.collection.DependencyView;
@@ -19,24 +19,20 @@ import com.c2kernel.utils.Logger; * @version $Revision: 1.36 $ $Date: 2005/10/06 06:51:15 $
* @author $Author: abranson $
*/
-public class CollectionPane extends EntityTabPane implements EntityProxyObserver
+public class CollectionPane extends EntityTabPane implements EntityProxyObserver<Collection<?>>
{
- JTabbedPane collTabs;
-
+ JTabbedPane collTabs;
+
public CollectionPane()
{
super("Collection", "Item Collection");
createLayout();
}
- public void add(C2KLocalObject contents)
+ @Override
+ public void add(Collection<?> contents)
{
Logger.msg(5, "Got "+contents.getName()+": "+contents.getClass().getName());
- if (!(contents instanceof Collection))
- {
- // ignore member control objects
- return;
- }
Logger.msg(7, "Looking for existing "+contents.getName());
CollectionView thisCollView = findTabForCollName(contents.getName());
if (thisCollView == null){
@@ -52,14 +48,15 @@ public class CollectionPane extends EntityTabPane implements EntityProxyObserver thisCollView.setItem((ItemProxy)sourceEntity.getEntity());
collTabs.add(contents.getName(), thisCollView);
}
- thisCollView.setCollection((Collection)contents);
+ thisCollView.setCollection(contents);
}
- public void remove(String id)
+ @Override
+ public void remove(String id)
{
-
+
}
-
+
private CollectionView findTabForCollName(String collName) {
CollectionView thisCollView = null;
for (int i = 0; i < collTabs.getTabCount(); i++) {
@@ -85,16 +82,24 @@ public class CollectionPane extends EntityTabPane implements EntityProxyObserver add(collTabs);
}
+ @Override
public void run()
{
Thread.currentThread().setName("Collection Loader");
- sourceEntity.getEntity().subscribe(this, ClusterStorage.COLLECTION, true);
+ sourceEntity.getEntity().subscribe(new MemberSubscription<Collection<?>>(this, ClusterStorage.COLLECTION, true));
}
-
+
+ @Override
public void reload()
{
Gateway.getStorage().clearCache(sourceEntity.getSysKey(), ClusterStorage.COLLECTION);
collTabs.removeAll();
initForEntity(sourceEntity);
}
+
+ @Override
+ public void control(String control, String msg) {
+ // TODO Auto-generated method stub
+
+ }
}
|
