import java.util.*;
import java.awt.*;
import java.applet.Applet;

public class FirstOne3 extends Applet implements FrameworkInterface {
	Button b1 = new Button("Start");
	SourcePanel sp1 = new SourcePanel();
	VarPanel vp1 = new VarPanel();
	DisplayText dt1 = new DisplayText();
	CustomInterface cc1 = new CustomClass1();
	ContextStackPanel cs1 = new ContextStackPanel();
	ReceiverPanel rp1 = new ReceiverPanel();
	ActPanel acp1 = new ActPanel();
	public void init() {
		vp1.resetVar();
		setLayout(null);
		add(sp1);
		add(b1);
		add(vp1);
		add(cs1);
		add(rp1);
		add(acp1);
		add(dt1);
		sp1.reshape(10,10,340,200);
		dt1.reshape(10,220,350,200);
		b1.reshape(370,320,300,20);
		vp1.reshape(370,10,300,100);
		cs1.reshape(370,120,300,70);
		rp1.reshape(370,200,300,30);
		acp1.reshape(370,240,300,60);
		cc1.setParent(this);
	}

	
		
	public boolean action(Event evt, Object what) {
	int i;	
		if (evt.target==b1) {
			b1.disable();
		
			sp1.setLine(cc1.executeLine(sp1.getLine()));
				sp1.positionOfScrollbar (sp1.getLine());
			if (sp1.getLine()==-1)
				{b1.setLabel("Start");
				dt1.resetScreenText();
				vp1.resetVar();}
			else
				b1.setLabel("Next");
			b1.enable();
			return true;
		}
		return super.action(evt,what);
	}
	/*
	*This method allows to change the value of a variable.
	*/
	public void changeVar(int varId, String newValue) {
		vp1.changeVar(varId, newValue);
	}
	/*
	*This method allows to get the value of a variable.
	*/	
	public String getVar(int varId) {
		return vp1.getVar(varId);
	}
	/*
	*This method allows to write source text in the source text panel.
	*/
	public void setText(String[] lines){
			sp1.setText(lines);
	}
	/*
	*This method allows to create a new variable.
	*/
	public void createVar( int i, String Name, String initValue) {
		vp1.createVar(i,Name,initValue);
	}
	/*
	*This method allows to initialize the variable panel.
	*/
	public void initVar() {
		vp1.initVar();
	}
	/*
	*This method allows to reset the variables in the variable panel.
	*/
	public void resetVar(){
		vp1.resetVar();
	}	
	/*
	*This method allows to put in a stack an element (use for the 
	*context stack panel where is showing the stacking of appeal of
	*method by objects).
	*/
	public void putInStack(String element) {
		cs1.putInStack(element);
	}
	
	/*
	*This method allows to remove in a stack an element.
	*/
	public void putOutStack() {
		cs1.putOutStack();
	}
	public void Parameter(String aParam) {
		cs1.Parameter(aParam);
	}
	public String getParameter() {
		return cs1.getParameter();
	}
	/*
	*This method allows to change the name of the object whose call
	*method.
	*/
	public void changeReceiver(String element) {
		rp1.changeReceiver(element);
	}
	/*
	*This method allows to reset the name of the receiver in the receiver
	*panel.
	*/
	public void resetReceiver() {
		rp1.resetReceiver();
	}
	/*
	*This method allows to change the act of a program line to the user.
	*/
	public void changeAct(String action) {
		acp1.changeAct(action);
	}
	/*
	*This method allows to reset the display of the act of a program line.
	*/
	public void resetAct() {
		acp1.resetAct();
	}
	/*
	*This method allows to change the text display in the screen by the 
	*program.
	*/
	public void addText(String element) {
		dt1.putInScreen(element);
	}
	/*
	*This method allows to reset the text  in the display text
	*panel.
	*/
	public void resetText() {
		dt1.resetScreenText();
	}

	
}

class SourcePanel extends Panel {
	SourceClicker sc1 = new SourceClicker();
	SourceText st1 = new SourceText(this);
	Scrollbar scrl1;

	public SourcePanel() {
		setLayout(null);
		add(st1);
		add(sc1);
	}


	public void positionOfScrollbar (int pos) {
		scrl1.setValue(pos *10 - 60);
		st1.move(st1.bounds().x,- scrl1.getValue()); 
			sc1.move(sc1.bounds().x,- scrl1.getValue());

	}

	public void reshape(int x, int y, int width, int height ){
		super.reshape(x,y,width,height);
		myReshape();
	}

	public void myReshape() {
		int w=size().width;
		int h=size().height;
		
		if (st1.size().height ==0) {
			st1.reshape(16,0,w-32,h);
			sc1.reshape(0,0,16,h);
		} else {
			sc1.reshape(0,0,16,st1.size().height);
		}
		if (scrl1!=null) {
			remove(scrl1);
		}
		scrl1 = new Scrollbar(Scrollbar.VERTICAL, 0, h, 0, st1.size().height);
		add(scrl1);
		scrl1.reshape(w -16,0,16,h  );
	}
	
	public int getLine() {
		return sc1.getLine();
	}

	public void setLine(int line) {
		sc1.setLine(line);
	}

	public void setText(String[] lines) {
		st1.setText(lines);
	}
	
	public boolean handleEvent(Event evt) {
		if (evt.target == scrl1) {
			st1.move(st1.bounds().x,- scrl1.getValue()); 
			sc1.move(sc1.bounds().x,- scrl1.getValue());
			return true;
		}
		return super.handleEvent(evt);		
	}
}
class SourceClicker extends Canvas {
	boolean br[] = new boolean[48];
	int cur_line = -1;

	public SourceClicker() {
		
		setBackground(Color.gray);
	}

	public void paint(Graphics g) {
		g.setColor(Color.red);
		for (int i=0; i<br.length; i++) {
			if (br[i])
				g.fillOval(1,10*i,9,9);
		}
		if (cur_line!= -1) {
			g.setColor(Color.yellow);
			Polygon p = new Polygon();
			p.addPoint(1,10*cur_line);
			p.addPoint(9,10*cur_line+5);
			p.addPoint(1,10*cur_line+9);
			g.fillPolygon(p);
		}
	}
	
	public Dimension minimumSize() {
		return new Dimension(12,12);
	}

	public Dimension preferredSize() {
		return new Dimension(12,12);
	}

	public boolean mouseDown(Event evt, int x, int y) {
		int i = y/10;
		br[i] = ! br[i];
		repaint();
		return true;
	}

	public void setLine(int line) {
		cur_line = line;
		repaint();
	}

	public int getLine() {
		return cur_line;
	}
}
class SourceText extends Canvas {
	private String lines[] = new String[48];
	SourcePanel p;
	
	public SourceText(SourcePanel p) {
		Color col = new Color(245, 245, 245);
		this.p = p;
		setBackground(col);
	}

	public void paint(Graphics g) {
		String txt= new String();
		txt="the source text";
		g.setColor(Color.blue);
		g.drawString(txt,0,10);
		g.setColor(Color.black);
		for (int i=0; i<lines.length; i++)
			g.drawString(lines[i+1],0,10*i+20);
	}

	public void setText(String[] lines) {
		this.lines = new String[lines.length];
		
		Graphics g = this.getGraphics();
		FontMetrics f = g.getFontMetrics();
		
		for (int i = 0;i<this.lines.length ;i++) {
			this.lines[i] = convertTabs(lines[i]);
		
		}
		this.resize(310,500);
		p.myReshape();
	}
	
