ide/src/wombat/gui/frames/MainFrame.java
private void initPetite() {
    	// Connect to Petite
        // This thread also takes the output from Petite and relays it to the GUI
        try {
			Petite = new Petite();
			
	        // Add a listener to reset the running state when Petite reports it is ready.
	        Petite.addPetiteListener(new PetiteListener() {
				@Override public void onReady() {
					setRunning(false);
				}
				
				@Override public void onOutput(String output) {
					if (History != null && output != null) {
						if (Options.LambdaMode)
							output = output.replace("lambda", "\u03BB");
						
						if (Options.GreekMode)
							for (String[] pair : Options.GreekModeCharacters)
								output = output.replace(pair[1], pair[0]);
						
						History.append(output);
    					History.goToEnd();
    				}
				}
								
				@Override public void onError(Exception ex) {}

				@Override public void onStop() {}

				@Override public void onReset() {
					History.setText(">>> Environment reset <<<\n");
				}
			});
		} 
        
        // This will come up if we cannot connect to Petite. This is a pretty critical error.
        catch (Exception e1) {
			JOptionPane.showMessageDialog(
					this, 
					"Unable to start Petite process:\n" 
							+ e1.getMessage() 
							+ "\n\nPlease report this error to the developers.", 
					"Error starting Petite", 
					JOptionPane.ERROR_MESSAGE);
			ErrorManager.logError(e1.getMessage());
			e1.printStackTrace();
		}
    }
/**
     * Start up Petite or restart it on a reset.
     */
Start up Petite or restart it on a reset.
Start up Petite or restart it on a reset .
private void initPetite() {
        try {
			Petite = new Petite();
	        Petite.addPetiteListener(new PetiteListener() {
				@Override public void onReady() {
					setRunning(false);
				}
				@Override public void onOutput(String output) {
					if (History != null && output != null) {
						if (Options.LambdaMode)
							output = output.replace("lambda", "\u03BB");
						if (Options.GreekMode)
							for (String[] pair : Options.GreekModeCharacters)
								output = output.replace(pair[1], pair[0]);
						History.append(output);
    					History.goToEnd();
    				}
				}
				@Override public void onError(Exception ex) {}
				@Override public void onStop() {}
				@Override public void onReset() {
					History.setText(">>> Environment reset <<<\n");
				}
			});
		} 
        catch (Exception e1) {
			JOptionPane.showMessageDialog(
					this, 
					"Unable to start Petite process:\n" 
							+ e1.getMessage() 
							+ "\n\nPlease report this error to the developers.", 
					"Error starting Petite", 
					JOptionPane.ERROR_MESSAGE);
			ErrorManager.logError(e1.getMessage());
			e1.printStackTrace();
		}
    }
private void initPetite ( ) { try { Petite = new Petite ( ) ; Petite . addPetiteListener ( new PetiteListener ( ) { @ Override public void onReady ( ) { setRunning ( false ) ; } @ Override public void onOutput ( String output ) { if ( History != null && output != null ) { if ( Options . LambdaMode ) output = output . replace ( "lambda" , "\u03BB" ) ; if ( Options . GreekMode ) for ( String [ ] pair : Options . GreekModeCharacters ) output = output . replace ( pair [ 1 ] , pair [ 0 ] ) ; History . append ( output ) ; History . goToEnd ( ) ; } } @ Override public void onError ( Exception ex ) { } @ Override public void onStop ( ) { } @ Override public void onReset ( ) { History . setText ( ">>> Environment reset <<<\n" ) ; } } ) ; } catch ( Exception e1 ) { JOptionPane . showMessageDialog ( this , "Unable to start Petite process:\n" + e1 . getMessage ( ) + "\n\nPlease report this error to the developers." , "Error starting Petite" , JOptionPane . ERROR_MESSAGE ) ; ErrorManager . logError ( e1 . getMessage ( ) ) ; e1 . printStackTrace ( ) ; } }
Start up Petite or restart it on a reset.
Start up Petite or restart it on a reset .
// Connect to Petite // This thread also takes the output from Petite and relays it to the GUI // Add a listener to reset the running state when Petite reports it is ready. // This will come up if we cannot connect to Petite. This is a pretty critical error.