summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/gui/tabs/CollectionPane.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2012-05-30 08:37:45 +0200
committerAndrew Branson <andrew.branson@cern.ch>2012-05-30 08:37:45 +0200
commitb086f57f56bf0eb9dab9cf321a0f69aaaae84347 (patch)
tree8e6e26e8b7eed6abad7a17b093bdbb55c5e6b1ba /source/com/c2kernel/gui/tabs/CollectionPane.java
parent22088ae8d2d5ff390518dbe1c4372325ffb3a647 (diff)
Initial Maven Conversion
Diffstat (limited to 'source/com/c2kernel/gui/tabs/CollectionPane.java')
-rw-r--r--source/com/c2kernel/gui/tabs/CollectionPane.java109
1 files changed, 0 insertions, 109 deletions
diff --git a/source/com/c2kernel/gui/tabs/CollectionPane.java b/source/com/c2kernel/gui/tabs/CollectionPane.java
deleted file mode 100644
index 4d9092e..0000000
--- a/source/com/c2kernel/gui/tabs/CollectionPane.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package com.c2kernel.gui.tabs;
-import java.awt.GridBagConstraints;
-
-import javax.swing.JTabbedPane;
-
-import com.c2kernel.collection.Aggregation;
-import com.c2kernel.collection.Collection;
-import com.c2kernel.collection.CollectionMember;
-import com.c2kernel.collection.Dependency;
-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;
-import com.c2kernel.persistency.ClusterStorage;
-import com.c2kernel.process.Gateway;
-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<Collection<? extends CollectionMember>>
-{
- JTabbedPane collTabs;
-
- public CollectionPane()
- {
- super("Collection", "Item Collection");
- createLayout();
- }
-
- @Override
- public void add(Collection<? extends CollectionMember> contents)
- {
- Logger.msg(5, "Got "+contents.getName()+": "+contents.getClass().getName());
- Logger.msg(7, "Looking for existing "+contents.getName());
- CollectionView<? extends CollectionMember> thisCollView = findTabForCollName(contents.getName());
- if (thisCollView == null){
- if (contents instanceof Aggregation) {
- AggregationView thisAggView = new AggregationView();
- thisAggView.setCollection((Aggregation)contents);
- thisCollView = thisAggView;
- }
- else if (contents instanceof Dependency) {
- DependencyView thisDepView = new DependencyView();
- thisDepView.setCollection((Dependency)contents);
- thisCollView = thisDepView;
- }
- else {
- Logger.error("Collection type "+contents.getClass().getName()+" not known");
- return;
- }
- Logger.msg(3, "Adding new "+thisCollView.getClass().getName());
- thisCollView.setItem((ItemProxy)sourceEntity.getEntity());
- collTabs.add(contents.getName(), thisCollView);
- }
- }
-
- @Override
- public void remove(String id)
- {
-
- }
-
- private CollectionView<? extends CollectionMember> findTabForCollName(String collName) {
- CollectionView<? extends CollectionMember> thisCollView = null;
- for (int i = 0; i < collTabs.getTabCount(); i++) {
- String tabName = collTabs.getTitleAt(i);
- if (tabName.equals(collName)) {
- thisCollView = (CollectionView<? extends CollectionMember>)collTabs.getComponentAt(i);
- }
- }
- return thisCollView;
- }
-
- protected void createLayout()
- {
- initPanel();
- // Add the collection tab pane
- getGridBagConstraints();
- c.gridx = 0;
- c.gridy = 1;
- c.fill = GridBagConstraints.BOTH;
- c.weighty = 2.0;
- collTabs = new JTabbedPane();
- gridbag.setConstraints(collTabs, c);
- add(collTabs);
- }
-
- @Override
- public void run()
- {
- Thread.currentThread().setName("Collection Loader");
- 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) {
- }
-}