	private String convertTabs(String s1) {
		int p1=s1.indexOf(9);
		String s2 = s1;
		while (p1!=-1) 
		{
			if (p1>0) {
				s2 = s2.substring(0,p1-1) + "    " + s2.substring(p1+1);
			} else {
				s2 = "    " + s2.substring(p1+1);
			}
			p1=s2.indexOf(9);
		}
		return s2;
	}
}

class VarPanel extends Canvas {
	String vars[][] = new String[7][2];
	String[] varName = new String[7];

	public VarPanel() {
		Color col = new Color(245, 245, 245);
		setBackground(col);
		for (int i=0; i<7; i++) {
			vars[i][1]="0";
		}
	}

	public void paint(Graphics g) {
		String txt= new String();
		txt= "Variables";
		g.setColor(Color.blue);
		g.drawString(txt,0,10);
		for (int i=0; i<7; i++) {
			if (vars[i][1]=="0")
				g.setColor(Color.black);
			else
				g.setColor(Color.red);
				if (varName[i]!="") 
			g.drawString(varName[i]+" = "+vars[i][0],10,10*i+20);
		}
	}
	/*
	*This method changes the value of a variable and indicate it by 
	*the value "1".
	*/
	public void changeVar(int varId, String newValue) {
		vars[varId][0] = newValue;
		vars[varId][1] = "1";
		repaint();
	}
	/*
	*This method return the value of a variable.
	*/
	public String getVar(int varId) {
		return vars[varId][0];
	}
	/*
	*This method allows to create a new variable.
	*/
	public void createVar( int i, String Name, String initValue) {
		varName[i] = Name;
		vars[i][0] = initValue;
		vars[i][1] = "1";
		repaint();
	}
	/*
	*This method allows to indicate that the variables didn't have been
	*change (color black).
	*/
	public void initVar() {
		for (int i=0; i<7; i++) {
			vars[i][1] = "0";
		}
	}
	/*
	*This method allows to reset the value of variable using whem we
	*start the applet.
	*/
	  public void resetVar() {
		for (int i=0; i<7; i++) {
			varName[i] = "";
			vars[i][0] = "";
			vars[i][1] = "0";
			
		}
		repaint();
	}

}
		/*
	* This class manages the display in the context stack panel. 
	*We use this panel to show the stack of method's appeal 
	*by objects.
	*/
class ContextStackPanel extends Canvas { 
	String parameter;
	protected Stack contextStack;
		
	protected ContextStackPanel() {
		Color col = new Color(245, 245, 245);
		setBackground(col);
		contextStack = new Stack() ;
	}
	/*
	*This method allows to put in a stack an element.
	*/
	public void putInStack(String element) {
		contextStack.push(element);
		repaint();
	}
	/*
	*This method allows to remove the last element putten in the stack.
	*/
	public void putOutStack() {
		contextStack.pop();
		repaint();
	}

	public void Parameter(String aParam) {
		parameter=aParam;
		repaint();
	}

	public String getParameter() {
		return parameter;
	}
	public void paint(Graphics g) {
		Stack stack1= new Stack();
		Stack stack2= new Stack();
		String txt= new String();
		txt= "ContextStack (Class>>method-->parameters)";
		g.setColor(Color.blue);
		g.drawString(txt,0,10);
		g.setColor(Color.black);
		stack1 = (Stack)contextStack.clone();
		int i=0;
		while (stack1.empty() ==false)
		{
			stack2.push ((String)stack1.pop());
		}	
			while (stack2.empty() ==false)
		{
				g.drawString(((String)stack2.pop()).toString(),10,10*i+20);
				i=i+1;
		}	
	}
}
/*
*this class manages the display in the receiver panel.
*We use this panel to show the receiver of a method.
*/
class ReceiverPanel extends Canvas {
	String receiver;
	public ReceiverPanel() {
		Color col = new Color(245, 245, 245);
		setBackground(col);
		receiver= new String();
	}
	/*
	*This method allows to change the name of the receiver and to start.
	*/
	public void changeReceiver(String element) {
		receiver = element;
		repaint();
	}
	/*
	*This method allows to display the contents of the receiver panel.
	*/
	public void paint(Graphics g) {
			String txt= new String();
		txt= "Receiver and its class";
		g.setColor(Color.blue);
		g.drawString(txt,0,10);
		g.setColor(Color.black);
		g.drawString( receiver.toString(),10,20);
	}
	/*
	*This method allows to reset the name of the receiver.
	*/
	public void resetReceiver() {
		receiver=" ";
		repaint();
	}
}
/*
*this class manages the display in the display text panel.
*We use this panel to show the text display on the screen 
*by the program.
*/
class DisplayText extends Canvas {
	int nbLine;
	protected Stack textDisplay;
		
