Commit 841d4681 authored by claes's avatar claes

Adapted to j2se 1.5

parent e5f86d08
/*
* Proview $Id: jpwr_rt_hist.cpp,v 1.4 2005-12-14 12:40:50 claes Exp $
* Proview $Id: jpwr_rt_hist.cpp,v 1.5 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -182,7 +182,13 @@ JNIEXPORT jobjectArray JNICALL Java_jpwr_rt_Hist_getHistList
printf(" Fel vid skapande av databashandtag avslutar\n");
goto err;
}
if((ret = dataBaseP->open(dataBaseP, dbName, NULL, DATABASETYPE, DB_RDONLY, 0)) != 0)
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0
ret = dataBaseP->open(dataBaseP, NULL, dbName, NULL, DATABASETYPE, DB_RDONLY, 0);
#else
ret = dataBaseP->open(dataBaseP, dbName, NULL, DATABASETYPE, DB_RDONLY, 0);
#endif
if(ret != 0)
{
/*error opening/creating db send the mess to errh, then exit*/
printf("error db_open: %s\n", db_strerror(ret));
......
/*
* Proview $Id: FlowArray.java,v 1.2 2005-09-01 14:57:50 claes Exp $
* Proview $Id: FlowArray.java,v 1.3 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -27,7 +27,7 @@ import javax.swing.*;
public class FlowArray {
Vector a = new Vector();
Vector<Object> a = new Vector<Object>();
FlowCmn cmn;
public FlowArray( FlowCmn cmn) {
......
/*
* Proview $Id: FlowCmn.java,v 1.2 2005-09-01 14:57:50 claes Exp $
* Proview $Id: FlowCmn.java,v 1.3 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -39,9 +39,9 @@ public class FlowCmn {
double y_high;
double y_low;
Vector a = new Vector();
Vector a_nc = new Vector();
Vector a_cc = new Vector();
Vector<Object> a = new Vector<Object>();
Vector<Object> a_nc = new Vector<Object>();
Vector<Object> a_cc = new Vector<Object>();
public FlowCmn( Object ctx, Gdh gdh, JopSession session) {
this.ctx = ctx;
......
/*
* Proview $Id: FlowVector.java,v 1.2 2005-09-01 14:57:50 claes Exp $
* Proview $Id: FlowVector.java,v 1.3 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -27,7 +27,7 @@ public class FlowVector {
public FlowVector() {
}
public static void open( BufferedReader reader, FlowCmn cmn, Vector a) {
public static void open( BufferedReader reader, FlowCmn cmn, Vector<Object> a) {
String line;
StringTokenizer token;
boolean end = false;
......@@ -44,12 +44,12 @@ public class FlowVector {
case Flow.eSave_NodeClass:
FlowNodeClass nc = new FlowNodeClass( cmn);
nc.open( reader);
a.add( nc);
a.add( (Object) nc);
break;
case Flow.eSave_ConClass:
FlowConClass cc = new FlowConClass( cmn);
cc.open( reader);
a.add( cc);
a.add( (Object) cc);
break;
case Flow.eSave_Node:
FlowNode n = new FlowNode( cmn);
......
/*
* Proview $Id: GeTextField.java,v 1.8 2006-04-24 13:21:46 claes Exp $
* Proview $Id: GeTextField.java,v 1.9 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -29,7 +29,7 @@ import javax.swing.Timer;
public class GeTextField extends JTextField implements GeComponentIfc,
JopDynamic, JopConfirm, ActionListener
{
public boolean isFocusTraversable() { return root != null;}
public boolean isFocusable() { return root != null;}
Dimension size;
Object root;
......
/*
* Proview $Id: HistSearch.java,v 1.2 2005-09-01 14:57:50 claes Exp $
* Proview $Id: HistSearch.java,v 1.3 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -787,7 +787,7 @@ public class HistSearch extends JFrame implements ActionListener
public static void main(String args[]){
HistSearch ASWindow = new HistSearch();
ASWindow.pack();
ASWindow.show();
ASWindow.setVisible(true);
}
......
/*
* Proview $Id: HistStatModel1.java,v 1.2 2005-09-01 14:57:50 claes Exp $
* Proview $Id: HistStatModel1.java,v 1.3 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -27,7 +27,7 @@ import jpwr.rt.*;
public class HistStatModel1 extends AbstractTableModel{
// The List storing the resulting statistics.
public List result;
public List<MhrEvent> result;
private String[][] freqNames={{"Object", "Nr. of alarms" },{"Objekt","Antal larm"}};
int lang;
......@@ -39,7 +39,7 @@ public class HistStatModel1 extends AbstractTableModel{
}
public void clearData(){
result = new ArrayList();
result = new ArrayList<MhrEvent>();
}
public void setData(MhData m){
......@@ -92,11 +92,11 @@ public class HistStatModel1 extends AbstractTableModel{
public void sortData(){
//sortData sorts the result List. Largest number of times found first.
Collections.sort(result, new Comparator(){
public int compare(Object o1, Object o2){
if (((MhrEvent)o1).eventFlags < ((MhrEvent)o2).eventFlags)
Collections.sort(result, new Comparator<MhrEvent>(){
public int compare(MhrEvent o1, MhrEvent o2){
if (o1.eventFlags < o2.eventFlags)
return 1;
else if (((MhrEvent)o1).eventFlags > ((MhrEvent)o2).eventFlags)
else if (o1.eventFlags > o2.eventFlags)
return -1;
else return 0;
}
......
/*
* Proview $Id: HistStatModel2.java,v 1.3 2006-04-24 13:21:46 claes Exp $
* Proview $Id: HistStatModel2.java,v 1.4 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -29,7 +29,7 @@ import jpwr.rt.*;
public class HistStatModel2 extends AbstractTableModel{
// The List holding the statistics
List result;
List<MhrEvent> result;
private String[][] names={{"Object", "Duration time" },{"Objekt", "Varaktighet"}};
int lang;
......@@ -42,7 +42,7 @@ public class HistStatModel2 extends AbstractTableModel{
}
public void clearData(){
result = new ArrayList();
result = new ArrayList<MhrEvent>();
}
public void setData(MhData m){
......@@ -158,10 +158,10 @@ public class HistStatModel2 extends AbstractTableModel{
//eventFlags).Longest duration on top.)
public void sortData(){
Collections.sort(result, new Comparator(){
public int compare(Object o1, Object o2){
if (((MhrEvent)o1).eventFlags < ((MhrEvent)o2).eventFlags) return 1;
else if (((MhrEvent)o1).eventFlags > ((MhrEvent)o2).eventFlags) return -1;
Collections.sort(result, new Comparator<MhrEvent>(){
public int compare(MhrEvent o1, MhrEvent o2){
if (o1.eventFlags < o2.eventFlags) return 1;
else if (o1.eventFlags > o2.eventFlags) return -1;
else return 0;
}
});
......
/*
* Proview $Id: HistTable.java,v 1.3 2006-04-24 13:21:46 claes Exp $
* Proview $Id: HistTable.java,v 1.4 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -180,7 +180,7 @@ public class HistTable extends JScrollPane{
panel.setLayout(new FlowLayout());
panel.add(statistics);
frame.pack();
frame.show();
frame.setVisible(true);
}
......
/*
* Proview $Id: JopConfirmDialog.java,v 1.4 2006-04-24 13:21:46 claes Exp $
* Proview $Id: JopConfirmDialog.java,v 1.5 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -74,8 +74,8 @@ public class JopConfirmDialog {
panel.add( buttonCancel);
dia.getContentPane().add( panel, BorderLayout.SOUTH);
dia.setLocationRelativeTo( par);
// dia.setVisible( true);
dia.show();
dia.setVisible( true);
// dia.show();
}
else {
dia.setLocationRelativeTo( par);
......
/*
* Proview $Id: JopEngine.java,v 1.3 2005-09-01 14:57:50 claes Exp $
* Proview $Id: JopEngine.java,v 1.4 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -35,7 +35,7 @@ import jpwr.rt.*;
public class JopEngine implements ActionListener {
int scanTime;
int animationScanTime;
Vector updateVector;
Vector<Object> updateVector;
Timer timer;
public Gdh gdh;
public LocalDb ldb = null;
......@@ -52,7 +52,7 @@ public class JopEngine implements ActionListener {
public JopEngine( int scantime, Object root) {
scanTime = scantime;
animationScanTime = scantime;
updateVector = new Vector( 50, 50);
updateVector = new Vector<Object>( 50, 50);
timer = new Timer( scantime, this);
timer.start();
gdh = new Gdh( root);
......
/*
* Proview $Id: JopSessionRep.java,v 1.7 2005-11-04 11:45:17 claes Exp $
* Proview $Id: JopSessionRep.java,v 1.8 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -31,7 +31,7 @@ public class JopSessionRep implements JopSessionIfc {
XttTree navigator;
MhFrame alarmList;
JopLoginFrame login;
Vector frames = new Vector();
Vector<Object> frames = new Vector<Object>();
public JopSessionRep() {
}
......@@ -286,7 +286,7 @@ public class JopSessionRep implements JopSessionIfc {
public void openSearch(String object){
HistSearch HSWindow = new HistSearch(object,session );
HSWindow.pack();
HSWindow.show();
HSWindow.setVisible(true);
}
}
......
/*
* Proview $Id: MhTable.java,v 1.3 2005-09-01 14:57:51 claes Exp $
* Proview $Id: MhTable.java,v 1.4 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -931,13 +931,13 @@ public class MhTable extends JPanel
int nrOfAlarms = in.readInt();
if(nrOfAlarms > 0)
{
mhData.alarmVec = (Vector)in.readObject();
mhData.alarmVec = (Vector<MhrEvent>)in.readObject();
((AlarmTableModel)alarmTable.getModel()).updateTable();
}
int nrOfEvents = in.readInt();
if(nrOfEvents > 0)
{
mhData.eventVec = (Vector)in.readObject();
mhData.eventVec = (Vector<MhrEvent>)in.readObject();
((EventTableModel)eventTable.getModel()).updateTable();
}
}
......
/*
* Proview $Id: RatioLayout.java,v 1.3 2006-04-24 13:21:46 claes Exp $
* Proview $Id: RatioLayout.java,v 1.4 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -40,10 +40,10 @@ import java.beans.Beans;
public class RatioLayout implements LayoutManager2 {
// track the ratios for each object of form "xratio,yratio;wratio,hratio"
Vector ratios = new Vector(1);
Vector<Proportion> ratios = new Vector<Proportion>(1);
// track the components also so we can remove associated modifier
// if necessary.
Vector components = new Vector(1);
Vector<Component> components = new Vector<Component>(1);
public void addLayoutComponent(String r, Component comp) {
}
......@@ -72,8 +72,8 @@ public class RatioLayout implements LayoutManager2 {
}
//Reset the Layout
public void invalidateLayout(Container target){
ratios = new Vector(1);
components = new Vector(1);
ratios = new Vector<Proportion>(1);
components = new Vector<Component>(1);
}
......@@ -106,7 +106,13 @@ public class RatioLayout implements LayoutManager2 {
//Layout each component
for (int i = 0 ; i < ncomponents ; i++) {
Component comp = target.getComponent(i);
Proportion compProp=(Proportion)ratios.elementAt(i);
Proportion compProp;
try {
compProp = (Proportion)ratios.elementAt(i);
}
catch (ArrayIndexOutOfBoundsException e){
break;
}
//Set the width and height according to the ratio specified when
//the component was added.
int w = (int)(d.width*compProp.rw);
......
/*
* Proview $Id: XttObj.java,v 1.3 2005-12-06 11:17:01 claes Exp $
* Proview $Id: XttObj.java,v 1.4 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -174,7 +174,7 @@ public class XttObj extends DynamicObj implements JopDynamic
XttObjAttr obj;
String suffix;
GdhrRefObjectInfo ret;
Vector refVec = new Vector();
Vector<String> refVec = new Vector<String>();
for(int i = 0; i < attrVector.size(); i++)
{
obj = ((XttObjAttr)attrVector.get(i));
......@@ -297,10 +297,10 @@ public class XttObj extends DynamicObj implements JopDynamic
if( ((obj.flags & Pwr.mAdef_array) > 0) &&
((obj.flags & Pwr.mAdef_class) <= 0) )
{
Enumeration enum = obj.treeNode.children();
while(enum.hasMoreElements())
Enumeration enm = obj.treeNode.children();
while(enm.hasMoreElements())
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enum.nextElement();
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enm.nextElement();
XttArrayAttr arrayObj = (XttArrayAttr)child.getUserObject();
if(arrayObj.elements == obj.elements)
{
......@@ -312,10 +312,10 @@ public class XttObj extends DynamicObj implements JopDynamic
else if((obj.flags & Pwr.mAdef_class) > 0)
{
/*
Enumeration enum = obj.treeNode.children();
while(enum.hasMoreElements())
Enumeration enm = obj.treeNode.children();
while(enm.hasMoreElements())
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enum.nextElement();
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enm.nextElement();
XttArrayAttr arrayObj = (XttArrayAttr)child.getUserObject();
if(arrayObj.elements == obj.elements)
{
......@@ -361,17 +361,17 @@ public class XttObj extends DynamicObj implements JopDynamic
public void localDynamicClose()
{
Logg.logg("XttObj: localDynamic close_vector", 6);
Vector unref_vec = new Vector();
Vector<PwrtRefId> unref_vec = new Vector<PwrtRefId>();
for(int i = 0; i < attrVector.size(); i++)
{
XttObjAttr obj = (XttObjAttr)attrVector.get(i);
if( ((obj.flags & Pwr.mAdef_array) > 0) &&
((obj.flags & Pwr.mAdef_class) <= 0) )
{
Enumeration enum = obj.treeNode.children();
while(enum.hasMoreElements())
Enumeration enm = obj.treeNode.children();
while(enm.hasMoreElements())
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enum.nextElement();
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enm.nextElement();
XttArrayAttr arrayObj = (XttArrayAttr)child.getUserObject();
if(arrayObj.elements == obj.elements)
{
......@@ -382,10 +382,10 @@ public class XttObj extends DynamicObj implements JopDynamic
else if((obj.flags & Pwr.mAdef_class) > 0)
{
/*
Enumeration enum = obj.treeNode.children();
while(enum.hasMoreElements())
Enumeration enm = obj.treeNode.children();
while(enm.hasMoreElements())
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enum.nextElement();
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enm.nextElement();
XttArrayAttr arrayObj = (XttArrayAttr)child.getUserObject();
if(arrayObj.elements == obj.elements)
{
......
/*
* Proview $Id: XttTree.java,v 1.9 2005-12-06 11:17:01 claes Exp $
* Proview $Id: XttTree.java,v 1.10 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -377,9 +377,9 @@ public class XttTree extends JPanel
return;
}
//anvnds utifall anvndaren angett debug
Vector ref_vec = new Vector();
Vector<String> ref_vec = new Vector<String>();
//anvnds utifall anvndaren angett debug
Vector o_vec = new Vector();
Vector<XttRefObj> o_vec = new Vector<XttRefObj>();
//loopa igenom resultat-vektorn
for(int i = 0; i < v.size(); i++)
......@@ -513,7 +513,7 @@ public class XttTree extends JPanel
Logg.logg("XttTree: Vector == null efter getAllClassAttributes", 4);
return;
}
Vector xttObjAttrVec = new Vector();
Vector<XttObjAttr> xttObjAttrVec = new Vector<XttObjAttr>();
for(int i = 0; i < v.size(); i++)
{
......@@ -822,7 +822,7 @@ public class XttTree extends JPanel
//what we are looking for
TreePath selectedPath = this.tree.getSelectionPath();
Vector pathVec = createPathVec(objectName);
Vector<String> pathVec = createPathVec(objectName);
int ret = 1;
DefaultMutableTreeNode tn = this.rootNode;
TreePath tp;
......@@ -839,9 +839,9 @@ public class XttTree extends JPanel
}
}
public Vector createPathVec(String name)
public Vector<String> createPathVec(String name)
{
Vector pathVec = new Vector();
Vector<String> pathVec = new Vector<String>();
int strIndex;
int i = 0;
strIndex = name.indexOf('-');
......@@ -956,12 +956,12 @@ public class XttTree extends JPanel
XttObj obj = ((XttObj)tn.getUserObject());
if(obj.debug)
{
Vector unref_vec = new Vector();
Vector<PwrtRefId> unref_vec = new Vector<PwrtRefId>();
obj.debug = false;
Enumeration enum = tn.children();
while(enum.hasMoreElements())
Enumeration enm = tn.children();
while(enm.hasMoreElements())
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enum.nextElement();
DefaultMutableTreeNode child = (DefaultMutableTreeNode)enm.nextElement();
XttObj childObj = (XttObj)child.getUserObject();
if(childObj.refObj != null)
{
......@@ -1693,9 +1693,9 @@ public class XttTree extends JPanel
tn.remove(tc);
GdhrRefObjectInfo ret;
XttObjAttr obj = (XttObjAttr)tn.getUserObject();
Vector ref_vec = new Vector();
Vector<String> ref_vec = new Vector<String>();
Vector ret_vec;
Vector attr_vec = new Vector();
Vector<XttArrayAttr> attr_vec = new Vector<XttArrayAttr>();
//qqq borde lggas i egen trd???
for(int j = 0; j < obj.elements; j++)
{
......
/*
* Proview $Id: Gdh.java,v 1.7 2005-12-06 11:17:01 claes Exp $
* Proview $Id: Gdh.java,v 1.8 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -130,7 +130,7 @@ public class Gdh {
return false;
}
public Vector getAllClassAttributes( int classid, PwrtObjid objid_obj )
public Vector<CdhrObjAttr> getAllClassAttributes( int classid, PwrtObjid objid_obj )
{
//System.out.println("getAllClassAttributes" + classid + " " + objid_obj.oix + " " + objid_obj.vid);
//CdhrObjid co = this.classIdToObjid(classid);
......@@ -142,7 +142,7 @@ public class Gdh {
GdhrsAttrDef[] gdhrsAttrDefArr = this.getObjectBodyDef(classid, objid_obj);
Vector v = new Vector();
Vector<CdhrObjAttr> v = new Vector<CdhrObjAttr>();
for(int i = 0;i<gdhrsAttrDefArr.length;i++)
{
if(gdhrsAttrDefArr[i] == null)
......@@ -176,7 +176,7 @@ public class Gdh {
return v;
}
public Vector getAllClassAttributes( String name )
public Vector<CdhrObjAttr> getAllClassAttributes( String name )
{
System.out.println("getAllClassAttributes" + name);
......@@ -191,7 +191,7 @@ public class Gdh {
return this.getAllClassAttributes(this.getObjectClass(this.nameToObjid(name).objid).classId, this.nameToObjid(name).objid );
}
Vector v = new Vector();
Vector<CdhrObjAttr> v = new Vector<CdhrObjAttr>();
for(int i = 0;i<gdhrsAttrDefArr.length;i++)
{
if(gdhrsAttrDefArr[i] == null)
......@@ -229,10 +229,10 @@ public class Gdh {
public Vector getAllSiblings( PwrtObjid objid )
public Vector<CdhrObjid> getAllSiblings( PwrtObjid objid )
{
CdhrObjid sibling = (CdhrObjid)this.getNextSibling(objid);
Vector v = new Vector();
Vector<CdhrObjid> v = new Vector<CdhrObjid>();
while(sibling.oddSts())
{
v.add(sibling);
......@@ -241,7 +241,7 @@ public class Gdh {
return v;
}
public Vector getAllXttSiblings( PwrtObjid objid )
public Vector<GdhrGetXttObj> getAllXttSiblings( PwrtObjid objid )
{
String name = null;
String fullName = null;
......@@ -251,7 +251,7 @@ public class Gdh {
CdhrClassId cdhrClassId;
int sts = 2;
boolean hasChildren = false;
Vector v = new Vector();
Vector<GdhrGetXttObj> v = new Vector<GdhrGetXttObj>();
CdhrObjid classObj;
......@@ -294,7 +294,7 @@ public class Gdh {
}
return v;
}
public Vector getAllXttChildren( PwrtObjid objid )
public Vector<GdhrGetXttObj> getAllXttChildren( PwrtObjid objid )
{
String name = null;
String fullName = null;
......@@ -304,7 +304,7 @@ public class Gdh {
CdhrClassId cdhrClassId;
int sts = 2;
boolean hasChildren = false;
Vector v = new Vector();
Vector<GdhrGetXttObj> v = new Vector<GdhrGetXttObj>();
CdhrObjid classObj;
System.out.println("getAllXttChildren");
......@@ -350,9 +350,9 @@ public class Gdh {
return v;
}
public Vector refObjectInfo_Vector( Vector vec )
public Vector<GdhrRefObjectInfo> refObjectInfo_Vector( Vector vec )
{
Vector retVec = new Vector();
Vector<GdhrRefObjectInfo> retVec = new Vector<GdhrRefObjectInfo>();
for(int i = 0;i < vec.size();i++)
{
//System.out.println("refObjectInfo_vector: " + (String)vec.get(i));
......
/*
* Proview $Id: GdhServer.java,v 1.13 2006-04-24 13:21:46 claes Exp $
* Proview $Id: GdhServer.java,v 1.14 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -98,7 +98,7 @@ public class GdhServer
public final static int __IO_EXCEPTION = 2000;
public final static int __UNREFED = 0;
static ArrayList subscriptions = new ArrayList();
static ArrayList<SubElement> subscriptions = new ArrayList<SubElement>();
static int subscriptionCount = 0;
......@@ -331,7 +331,7 @@ public class GdhServer
private class GdhThread extends Thread
{
Socket clientSocket;
public Vector thSub = new Vector();
public Vector<Sub> thSub = new Vector<Sub>();
int maxConnections;
int threadNumber;
......@@ -634,7 +634,7 @@ public class GdhServer
break;
}
String attrName;
Vector gdhRet = new Vector(vec.size());
Vector<Sub> gdhRet = new Vector<Sub>(vec.size());
for(int j = 0; j < vec.size(); j++)
{
attrName = (String)vec.get(j);
......@@ -1497,7 +1497,7 @@ public class GdhServer
try
{
String name = in.readUTF();
Vector v = gdh.getAllClassAttributes(name);
Vector<CdhrObjAttr> v = gdh.getAllClassAttributes(name);
out.writeObject(v);
out.flush();
}
......@@ -1511,7 +1511,7 @@ public class GdhServer
{
PwrtObjid objid = (PwrtObjid)in.readObject();
CdhrObjid sibling = (CdhrObjid)gdh.getNextSibling(objid);
Vector v = new Vector();
Vector<CdhrObjid> v = new Vector<CdhrObjid>();
while(sibling.oddSts())
{
v.add(sibling);
......@@ -1542,7 +1542,7 @@ public class GdhServer
CdhrClassId cdhrClassId;
int sts = 2;
boolean hasChildren = false;
Vector v = new Vector();
Vector<GdhrGetXttObj> v = new Vector<GdhrGetXttObj>();
CdhrObjid classObj;
cdhrObjId = (CdhrObjid)gdh.getNextSibling(objid);
......@@ -1610,7 +1610,7 @@ public class GdhServer
CdhrClassId cdhrClassId;
int sts = 2;
boolean hasChildren = false;
Vector v = new Vector();
Vector<GdhrGetXttObj> v = new Vector<GdhrGetXttObj>();
CdhrObjid classObj;
......
/*
* Proview $Id: MhData.java,v 1.3 2005-09-01 14:57:52 claes Exp $
* Proview $Id: MhData.java,v 1.4 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -31,16 +31,16 @@ public class MhData
public int maxNrOfAlarms;
public int maxNrOfEvents;
public Vector alarmVec;
public Vector eventVec;
public Vector<MhrEvent> alarmVec;
public Vector<MhrEvent> eventVec;
public MhData(int maxNrOfAlarms, int maxNrOfEvents)
{
this.maxNrOfAlarms = maxNrOfAlarms;
this.maxNrOfEvents = maxNrOfEvents;
this.alarmVec = new Vector(maxNrOfAlarms);
this.eventVec = new Vector(maxNrOfEvents);
this.alarmVec = new Vector<MhrEvent>(maxNrOfAlarms);
this.eventVec = new Vector<MhrEvent>(maxNrOfEvents);
}
public int getNrOfAlarms()
{
......@@ -58,9 +58,9 @@ public class MhData
{
return (MhrEvent)eventVec.get(i);
}
public void addMessToVectorInSortedOrder(Vector v, MhrEvent ev)
public void addMessToVectorInSortedOrder(Vector<MhrEvent> v, MhrEvent ev)
{
ListIterator iter = v.listIterator();
ListIterator<MhrEvent> iter = v.listIterator();
MhrEvent vEv;
while(iter.hasNext())
{
......
/*
* Proview $Id: Gdh.java,v 1.9 2005-12-06 11:17:01 claes Exp $
* Proview $Id: Gdh.java,v 1.10 2006-06-14 10:41:53 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -96,7 +96,7 @@ public class Gdh
Socket gdhSocket;
ObjectOutputStream out;
ObjectInputStream in;
Vector subscriptions = new Vector();
Vector<Sub> subscriptions = new Vector<Sub>();
int subscriptionCount = 0;
boolean listSent = false;
int subLate = 0;
......@@ -560,7 +560,7 @@ public class Gdh
out.writeObject(vec);
out.flush();
Vector retVec = (Vector)in.readObject();
Vector<GdhrRefObjectInfo> retVec = (Vector<GdhrRefObjectInfo>)in.readObject();
if(retVec == null)
{
locked = false;
......@@ -590,7 +590,7 @@ public class Gdh
System.out.println("REF_OBJECT_INFO_VECTOR: IO_Exception");
locked = false;
notify();
Vector retVec = new Vector();
Vector<GdhrRefObjectInfo> retVec = new Vector<GdhrRefObjectInfo>();
retVec.add(new GdhrRefObjectInfo(null, 0, __IO_EXCEPTION, 0));
return retVec;
}
......@@ -861,7 +861,7 @@ public class Gdh
out.writeInt(refid.nid);
}
out.flush();
Vector ret_vec = new Vector();
Vector<PwrtStatus> ret_vec = new Vector<PwrtStatus>();
//System.out.println("unrefObjectInfo_VEctor i: " + i);
while(i > 0)
{
......
#! /bin/bash
#
# Proview $Id: ge_javac.sh,v 1.4 2005-09-01 14:57:49 claes Exp $
# Proview $Id: ge_javac.sh,v 1.5 2006-06-14 10:42:48 claes Exp $
# Copyright (C) 2005 SSAB Oxelsund AB.
#
# This program is free software; you can redistribute it and/or
......@@ -27,7 +27,7 @@ systemname=$3
if [ $function == "java_web" ]; then
jarfile="$pwrp_web/pwrp_"$systemname"_web.jar"
if javac -d $pwrp_web -classpath $pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar:$jarfile $pwrp_pop/$src_file
if javac -d $pwrp_web -classpath $pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar:$pwr_lib/pwr_jopc.jar:$jarfile $pwrp_pop/$src_file
then
echo "-- $src_file compiled"
if [ ! -e $jarfile ]; then
......@@ -63,7 +63,7 @@ if [ $function == "java" ]; then
jarfile="$pwrp_lib/pwrp_"$systemname".jar"
jarfileweb="$pwrp_web/pwrp_"$systemname"_web.jar"
if javac -d $pwrp_web -classpath $pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar:$jarfile $pwrp_pop/$src_file
if javac -d $pwrp_web -classpath $pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar:$pwr_lib/pwr_jopc.jar:$jarfile $pwrp_pop/$src_file
then
echo "-- $src_file compiled"
if [ ! -e $jarfile ]; then
......
......@@ -125,14 +125,9 @@ $(export_lib) : $(objects)
$(rm) $(export_lib); \
fi
@ cd $(pwre_broot)/$(pwre_target)/bld; \
if ls jpwr/$(comp_name)/*.gif >/dev/null 2>/dev/null; then \
echo "Inserting gif files"; \
jar cf $(export_lib) jpwr/$(comp_name)/*.class jpwr/$(comp_name)/*.gif; \
else \
echo "No gif files found"; \
jar cf $(export_lib); \
find jpwr/$(comp_name) -name "*.class" -exec jar uf $(export_lib) {} \;;\
fi
echo "Inserting gif files"; \
jar cf $(export_lib) jpwr/$(comp_name)/*.gif; \
find jpwr/$(comp_name) -name "*.class" -exec jar uf $(export_lib) {} \;;
# @ jar cvfm $(export_lib) ../../manifest.stub jpwr/$(comp_name)/*.class jpwr/$(comp_name)/*.gif
#-include $(source_dependencies)
......
......@@ -184,7 +184,7 @@ $(inc_dir)/%.hpp : %.hpp
$(bld_dir)/%.class : %.java
@ $(log_java_class)
@ $(javac) -d $(pwre_broot)/$(pwre_target)/bld $(source)
@ $(javac) -Xlint:unchecked,deprecation -d $(pwre_broot)/$(pwre_target)/bld $(source)
$(bld_dir)/%.gif : %.gif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment