diff options
| author | abranson <andrew.branson@cern.ch> | 2011-08-04 16:08:49 +0200 |
|---|---|---|
| committer | abranson <andrew.branson@cern.ch> | 2011-08-04 16:08:49 +0200 |
| commit | 379ed8a0e133bee650e0acb24f6b743f657a50d0 (patch) | |
| tree | bdcac37cabe3f2f3d40715519b830469dc9e63ad /source/com/c2kernel/gui/tabs/collection | |
| parent | 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (diff) | |
Last bit of cleanup honest
New castor and dependent commons libs
Diffstat (limited to 'source/com/c2kernel/gui/tabs/collection')
4 files changed, 24 insertions, 19 deletions
diff --git a/source/com/c2kernel/gui/tabs/collection/AggregationView.java b/source/com/c2kernel/gui/tabs/collection/AggregationView.java index 3291906..35cdb11 100644 --- a/source/com/c2kernel/gui/tabs/collection/AggregationView.java +++ b/source/com/c2kernel/gui/tabs/collection/AggregationView.java @@ -7,6 +7,7 @@ import javax.swing.JButton; import javax.swing.JSplitPane;
import com.c2kernel.collection.Aggregation;
+import com.c2kernel.collection.AggregationMember;
import com.c2kernel.collection.Collection;
import com.c2kernel.collection.gui.model.AggregationVertexFactory;
import com.c2kernel.collection.gui.model.AggregationVertexOutlineCreator;
@@ -22,7 +23,7 @@ import com.c2kernel.utils.Resource; * @version $Revision: 1.5 $ $Date: 2006/09/15 15:02:24 $
* @author $Author: abranson $
*/
-public class AggregationView extends CollectionView
+public class AggregationView extends CollectionView<AggregationMember>
{
protected JButton mSaveButton = new JButton(Resource.getImageResource("graph/save.png"));
protected JButton mHistoryButton = new JButton(Resource.getImageResource("graph/history.png"));
@@ -32,8 +33,8 @@ public class AggregationView extends CollectionView // Objects to view/modify the properties of the selected activity
protected PropertyPanel mPropertyPanel;
protected JSplitPane mSplitPane;
- private AggregationVertexFactory mAggregationVertexFactory = new AggregationVertexFactory();
- private AggregationMemberRenderer mAggregationMemberRenderer = new AggregationMemberRenderer();
+ private final AggregationVertexFactory mAggregationVertexFactory = new AggregationVertexFactory();
+ private final AggregationMemberRenderer mAggregationMemberRenderer = new AggregationMemberRenderer();
public AggregationView()
{
super();
@@ -48,7 +49,7 @@ public class AggregationView extends CollectionView }
@Override
- public void setCollection(Collection<?> contents)
+ public void setCollection(Collection<AggregationMember> contents)
{
thisColl = contents;
Aggregation agg = (Aggregation)thisColl;
@@ -82,7 +83,7 @@ public class AggregationView extends CollectionView @Override
public void actionPerformed(ActionEvent ae)
{
- new CollectionHistoryWindow(item, thisColl);
+ new CollectionHistoryWindow(item, (Aggregation)thisColl);
}
});
}
diff --git a/source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java b/source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java index 7cb2753..0f3cc76 100644 --- a/source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java +++ b/source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java @@ -10,6 +10,7 @@ import javax.swing.JScrollPane; import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
+import com.c2kernel.collection.Aggregation;
import com.c2kernel.collection.Collection;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.entity.proxy.EntityProxy;
@@ -33,7 +34,7 @@ public class CollectionHistoryWindow extends JFrame { JTable historyTable;
HistoryTableModel historyModel;
- public CollectionHistoryWindow(ItemProxy item, Collection<?> coll) throws HeadlessException {
+ public CollectionHistoryWindow(ItemProxy item, Aggregation coll) throws HeadlessException {
super("Collection History");
historyModel = new HistoryTableModel(item, coll);
historyTable = new JTable(historyModel);
@@ -48,12 +49,13 @@ public class CollectionHistoryWindow extends JFrame { private class HistoryTableModel extends AbstractTableModel implements EntityProxyObserver<Event> {
ItemProxy item;
- ArrayList<Object> collEvents, collEventData;
- Collection<?> coll;
- public HistoryTableModel(ItemProxy item, Collection<?> coll) {
+ ArrayList<Event> collEvents;
+ ArrayList<Object> collEventData;
+ Aggregation coll;
+ public HistoryTableModel(ItemProxy item, Aggregation coll) {
this.item = item;
this.coll = coll;
- collEvents = new ArrayList<Object>();
+ collEvents = new ArrayList<Event>();
collEventData = new ArrayList<Object>();
item.subscribe(new MemberSubscription<Event>(this, ClusterStorage.HISTORY, true));
}
@@ -78,7 +80,7 @@ public class CollectionHistoryWindow extends JFrame { }
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
- Event ev = (Event)collEvents.get(rowIndex);
+ Event ev = collEvents.get(rowIndex);
switch (columnIndex) {
case 0:
return ev.getTimeString();
@@ -165,8 +167,8 @@ public class CollectionHistoryWindow extends JFrame { if (e.getClickCount()==2) {
int row = historyTable.getSelectedRow();
Object data = historyModel.getEventData(row);
- if (data instanceof Collection) {
- showColl((Collection<?>)data);
+ if (data instanceof Aggregation) {
+ showColl((Aggregation)data);
}
else {
String[] params = (String[])data;
@@ -177,7 +179,7 @@ public class CollectionHistoryWindow extends JFrame { }
}
}
- public void showColl(Collection<?> coll) {
+ public void showColl(Aggregation coll) {
JFrame newFrame = new JFrame();
AggregationView newView = new AggregationView();
newView.setCollection(coll);
diff --git a/source/com/c2kernel/gui/tabs/collection/CollectionView.java b/source/com/c2kernel/gui/tabs/collection/CollectionView.java index 8a97af5..c698430 100644 --- a/source/com/c2kernel/gui/tabs/collection/CollectionView.java +++ b/source/com/c2kernel/gui/tabs/collection/CollectionView.java @@ -3,6 +3,7 @@ package com.c2kernel.gui.tabs.collection; import javax.swing.JPanel;
import com.c2kernel.collection.Collection;
+import com.c2kernel.collection.CollectionMember;
import com.c2kernel.entity.proxy.ItemProxy;
import com.c2kernel.gui.MainFrame;
import com.c2kernel.utils.Logger;
@@ -17,9 +18,9 @@ import com.c2kernel.utils.Logger; **************************************************************************/
-public abstract class CollectionView extends JPanel {
+public abstract class CollectionView<M extends CollectionMember> extends JPanel {
- protected Collection<?> thisColl;
+ protected Collection<M> thisColl;
protected ItemProxy item;
public CollectionView() {
@@ -30,7 +31,7 @@ public abstract class CollectionView extends JPanel { this.item = entity;
}
- public abstract void setCollection(Collection<?> coll);
+ public abstract void setCollection(Collection<M> coll);
protected void saveCollection()
{
diff --git a/source/com/c2kernel/gui/tabs/collection/DependencyView.java b/source/com/c2kernel/gui/tabs/collection/DependencyView.java index 14e2af0..734d315 100644 --- a/source/com/c2kernel/gui/tabs/collection/DependencyView.java +++ b/source/com/c2kernel/gui/tabs/collection/DependencyView.java @@ -4,11 +4,12 @@ import java.awt.GridLayout; import javax.swing.JLabel;
import com.c2kernel.collection.Collection;
+import com.c2kernel.collection.DependencyMember;
/**
* @version $Revision: 1.2 $ $Date: 2005/06/02 12:17:22 $
* @author $Author: abranson $
*/
-public class DependencyView extends CollectionView
+public class DependencyView extends CollectionView<DependencyMember>
{
// Objects to view/modify the properties of the selected activity
@@ -20,7 +21,7 @@ public class DependencyView extends CollectionView }
@Override
- public void setCollection(Collection<?> contents)
+ public void setCollection(Collection<DependencyMember> contents)
{
thisColl = contents;
}
|
