changes for optionally building with rxtx instead of just javacomm

This commit is contained in:
benfry
2003-08-03 18:29:49 +00:00
parent 151cc290be
commit aed9c8dfb0
3 changed files with 21 additions and 4 deletions

View File

@@ -29,13 +29,18 @@ import java.io.*;
import java.net.*;
import java.util.*;
import java.util.zip.*;
import javax.comm.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.undo.*;
#ifndef RXTX
import javax.comm.*;
#else
import gnu.io.*;
#endif
#ifdef MACOS
import com.apple.mrj.*;
#endif
@@ -824,7 +829,7 @@ public class PdeBase extends Frame
}
}
} catch (UnsatisfiedLinkError e) {
//e.printStackTrace();
e.printStackTrace();
problem = true;
} catch (Exception e) {
@@ -833,7 +838,7 @@ public class PdeBase extends Frame
}
if (serialMenu.getItemCount() == 0) {
//System.out.println("dimming serial menu");
System.out.println("dimming serial menu");
serialMenu.setEnabled(false);
}
@@ -842,6 +847,7 @@ public class PdeBase extends Frame
// correct lib, but it's at least one that's loaded inside
// the javacomm solaris stuff, which is the .jar that's included
// with the osx release (and rxtx takes over)
/*
if (platform == MACOSX) {
try {
System.loadLibrary("SolarisSerialParallel");
@@ -850,6 +856,7 @@ public class PdeBase extends Frame
problem = true;
}
}
*/
// only warn them if this is the first time
if (problem && firstTime) {

View File

@@ -35,7 +35,11 @@ public class PdePreprocessor {
static final String application_imports[] = {
"java.applet", "java.awt", "java.awt.image", "java.awt.event",
"java.io", "java.net", "java.text", "java.util", "java.util.zip",
#ifndef RXTX
"javax.comm",
#else
"gnu.io",
#endif
// if jdk14 defined, jdk13 will be as well
#ifdef JDK13

View File

@@ -27,6 +27,12 @@ import java.awt.*; // for window
import java.awt.event.*; // also for window
import java.io.*;
#ifndef RXTX
import javax.comm.*;
#else
import gnu.io.*;
#endif
public class PdeRuntime implements PdeMessageConsumer {
@@ -83,7 +89,7 @@ public class PdeRuntime implements PdeMessageConsumer {
applet.serialProperties(PdeBase.properties);
applet.init();
if (applet.exception != null) {
if (applet.exception instanceof javax.comm.PortInUseException) {
if (applet.exception instanceof PortInUseException) {
throw new PdeException("Another program is already " +
"using the serial port.");
} else {