summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/gui/tabs
diff options
context:
space:
mode:
authorabranson <andrew.branson@cern.ch>2011-08-04 16:08:49 +0200
committerabranson <andrew.branson@cern.ch>2011-08-04 16:08:49 +0200
commit379ed8a0e133bee650e0acb24f6b743f657a50d0 (patch)
treebdcac37cabe3f2f3d40715519b830469dc9e63ad /source/com/c2kernel/gui/tabs
parent0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (diff)
Last bit of cleanup honest
New castor and dependent commons libs
Diffstat (limited to 'source/com/c2kernel/gui/tabs')
-rw-r--r--source/com/c2kernel/gui/tabs/CollectionPane.java28
-rw-r--r--source/com/c2kernel/gui/tabs/ViewpointPane.java11
-rw-r--r--source/com/c2kernel/gui/tabs/collection/AggregationView.java11
-rw-r--r--source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java20
-rw-r--r--source/com/c2kernel/gui/tabs/collection/CollectionView.java7
-rw-r--r--source/com/c2kernel/gui/tabs/collection/DependencyView.java5
-rw-r--r--source/com/c2kernel/gui/tabs/execution/ActivityViewer.java2
-rw-r--r--source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java2
-rw-r--r--source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java5
-rw-r--r--source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java4
-rw-r--r--source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java10
11 files changed, 55 insertions, 50 deletions
diff --git a/source/com/c2kernel/gui/tabs/CollectionPane.java b/source/com/c2kernel/gui/tabs/CollectionPane.java
index 7511a97..a8abfcd 100644
--- a/source/com/c2kernel/gui/tabs/CollectionPane.java
+++ b/source/com/c2kernel/gui/tabs/CollectionPane.java
@@ -5,6 +5,7 @@ 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;
@@ -19,7 +20,7 @@ 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<?>>
+public class CollectionPane extends EntityTabPane implements EntityProxyObserver<Collection<? extends CollectionMember>>
{
JTabbedPane collTabs;
@@ -30,16 +31,22 @@ public class CollectionPane extends EntityTabPane implements EntityProxyObserver
}
@Override
- public void add(Collection<?> contents)
+ 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 thisCollView = findTabForCollName(contents.getName());
+ CollectionView<? extends CollectionMember> thisCollView = findTabForCollName(contents.getName());
if (thisCollView == null){
- if (contents instanceof Aggregation)
- thisCollView = new AggregationView();
- else if (contents instanceof Dependency)
- thisCollView = new DependencyView();
+ 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;
@@ -48,7 +55,6 @@ public class CollectionPane extends EntityTabPane implements EntityProxyObserver
thisCollView.setItem((ItemProxy)sourceEntity.getEntity());
collTabs.add(contents.getName(), thisCollView);
}
- thisCollView.setCollection(contents);
}
@Override
@@ -57,12 +63,12 @@ public class CollectionPane extends EntityTabPane implements EntityProxyObserver
}
- private CollectionView findTabForCollName(String collName) {
- CollectionView thisCollView = null;
+ 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)collTabs.getComponentAt(i);
+ thisCollView = (CollectionView<? extends CollectionMember>)collTabs.getComponentAt(i);
}
}
return thisCollView;
diff --git a/source/com/c2kernel/gui/tabs/ViewpointPane.java b/source/com/c2kernel/gui/tabs/ViewpointPane.java
index a0f63ab..a793e5d 100644
--- a/source/com/c2kernel/gui/tabs/ViewpointPane.java
+++ b/source/com/c2kernel/gui/tabs/ViewpointPane.java
@@ -441,7 +441,7 @@ public class ViewpointPane extends EntityTabPane implements ItemListener, Action
// we don't really remove viewpoints
}
- class EventItem implements Comparable<Object> {
+ class EventItem implements Comparable<EventItem> {
public int eventId;
public int schemaVersion;
public ArrayList<String> viewNames = new ArrayList<String>();
@@ -500,12 +500,9 @@ public class ViewpointPane extends EntityTabPane implements ItemListener, Action
}
@Override
- public int compareTo(Object o) {
- if (o instanceof EventItem) {
- EventItem other = (EventItem)o;
- if (other.eventId < eventId) return 1;
- if (other.eventId > eventId) return -1;
- }
+ public int compareTo(EventItem other) {
+ if (other.eventId < eventId) return 1;
+ if (other.eventId > eventId) return -1;
return 0;
}
}
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;
}
diff --git a/source/com/c2kernel/gui/tabs/execution/ActivityViewer.java b/source/com/c2kernel/gui/tabs/execution/ActivityViewer.java
index b6ef7f8..73e9612 100644
--- a/source/com/c2kernel/gui/tabs/execution/ActivityViewer.java
+++ b/source/com/c2kernel/gui/tabs/execution/ActivityViewer.java
@@ -43,7 +43,7 @@ public class ActivityViewer extends JPanel implements Runnable {
JLabel noOutcome = new JLabel(Language.translate("No outcome data is required for this activity"));
ExecutionPane parent;
JLabel status;
- JComboBox<?> executors;
+ JComboBox<Executor> executors;
JButton saveButton = new JButton("Save");
JButton loadButton = new JButton("Load");
GridBagLayout gridbag = new GridBagLayout();
diff --git a/source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java b/source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java
index 7477ecd..3bfe3fd 100644
--- a/source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java
+++ b/source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java
@@ -3,7 +3,6 @@ import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
-import java.util.ArrayList;
import javax.swing.JLabel;
import javax.swing.JTabbedPane;
@@ -25,7 +24,6 @@ public class DataRecord extends OutcomeStructure implements ChangeListener {
AttributeList myAttributes;
JTabbedPane DRPanel = null;
boolean deferred;
- ArrayList<?> deferredChildren = new ArrayList<Object>();
Document parentDoc;
GridBagConstraints position;
GridBagLayout gridbag;
diff --git a/source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java b/source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java
index 6d20183..63c1d3d 100644
--- a/source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java
+++ b/source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java
@@ -6,7 +6,6 @@ import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URL;
-import java.util.Enumeration;
import javax.swing.Box;
import javax.swing.JComponent;
@@ -275,9 +274,9 @@ public class OutcomePanel extends JPanel implements OutcomeHandler
ElementDecl rootElementDecl = null;
docElement = (outcomeDOM == null) ? null : outcomeDOM.getDocumentElement();
- for (Enumeration<?> globalElements = schemaSOM.getElementDecls(); globalElements.hasMoreElements();)
+ for (ElementDecl elementDecl: schemaSOM.getElementDecls())
{
- rootElementDecl = (ElementDecl) globalElements.nextElement();
+ rootElementDecl = elementDecl;
// REVISIT: We don't detect which is the most likely root element if there is more than one root decl
// xmlspy looks for an element not referenced elsewhere. simple but hard
// if we already have a document then use its root element to find the right decl
diff --git a/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java b/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java
index ef56046..58b2c37 100644
--- a/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java
+++ b/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java
@@ -86,9 +86,9 @@ public class ComboField extends StringEditField {
// TODO: should be ANDed with above results
if (content.hasFacet(Facet.ENUMERATION)) {
//ListOfValues andList = new ListOfValues();
- Enumeration<?> enums = content.getFacets(Facet.ENUMERATION);
+ Enumeration<Facet> enums = content.getFacets(Facet.ENUMERATION);
while (enums.hasMoreElements()) {
- Facet thisEnum = (Facet)enums.nextElement();
+ Facet thisEnum = enums.nextElement();
vals.put(thisEnum.getValue(), thisEnum.getValue(), false);
}
}
diff --git a/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java b/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java
index a9b55a4..5f6a384 100644
--- a/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java
+++ b/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java
@@ -62,12 +62,12 @@ public class StringEditField implements FocusListener, DomainKeyConsumer {
// is a combobox
if (type.hasFacet(Facet.ENUMERATION))
return new ComboField(type, null);
- //find LOVscript
- Enumeration<?> e = type.getAnnotations();
+ //find LOVscript TODO: Implement LOV
+ Enumeration<Annotation> e = type.getAnnotations();
while (e.hasMoreElements()) {
- Annotation note = (Annotation)e.nextElement();
- for (Enumeration<?> f = note.getAppInfo(); f.hasMoreElements();) {
- AppInfo thisAppInfo = (AppInfo)f.nextElement();
+ Annotation note = e.nextElement();
+ for (Enumeration<AppInfo> f = note.getAppInfo(); f.hasMoreElements();) {
+ AppInfo thisAppInfo = f.nextElement();
for (Enumeration<?> g = thisAppInfo.getObjects(); g.hasMoreElements();) {
AnyNode appInfoNode = (AnyNode)g.nextElement();
if (appInfoNode.getLocalName().equals("ScriptList")