T
Tobias Dichtl
Strange behaviour: My java applet (compiled on a unix system)
runs quite fast under sun/linux/freebsd and even mac-os.
Only when using "Sun JRE" on Windows PCs it slows down
to hardly doing anything. The applet is using a remote method
invocation scheme to start a c-executable on a solaris machine.
Most of you will say - isn't it great that way? But I'm reliant
on people using the applet on windows computers. I don't have
clue - any help appreciated. Thanks in advance!
Applet can be found here:
http://www.lrs.eei.uni-erlangen.de/project/kvs/
(can't paste everything - hope this helps...)
---------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.rmi.*;
import java.io.*;
import java.awt.print.*;
public class kvs extends Applet implements ItemListener, Kvs_Interface,
ServerInterface,ActionListener{
public static final String HOST =
"//www.lrs.eei.uni-erlangen.de:51099/KVSServer";
public static final long lFileExtension =
Math.round(Math.random()*100000);
public static final String FILE =
"/home/kvs_test/kvsausgabe"+lFileExtension+".txt";
private final String COVER = "/home/kvs_test/cover";
private Choice choice1 = new Choice();
private Choice choice2zoom = new Choice();
private Checkbox cb1;
private Checkbox cb2;
private Checkbox cb3;
public int iErrorIdentifier=0;
private int iOldItemState;
private int iOldZoomfactor;
private int iAlreadyExecuted=0;
private int iResultRows;
private int iResultColumns;
public int kmf_number;
public int dmf_number;
private int erase_all=0;
private int iMintermsAreExisting=0;
private int beginn=0;
private int iClearTheField=1;
public int iZoomfactor=1;
public int iZahlAktiv;
public int iZoomed=0; //will be 1 of
zoomfactor is changed
public int[] iTermIsExisting= new int[32];
public int zeilen=1;
public int spalten=1;
public int verbose=1;
public int LabelAktiviert=0;
public int iGrantPrinting=1;
public int wArt=0;
private Font font=new Font("Monospaced",Font.BOLD,12);
private Font font3=new Font("Serif",Font.PLAIN,14);
private Label label41=new Label(" Alle Terme");
private Label label42=new Label(" Kernterme");
private Label label43=new Label(" Minimalloesung");
public String [][]auswertArray = new String[4][8];
public String [][]array3=new String[4][8];
public String [][]array1=new String[4][8];
public String [][]array2=new String[4][8];
public String []split_terms= new String[32];
public String outputFileContent="";
public String inputFileContent="";
public String []terme=new String[32]; //e.g. -10, 11,
-00--, ... (as read from file)
public String sStringActive;
public byte[] byteBuffer_In;
public byte[] byteBuffer;
private ServerInterface inf;
private Single_fields[][] s;
private termsToSelect[] termSelect;
private Single_Canvas xCanvas;
private Kmfdmf kmfdmf = new Kmfdmf("LBL",
(Kvs_Interface)this,iErrorIdentifier);
public Kmfdmf kmf;
public Kmfdmf dmf;
private Result_function rfResultFunctionWindow;
public Result_graph rgResultGraphWindow;
public Error_Window error1;
private Frame frame;
private ScrollPane sp;
private Panel pMiddlePanel=new Panel();
private Panel panel1=new Panel();
private Panel panel2zoom=new Panel(); //panel for
zoomfactor
private Panel panel3clearundo=new Panel();
private Panel panel4legende=new Panel(); //panel for
colors of solving steps
private Panel panelX=new Panel(); //panel for the
9 buttons downwards
private Panel bl_north=new Panel();
private Panel bl_center=new Panel();
private Panel bl_north_01=new Panel();
private Panel bl_n_left=new Panel();
private Panel bl_n_right=new Panel();
private Panel panel_in_bl_n_left=new Panel();
private Panel panel_for_terms=new Panel();
private Panel TermMasterPanel=new Panel();
private Panel left_right=new Panel();
private Panel printpanel=new Panel();
private Panel panel5check1=new Panel();
private Panel panel5check2=new Panel();
private Panel panel5check3=new Panel();
private Button printButton=new Button(" Ausdruck von... ");
// private Button button_left=new Button(" Left ");
// private Button button_right=new Button(" Right ");
private Button button_clear=new Button(" Loeschen ");
// private Button button_undo=new Button(" Undo ");
public String[][]labels={{" Primimplikate "," Kernimplikate ","
KMF "," "},
{" Primimplikanten "," Kernimplikanten ","
DMF "," "}};
public
String[][]codierung={{"00000","00001","00101","00100","10100","10101","10001","10000"},
{"00010","00011","00111","00110","10110","10111","10011","10010"},
{"01010","01011","01111","01110","11110","11111","11011","11010"},
{"01000","01001","01101","01100","11100","11101","11001","11000"}};
/************************ INITAPPLET ****************************/
/**
* Connecting to server on port 51099
*/
private void initApplet(){
try{
inf = (ServerInterface)Naming.lookup(HOST);
if (verbose==1){
System.out.println("Naming.lookup("+HOST+") erfolgreich!");
}
}
catch (Exception e){
if (verbose==1){
System.out.println("+++ Keine Verbindung zu "+HOST+" +++");
e.printStackTrace();
}
iErrorIdentifier=22;
error1=new Error_Window(iErrorIdentifier,(Kvs_Interface)this);
iErrorIdentifier=0;
}
}
public void start(){
this.setVisible(true);
}
public void stop(){
this.setVisible(false);
}
/*************************** INIT *******************************/
/**
* Initializes the applet, gets the size of the browsers frame, initializes
* a new SecurityManager and sets the starting layout.
*/
public void init(){
if (getSize().width<1500){
setSize(1500,4000);
}else{
setSize(getSize().width,4000);
}
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager() );
}
Object anchorpoint = getParent();
while (! (anchorpoint instanceof Frame) ){
anchorpoint = ( (Component)anchorpoint).getParent();
}
frame = (Frame)anchorpoint;
initApplet();
this.setForeground(Color.black);
// this.setFont(font);
kmf_number=0;
dmf_number=10;
bl_north.setLayout(new FlowLayout(FlowLayout.LEFT,30,0));
bl_north_01.setLayout(new BorderLayout());
bl_center.setLayout(new BorderLayout());
TermMasterPanel.setLayout(new BorderLayout());
panel_for_terms.setLayout(new
FlowLayout(FlowLayout.LEFT));//8,4,1,1));
setLayout(new BorderLayout());
panel_in_bl_n_left.setLayout(new BorderLayout());
bl_n_left.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
bl_n_right.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
startLayout();
newLayout(11,2,iClearTheField);
this.setVisible(true);
System.out.println(FILE);
}
runs quite fast under sun/linux/freebsd and even mac-os.
Only when using "Sun JRE" on Windows PCs it slows down
to hardly doing anything. The applet is using a remote method
invocation scheme to start a c-executable on a solaris machine.
Most of you will say - isn't it great that way? But I'm reliant
on people using the applet on windows computers. I don't have
clue - any help appreciated. Thanks in advance!
Applet can be found here:
http://www.lrs.eei.uni-erlangen.de/project/kvs/
(can't paste everything - hope this helps...)
---------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.rmi.*;
import java.io.*;
import java.awt.print.*;
public class kvs extends Applet implements ItemListener, Kvs_Interface,
ServerInterface,ActionListener{
public static final String HOST =
"//www.lrs.eei.uni-erlangen.de:51099/KVSServer";
public static final long lFileExtension =
Math.round(Math.random()*100000);
public static final String FILE =
"/home/kvs_test/kvsausgabe"+lFileExtension+".txt";
private final String COVER = "/home/kvs_test/cover";
private Choice choice1 = new Choice();
private Choice choice2zoom = new Choice();
private Checkbox cb1;
private Checkbox cb2;
private Checkbox cb3;
public int iErrorIdentifier=0;
private int iOldItemState;
private int iOldZoomfactor;
private int iAlreadyExecuted=0;
private int iResultRows;
private int iResultColumns;
public int kmf_number;
public int dmf_number;
private int erase_all=0;
private int iMintermsAreExisting=0;
private int beginn=0;
private int iClearTheField=1;
public int iZoomfactor=1;
public int iZahlAktiv;
public int iZoomed=0; //will be 1 of
zoomfactor is changed
public int[] iTermIsExisting= new int[32];
public int zeilen=1;
public int spalten=1;
public int verbose=1;
public int LabelAktiviert=0;
public int iGrantPrinting=1;
public int wArt=0;
private Font font=new Font("Monospaced",Font.BOLD,12);
private Font font3=new Font("Serif",Font.PLAIN,14);
private Label label41=new Label(" Alle Terme");
private Label label42=new Label(" Kernterme");
private Label label43=new Label(" Minimalloesung");
public String [][]auswertArray = new String[4][8];
public String [][]array3=new String[4][8];
public String [][]array1=new String[4][8];
public String [][]array2=new String[4][8];
public String []split_terms= new String[32];
public String outputFileContent="";
public String inputFileContent="";
public String []terme=new String[32]; //e.g. -10, 11,
-00--, ... (as read from file)
public String sStringActive;
public byte[] byteBuffer_In;
public byte[] byteBuffer;
private ServerInterface inf;
private Single_fields[][] s;
private termsToSelect[] termSelect;
private Single_Canvas xCanvas;
private Kmfdmf kmfdmf = new Kmfdmf("LBL",
(Kvs_Interface)this,iErrorIdentifier);
public Kmfdmf kmf;
public Kmfdmf dmf;
private Result_function rfResultFunctionWindow;
public Result_graph rgResultGraphWindow;
public Error_Window error1;
private Frame frame;
private ScrollPane sp;
private Panel pMiddlePanel=new Panel();
private Panel panel1=new Panel();
private Panel panel2zoom=new Panel(); //panel for
zoomfactor
private Panel panel3clearundo=new Panel();
private Panel panel4legende=new Panel(); //panel for
colors of solving steps
private Panel panelX=new Panel(); //panel for the
9 buttons downwards
private Panel bl_north=new Panel();
private Panel bl_center=new Panel();
private Panel bl_north_01=new Panel();
private Panel bl_n_left=new Panel();
private Panel bl_n_right=new Panel();
private Panel panel_in_bl_n_left=new Panel();
private Panel panel_for_terms=new Panel();
private Panel TermMasterPanel=new Panel();
private Panel left_right=new Panel();
private Panel printpanel=new Panel();
private Panel panel5check1=new Panel();
private Panel panel5check2=new Panel();
private Panel panel5check3=new Panel();
private Button printButton=new Button(" Ausdruck von... ");
// private Button button_left=new Button(" Left ");
// private Button button_right=new Button(" Right ");
private Button button_clear=new Button(" Loeschen ");
// private Button button_undo=new Button(" Undo ");
public String[][]labels={{" Primimplikate "," Kernimplikate ","
KMF "," "},
{" Primimplikanten "," Kernimplikanten ","
DMF "," "}};
public
String[][]codierung={{"00000","00001","00101","00100","10100","10101","10001","10000"},
{"00010","00011","00111","00110","10110","10111","10011","10010"},
{"01010","01011","01111","01110","11110","11111","11011","11010"},
{"01000","01001","01101","01100","11100","11101","11001","11000"}};
/************************ INITAPPLET ****************************/
/**
* Connecting to server on port 51099
*/
private void initApplet(){
try{
inf = (ServerInterface)Naming.lookup(HOST);
if (verbose==1){
System.out.println("Naming.lookup("+HOST+") erfolgreich!");
}
}
catch (Exception e){
if (verbose==1){
System.out.println("+++ Keine Verbindung zu "+HOST+" +++");
e.printStackTrace();
}
iErrorIdentifier=22;
error1=new Error_Window(iErrorIdentifier,(Kvs_Interface)this);
iErrorIdentifier=0;
}
}
public void start(){
this.setVisible(true);
}
public void stop(){
this.setVisible(false);
}
/*************************** INIT *******************************/
/**
* Initializes the applet, gets the size of the browsers frame, initializes
* a new SecurityManager and sets the starting layout.
*/
public void init(){
if (getSize().width<1500){
setSize(1500,4000);
}else{
setSize(getSize().width,4000);
}
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager() );
}
Object anchorpoint = getParent();
while (! (anchorpoint instanceof Frame) ){
anchorpoint = ( (Component)anchorpoint).getParent();
}
frame = (Frame)anchorpoint;
initApplet();
this.setForeground(Color.black);
// this.setFont(font);
kmf_number=0;
dmf_number=10;
bl_north.setLayout(new FlowLayout(FlowLayout.LEFT,30,0));
bl_north_01.setLayout(new BorderLayout());
bl_center.setLayout(new BorderLayout());
TermMasterPanel.setLayout(new BorderLayout());
panel_for_terms.setLayout(new
FlowLayout(FlowLayout.LEFT));//8,4,1,1));
setLayout(new BorderLayout());
panel_in_bl_n_left.setLayout(new BorderLayout());
bl_n_left.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
bl_n_right.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
startLayout();
newLayout(11,2,iClearTheField);
this.setVisible(true);
System.out.println(FILE);
}