From 603599544c1720e796dc622c98e5ca0fd22b8e17 Mon Sep 17 00:00:00 2001
From: jestin
Date: Tue, 7 Jan 2003 17:13:08 +0000
Subject: Adaptés à une plus vieille JDK
---
examples/Counter.java | 16 ++++++++++-----
examples/Makefile | 51 ++++++++++++++++++++++++++++++++++++++--------
examples/TestIvySwing.java | 16 ++++++++++-----
3 files changed, 64 insertions(+), 19 deletions(-)
(limited to 'examples')
diff --git a/examples/Counter.java b/examples/Counter.java
index a1dffd1..34ae576 100644
--- a/examples/Counter.java
+++ b/examples/Counter.java
@@ -1,20 +1,25 @@
/**
- * Yet another Ivy java program example
+ * Counter:Yet another Ivy java program example.
+ *
+ * @author Yannick Jestin
+ * @author http://www.tls.cena.fr/products/ivy/
*
* a software bus message "geiger counter" displaying each and every second
* the number of messages sent on the bus during the past second, the past ten
* seconds and the past minute.
*
- * @author Yannick Jestin
- * @author http://www.tls.cena.fr/products/ivy/
- *
* (c) CENA 1998-2003
* This program is provided as is, under the LGPL licence with the ivy-java
* package.
*
+ * New:
+ * 1.2.3: use of Vector.addElement instead of add() and the old Properties
+ * model
+ *
*/
import fr.dgac.ivy.* ;
import gnu.getopt.Getopt ;
+import java.util.*;
/**
* A program to count to the Ivy software bus messages.
@@ -92,7 +97,8 @@ public class Counter implements IvyMessageListener, Runnable {
domain=opt.getOptarg();
break;
case 'd':
- System.setProperty("IVY_DEBUG","yesla!");
+ Properties sysProp = System.getProperties();
+ sysProp.put("IVY_DEBUG","yes");
break;
case 'h':
default:
diff --git a/examples/Makefile b/examples/Makefile
index 844cab7..d4326ad 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -1,19 +1,52 @@
-# Be sure to set this before compiling ...
-JIKESPATH = /usr/local/j2sdk1.4.1/jre/lib/rt.jar:../lib/ivy-java.jar:/usr/share/java/repository:nanoxml-2.2.1.jar:.
-JAVACOPTS = -deprecation
.SUFFIXES: .java .class
SRCS = TestIvy.java TestIvySwing.java Counter.java ivyTranslater.java Translate.java TranslateXML.java
OBJS = $(SRCS:.java=.class)
- JAVAC = jikes -classpath $(JIKESPATH) -d .
- #JAVAC = javac
+#
+# Be sure to choose on of them before compiling ...
+
+#######################################
+# jikes setup on my box
+#######################################
+# RTPATH = /usr/lib/j2re1.3/lib/rt.jar
+# RTPATH = /usr/local/j2sdk1.4.1/jre/lib/rt.jar
+#JIKESPATH = ${RTPATH}:/usr/share/java/gnu.getopt.jar:/usr/share/java/repository
+#JAVACOPTS = -d . -deprecation
+# JAVAC = jikes -classpath $(JIKESPATH)
+
+#######################################
+# generic setup
+#######################################
+# JAVAC = javac
+#JAVACOPTS = -d . -deprecation
+#CLASSPATH =
+
+#######################################
+# blackdown jdk118 setup
+#######################################
+# JAVAC = /usr/local/jdk118_v3/bin/javac
+#CLASSPATH = -classpath .:/usr/local/jdk118_v3/lib/classes.zip:/home/jestin/java/Jars/swingall.jar
+#JAVACOPTS = -d .
+
+######################################
+# local Blackdown linux 1.2.2
+######################################
+#CLASSPATH = -classpath .
+#JAVACOPTS = -deprecation -d .
+# JAVAC = /usr/local/jdk1.2.2/bin/javac
+
+######################################
+# local Blackdown linux 1.3.1
+######################################
+CLASSPATH = -classpath .
+JAVACOPTS = -deprecation
+JAVAOPTS =
+JAVA = /usr/local/j2sdk1.3.1/bin/java
+JAVAC = /usr/local/j2sdk1.3.1/bin/javac
.java.class:
- $(JAVAC) $<
+ $(JAVAC) $(JAVACOPTS) $(CLASSPATH) $<
all: $(OBJS)
clean:
/bin/rm -f -- $(OBJS) *~ *.bak *.class
-
-path:
- @echo "setenv CLASSPATH $(JIKESPATH)"
diff --git a/examples/TestIvySwing.java b/examples/TestIvySwing.java
index ee265a5..e7a9315 100644
--- a/examples/TestIvySwing.java
+++ b/examples/TestIvySwing.java
@@ -1,13 +1,17 @@
/**
* TestIvySwing, a swing Ivy Java example to probe the Ivy software bus.
*
- * it relies on the Swing toolkit, which is not standard on jdk1.1 platforms,
- * if you don't have swing, your can use TestIvy.
- *
* @author Yannick Jestin
* @author http://www.tls.cena.fr/products/ivy/
*
* (c) CENA
+ *
+ * it relies on the Swing toolkit, which is not standard on jdk1.1 platforms,
+ * if you don't have swing, your can use TestIvy.
+ *
+ * New:
+ * 1.2.3: use of Vector.addElement instead of add() and the old Properties
+ * model
*
*/
import java.awt.BorderLayout;
@@ -15,6 +19,7 @@ import java.awt.event.*;
import javax.swing.* ;
import gnu.getopt.Getopt ;
import fr.dgac.ivy.*;
+import java.util.*;
class TestIvySwing extends JPanel implements IvyApplicationListener {
@@ -48,7 +53,7 @@ class TestIvySwing extends JPanel implements IvyApplicationListener {
// initialize the domainlist
domainList = new java.util.Vector();
for (int i = 0; i