version 1.2, 1999/11/02 14:54:37 |
version 1.4, 1999/11/02 15:10:31 |
|
|
/** |
/** |
* PolyCalc.java $OpenXM$ |
* $OpenXM: OpenXM/src/OpenMath/PolyCalc.java,v 1.3 1999/11/02 15:07:40 tam Exp $ |
*/ |
*/ |
|
|
import JP.ac.kobe_u.math.tam.OpenXM.*; |
import JP.ac.kobe_u.math.tam.OpenXM.*; |
Line 95 class PolyCalc extends Applet{ |
|
Line 95 class PolyCalc extends Applet{ |
|
add(poly2); |
add(poly2); |
} |
} |
|
|
|
|
|
|
public void start(){ |
public void start(){ |
textarea.append("Connecting to "+ host |
textarea.append("Connecting to "+ host |
+"("+ ControlPort +","+ DataPort +")\n"); |
+"("+ ControlPort +","+ DataPort +")\n"); |
|
|
try{ |
try{ |
oxm = new OpenXM(host,ControlPort,DataPort); |
oxm = new OpenXM(host,ControlPort,DataPort); |
|
textarea.append("Connected.\n"); |
}catch(java.io.IOException e){ |
}catch(java.io.IOException e){ |
textarea.append("failed.\n"); |
textarea.append("failed.\n"); |
stop(); |
stop(); |
return; |
|
} |
} |
textarea.append("Connected.\n"); |
|
} |
} |
|
|
|
private static String usage(){ |
|
String ret = ""; |
|
|
|
ret += "usage\t: java PolyCalc [options]\n"; |
|
ret += "options\t:\n"; |
|
ret += "\t -h \t show this message\n"; |
|
ret += "\t -host hostname \t (default localhost)\n"; |
|
ret += "\t -data port \t (default 1300)\n"; |
|
ret += "\t -control port \t (default 1200)\n"; |
|
|
|
return ret; |
|
} |
|
|
|
|
public static void main(String argv[]){ |
public static void main(String argv[]){ |
Frame frame = new Frame("Polynomial Calculator"); |
Frame frame = new Frame("Polynomial Calculator"); |
Applet applet; |
Applet applet; |
Line 117 class PolyCalc extends Applet{ |
|
Line 132 class PolyCalc extends Applet{ |
|
|
|
for(int i=0;i<argv.length;i++){ |
for(int i=0;i<argv.length;i++){ |
if(argv[i].equals("-h")){ |
if(argv[i].equals("-h")){ |
System.out.println(""); |
System.out.print(usage()); |
System.exit(0); |
System.exit(0); |
}else if(argv[i].equals("-host")){ |
}else if(argv[i].equals("-host")){ |
host = argv[++i]; |
host = argv[++i]; |
Line 126 class PolyCalc extends Applet{ |
|
Line 141 class PolyCalc extends Applet{ |
|
}else if(argv[i].equals("-control")){ |
}else if(argv[i].equals("-control")){ |
ControlPort = Integer.valueOf(argv[++i]).intValue(); |
ControlPort = Integer.valueOf(argv[++i]).intValue(); |
}else{ |
}else{ |
System.err.println("unknown option :"+ argv[i]); |
System.err.println("unknown option : "+ argv[i]); |
|
System.err.print(usage()); |
System.exit(1); |
System.exit(1); |
} |
} |
} |
} |