	protected DisplayText() {
		Color col = new Color(245, 245, 245);
		setBackground(col);
		textDisplay = new Stack() ;
	}
	/*
	*This method allows to put in a textDisplay an element.
	*/
	public void putInScreen(String element) {
		textDisplay.push(element);
		repaint();
	}
	/*
	*This method allows to reset the display in the screen.
	*/
	public void resetScreenText() {
		while (textDisplay.empty() ==false)
		{
		textDisplay.pop();
		}
		repaint();
	}

	public void paint(Graphics g) {
		Stack stack1= new Stack();
		Stack stack2= new Stack();
		String txt= new String();
		txt= "Message display on the screen by the program";
		g.setColor(Color.blue);
		g.drawString(txt,0,10);
		g.setColor(Color.black);
		stack1 = (Stack)textDisplay.clone();
		int i=0;
		while (stack1.empty() ==false)
		{
			stack2.push ((String)stack1.pop());
		}	
			while (stack2.empty() ==false)
		{
				g.drawString(((String)stack2.pop()).toString(),10,10*i+20);
				i=i+1;
		}	
	}
}
/*
*this class manages the display in the act panel.
*We use this panel to show the act of a program line to the user.
*/
class ActPanel extends Canvas {
	String act;
	public ActPanel() {
		Color col = new Color(245, 245, 245);
		setBackground(col);
		act= new String();
	}
	/*
	*This method allows to change the act of a program line.
	*/
	public void changeAct(String action) {
		act = action;
		repaint();
	}
	/*
	*This method allows to display the contents of the act panel.
	*/
	public void paint(Graphics g) {
			String txt= new String();
		txt= "Act of the program line";
		g.setColor(Color.blue);
		g.drawString(txt,0,10);
		g.setColor(Color.black);
		g.drawString( act.toString(),10,20);
	}
	/*
	*This method allows to reset the act of a program line.
	*/
	public void resetAct() {
		act=" ";
		repaint();
	}
}


