public boolean action(Event e, Object arg) {

		String fnum;
		int num;

        if (e.target == reset) {
			reset(1);
			}
        if (e.target == defaults) {
            Efloys.reset();
			reset(1);
			}

        if (e.target == ok) {
			fnum = readString(floynum, "All");
			if (fnum.equals("All")) {
				Efloys.ResetPopulation = true;
	            Efloys.NF = readInt(nf, Efloys.NF);
				Efloys.ACC = readFloat(acc, Efloys.ACC);
				Efloys.ACCTOMID = readFloat(acctomid, Efloys.ACCTOMID);
				Efloys.REVDIST = readInt(revdist, Efloys.REVDIST);
				Efloys.MAXSPEED = readFloat(maxspeed, Efloys.MAXSPEED);
				Efloys.BOUNCESPEED = readFloat(bouncespeed, Efloys.BOUNCESPEED);
				Efloys.SLEEP = readLong(sleep, Efloys.SLEEP);
				Efloys.COLOR = readString(color, Efloys.COLOR);
				Efloys.KICK = readFloat(kick, Efloys.KICK);
				Efloys.NUMNB = readInt(numnb, Efloys.NUMNB);

			}
			else {
				Efloys.ResetPopulation = false;
				if (fnum.equals("Stranger"))
					num = 0;
				else
					num = Integer.parseInt(fnum);
				/*
				floys[num].ApproachAcceleration = readFloat(acc, floys[num].ApproachAcceleration);
				floys[num].CenterAcceleration = readFloat(acctomid, floys[num].CenterAcceleration);
				floys[num].CollisionDistance = readInt(revdist, floys[num].CollisionDistance);
				floys[num].MaxSpeed = readFloat(maxspeed, floys[num].MaxSpeed);
				floys[num].BounceSpeed = readFloat(bouncespeed, floys[num].BounceSpeed);
				floys[num].color = readColor(color, floys[num].GetColorName());
				//floys[num].color = GetColorByString(color.getSelectedItem());
				//floys[num].kick = readFloat(kick, floys[num].kick);
				floys[num].NumberOfNeighbors = readInt(numnb, floys[num].NumberOfNeighbors);
				if (floys[num].color == Color.red) 
					floys[num].type = 1;
				else
					floys[num].type = 0;
				floys[num].chrom = chromo.getText();
				*/
				//UpdateChrom(num);
				//floys[num] = new Efloy(Efloys.params, newpars, Efloys.fixpars, newfixs, Efloys.envpars, newenvs);
			}

            this.hide();
            this.dispose();
			Efloys.First = true;
            return true;
            }

        if (e.target == cancel) {
			Efloys.First = true;
            this.hide();
            this.dispose();
            return true;
            }
		

		if (e.target == floynum) {

			fnum = readString(floynum, "All");
			if (!fnum.equals("All")) {
				if (fnum.equals("Stranger"))
					num = 0;
				else
					num = Integer.parseInt(fnum);

				acc.setText(""+floys[num].ApproachAcceleration);
				acctomid.setText(""+floys[num].CenterAcceleration);
				revdist.setText(""+floys[num].CollisionDistance);
				maxspeed.setText(""+floys[num].MaxSpeed);
				bouncespeed.setText(""+floys[num].BounceSpeed);
				color.setText(""+floys[num].GetColorName());
				//kick.setText(""+floys[num].kick);
				numnb.setText(""+floys[num].NumberOfNeighbors);
				chromo.setText(floys[num].chrom);
			}

            return true;

		}
		

        else
            return false;
        }