class CustomClass1 implements CustomInterface {
	FrameworkInterface parent=null;
	Stack returnline = new Stack();
	public void setParent(FrameworkInterface parent) {
		this.parent = parent;
		String lines[]= new String[48];
		lines[0] ="class Animal extends Object {";
		lines[1] =" protected String name;";
		lines[2] =" protected void answer ( String dialogue ) {";
		lines[3] ="     System.out.println ( name + \":\" + dialogue ) ; }";
		lines[4] =" public Animal ( String hisName) {";
		lines[5] ="     name=hisName;}";
		lines[6] =" public void speak ( ) {";
		lines[7] ="     answer ( \"I don't speak \" );}}";
		lines[8] ="class Fish extends Animal {";
		lines[9] =" protected char category;";
		lines[10]=" public Fish ( String aName, char cat ) {";
		lines[11]="     super ( aName );";
		lines[12]="     category= cat;}";
		lines[13]=" public void whereSwim ( ) {";
		lines[14]="     if  ( category == 's' )";
		lines[15]="       answer ( \" I swim in the sea \" ) ;";
		lines[16]="     else answer ( \" I swim in fresh water \" ) ; }}";
		lines[17]="class Dog extends Animal {";
		lines[18]=" protected char barking;";
		lines[19]=" public Dog ( String aName ){";
		lines[20]="     super ( aName ) ;";
		lines[21]="     barking= '0' ;}";
		lines[22]=" public void bark ( ) {";
		lines[23]="     if ( barking== '1' )"; 
		lines[24]="       answer ( \" bow wo, bow wo \" );";
		lines[25]="     else answer ( \" wof \" ); }";
		lines[26]=" public void beNoisy ( ) {";
		lines[27]="     barking = '1' ;";
		lines[28]="     answer ( \" I will bark loud \" ) ; }";
		lines[29]=" public void beQuiet( ) {";
		lines[30]="     barking = '0';";
		lines[31]="     answer ( \" I will not bark loud \" );}";
		lines[32]=" public void speak ( ) {";
		lines[33]="     if ( barking != '0' )"; 
		lines[34]="       bark ( ) ;";
		lines[35]="     else super.speak ( ) ; }}";
		lines[36]="public class PetShop {";
		lines[37]=" public static void main ( String args [ ] ) {";
		lines[38]="     Dog gato = new Dog ( \" medor \" );";
		lines[39]="     gato.speak ( );";
		lines[40]="     gato.beNoisy ( );";
		lines[41]="     gato.speak ( );";
		lines[42]="     gato.beQuiet ( );";
		lines[43]="     gato.bark ( );";
		lines[44]="     gato.speak ( );";
		lines[45]="     Fish flic = new Fish ( \" hercule \" , \" f \" );";
		lines[46]="     flic.speak ( );";
		lines[47]="     flic.whereSwim ( );}}";
		
		parent.setText(lines);
	}


	public int executeLine(int line) {
		
		Integer i1;
		switch (line) {
		case -1:
			parent.resetAct();
			parent.resetVar();
			return 37;
		case 2:
			parent.putInStack("Animal>>answer"+parent.getParameter());
			parent.changeAct("display the name of the object and its dialogue");
			return 3;
		case 3:
			parent.putOutStack();
			
			if (((Integer)returnline.peek()).intValue()==-1) {
			parent.addText("hercule:I swim in fresh water");
			parent.putOutStack();
			parent.resetReceiver();
			parent.resetAct();
			}
			if (((Integer)returnline.peek()).intValue()==40) {
				parent.changeAct("Call the method beNoisy of the object Dog");
				parent.changeReceiver("PetShop >> ");
				parent.addText("medor : I don't speak ");
				parent.putOutStack();
				parent.putOutStack();}
			if (((Integer)returnline.peek()).intValue()==41) {
				parent.changeAct("Call the method speak of the object Dog");
				parent.changeReceiver("PetShop >> ");
				parent.addText("medor :I will bark loud  ");
				parent.putOutStack();}
			if (((Integer)returnline.peek()).intValue()==42) {
				parent.changeAct("Call the method beQuiet of the object Dog");
				parent.changeReceiver("PetShop >> ");
				parent.putOutStack();
				parent.addText("medor :bow wo, bow wo ");
				parent.putOutStack();}
			if (((Integer)returnline.peek()).intValue()==43) {
				parent.changeAct("Call the method bark of the object Dog");
				parent.changeReceiver("PetShop >> ");
				parent.addText("medor :I will not bark loud  ");
				}
			if (((Integer)returnline.peek()).intValue()==44) {
				parent.changeAct("Call the method speak of the object Dog");
				parent.changeReceiver("PetShop >> ");
				parent.addText("medor :wof");
				parent.putOutStack();}
			if (((Integer)returnline.peek()).intValue()==47) {
				parent.changeAct("Call the method whereSwim of the object Fish");
				parent.changeReceiver("PetShop >> ");
				parent.addText("hercule : I don't speak ");
				parent.putOutStack();}
			if (((Integer)returnline.peek()).intValue()==45) {
				parent.changeAct("declaration and creation of a new object Fish");
				parent.changeReceiver("PetShop >> ");
				parent.putOutStack();
				parent.addText("medor : I don't speak ");
				parent.putOutStack();}
			return (((Integer)returnline.pop()).intValue());
		case 4:
			parent.changeAct("assign the object's name ");
			parent.putInStack("Animal>>Animal"+parent.getParameter());
			return 5;
		case 5:
			if (((Integer) returnline.peek()).intValue()==21) {
				parent.initVar();
				parent.createVar(1,"gato.name","medor");
				parent.putOutStack();
				parent.changeAct("Assign the variable barking of a object Dog");
				return (((Integer)returnline.pop()).intValue());
			}
			else {
				parent.initVar();
				parent.changeReceiver("flic>>Fish");
				parent.createVar(5,"flic.name","hercule");
				parent.changeAct("Assign the variable category");
				parent.putOutStack();
				return ((Integer)returnline.pop()).intValue();
			}
		case 6:
			parent.resetAct();
			parent.changeAct("Call the method answer of the class Animal");
			parent.putInStack("Animal>>speak");
			return 7;
		case 7:
			parent.resetAct();
			parent.Parameter("-->I don't speak");
			return 2;
		case 10:
			parent.changeAct("Call the buider of the class Animal with a argument");
	
			
			parent.putInStack("Fish>>Fish-->hercule,f");
			return 11;
		case 11:
			i1 =new Integer(12);
      		parent.changeAct("Builder of the class Animal");
			returnline.push(i1);
			parent.Parameter("-->hercule");
			return 4;
		case 12:
			parent.initVar();
			parent.changeAct("Call the method speak of the object flic");
			parent.createVar(6,"flic.category","f");
			parent.putOutStack();
			return ((Integer)returnline.pop()).intValue();
		case 13:
			parent.changeAct("Test the variable category of the object Fish");
			parent.putInStack("Fish>>whereSwim");
			return 14;
		case 14:
			parent.initVar();
			parent.changeAct("Call the method answer of the class Animal");
			parent.changeVar(3,"false");
			return 16;
		case 16:
			parent.resetAct();
			parent.Parameter("-->I swim in fresh water");
			return 2;
		case 19:
			parent.changeAct("Call the buider of the class Animal with a argument");
			parent.putInStack("Dog>>Dog-->medor");
			return 20;
		case 20:
			parent.changeAct("builder of the class Animal");
			i1 =new Integer(21);
			returnline.push(i1);
			parent.Parameter("-->medor");
			return 4;
		case 21:
			parent.changeAct("Call the method speak of this object Dog");	
			parent.initVar();
			parent.changeReceiver("PetShop >> ");			
			parent.createVar(2,"gato.barking","0");
			parent.putOutStack();
			return (((Integer)returnline.pop()).intValue());
		case 22:
			parent.changeAct("Test the variable barking of a object Dog");
			parent.putInStack("Dog>>bark");
			return 23;
		case 23:
			
			if (parent.getVar(2)=="1") {
				parent.changeAct("Call the method answer of the class Animal");
				parent.initVar();
				parent.changeVar(3,"true");
				return 24;
			}
			else {
				parent.changeAct("Call the method answer of the class Animal ");
				parent.initVar();
				parent.changeVar(3,"false");
				return 25;
			}
		case 24:
			parent.resetAct();
			parent.Parameter("-->bow wo,bow wo");
			return 2;
		case 25:
			parent.resetAct();
			parent.Parameter("-->wof");
			return 2;
		case 26:
			parent.resetAct();
			parent.changeAct("Assign the variable barking of this object Dog");
			parent.putInStack("Dog>>beNoisy");
			return 27;
		case 27:
			parent.changeAct("Call the method answer of the class Animal");
			parent.initVar();
			parent.changeVar(2,"1");
			return 28;
		case 28:
			parent.resetAct();
			parent.Parameter("-->I will bark loud");
			return 2;
		case 29:
			parent.resetAct();
			parent.changeAct("Assign the variable barking of this object Dog");
			parent.putInStack("Dog>>beQuiet");
			return 30;
		case 30:
			parent.changeAct("Call the method answer of the class Animal");
			parent.initVar();
			parent.changeVar(2,"0");
			return 31;
		case 31:
			parent.resetAct();
			parent.Parameter("-->I will not bark loud");
			return 2;
		case 32:
			parent.resetAct();
			parent.putInStack("Dog>>speak");
			parent.changeAct("Test the variable barking of this object Dog");
			return 33;
		case 33:
		
			if (parent.getVar(2)!="0") {
				parent.initVar();
				parent.changeVar(3,"true");
				parent.changeAct("Call the method bark of the object Dog");
				return 34;
			}
			else {
				parent.changeAct("Call the method speak of the class Animal");
				parent.initVar();
				parent.createVar(3,"condition","false");
				return 35;
			}
		case 34:
			parent.resetAct();	
			return 22;
		case 35:
			parent.resetAct();
		
			return 6;
		case 37:
			parent.resetAct();
			parent.changeAct("declaration and creation of a new object Dog");
			parent.putInStack("PetShop >>main");
			parent.changeReceiver("PetShop >> ");
			return 38;
		case 38:
			parent.changeAct("Builder of the class Dog");
			parent.createVar(0,"gato","a Dog");
			parent.changeReceiver("gato>>Dog");
			i1 =new Integer(39);
			returnline.push(i1);
			return 19;
		case 39:
			parent.resetAct();			
			parent.changeReceiver("gato>>Dog");
			i1 =new Integer(40);
			returnline.push(i1);
			return 32;
		case 40:
			parent.resetAct();
			parent.changeReceiver("gato>>Dog");
			i1 =new Integer(41);
			returnline.push(i1);
			return 26;
		case 41:
			parent.resetAct();
			parent.changeReceiver("gato>>Dog");
			i1 =new Integer(42);
			returnline.push(i1);
			return 32;
		case 42:
			parent.resetAct();
			i1 =new Integer(43);
			parent.changeReceiver("gato>>Dog");
			returnline.push(i1);
			return 29;
		case 43:
			parent.resetAct();
			parent.changeReceiver("gato>>Dog");
			i1 =new Integer(44);
			returnline.push(i1);
			return 22;
		case 44:
			parent.resetAct();
			parent.changeReceiver("gato>>Dog");
			i1 =new Integer(45);
			returnline.push(i1);
			return 32;
		case 45:
			parent.changeAct("Builder of the class Fish");		
			parent.changeReceiver("Fish>> ");
			parent.initVar();
			parent.createVar(4,"flic","a fish");
			i1 =new Integer(46);
			returnline.push(i1);
			return 10;
		case 46:
			parent.resetAct();
			parent.changeReceiver("flic>>Fish");
			i1 =new Integer(47);
			returnline.push(i1);
			return 6;
		case 47:
			parent.resetAct();
			parent.changeReceiver("flic>>Fish");
			i1 =new Integer(-1);
			returnline.push(i1);
			return 13;
		}
		return -1;
	}
}

interface CustomInterface {
	public void setParent(FrameworkInterface parent);
	public int executeLine(int line);
}

interface FrameworkInterface {
	public void init();
	public void resetVar();
	public boolean action(Event evt, Object what);
	public void changeVar(int varId, String newValue);
	public String getVar(int varId);
	public void setText(String[] lines);
	public void createVar(int i, String Name, String initValue);
	public void initVar();
	public void putInStack(String element);
	public void putOutStack();
	public void changeReceiver(String element);
	public void resetReceiver();
	public void Parameter(String aParam);
	public String getParameter();
	public void changeAct(String action);
	public void resetAct();
	public void addText(String element);
	public void resetText();

}
 