heiwiper_jeu-de-taquin/main/gui.pde
/* =========================================================
* ====                   WARNING                        ===
* =========================================================
* The code in this tab has been generated from the GUI form
* designer and care should be taken when editing this file.
* Only add/edit code inside the event handlers i.e. only
* use lines between the matching comment tags. e.g.

void myBtnEvents(GButton button) { //_CODE_:button1:12356:
// It is safe to enter your event code here
} //_CODE_:button1:12356:

* Do not rename this tab!
* =========================================================
*/

public void imgButtonPlay_click1(GImageButton source, GEvent event) { //_CODE_:imgButtonPlay:741135:
    //Initializing the score and "found" variable
    found = false;
    score = 0;
    mode="PLAY";
} //_CODE_:imgButtonPlay:741135:

public void imgButtonEdit1_click1(GImageButton source, GEvent event) { //_CODE_:imgButtonEdit1:633195:
    mode="EDIT_1";
    selected = -1;      //Initializing selected variable
} //_CODE_:imgButtonEdit1:633195:

public void imgButtonEdit2_click1(GImageButton source, GEvent event) { //_CODE_:imgButtonEdit2:278670:
    mode="EDIT_2";
    selected = -1;      //Initializing selected variable
} //_CODE_:imgButtonEdit2:278670:

public void imgButtonAuto1_click1(GImageButton source, GEvent event) { //_CODE_:imgButtonAuto1:288536:
    //make all the necessary Initializations and add the start matrix to the queue
    mode="AUTO_1";
    refresh();
    image(thinking,275,157);
    startTime = millis();
    found = false;
    visitedNodes = 0;
    heuristic = 1;
    path.clear();
    reversePath.clear();
    queue.clear();
    visited.clear();
    costG.clear();
    queue.add(new Node(0, goalMatrix, mainMatrix, null, 1));
    visited.add(matrixToString(mainMatrix));
    costG.add(0);
} //_CODE_:imgButtonAuto1:288536:

public void imgButtonAuto2_click1(GImageButton source, GEvent event) { //_CODE_:imgButtonAuto2:238349:
    //make all the necessary Initializations and add the start matrix to the queue
    mode="AUTO_2";
    refresh();
    image(thinking,275,157);
    startTime = millis();
    found = false;
    visitedNodes = 0;
    heuristic = 2;
    path.clear();
    reversePath.clear();
    queue.clear();
    visited.clear();
    costG.clear();
    queue.add(new Node(0, goalMatrix, mainMatrix, null, 2));
    visited.add(matrixToString(mainMatrix));
    costG.add(0);
} //_CODE_:imgButtonAuto2:238349:


// Create all the GUI controls.
// autogenerated do not edit
public void createGUI(){
    G4P.messagesEnabled(false);
    G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
    G4P.setMouseOverEnabled(false);
    surface.setTitle("Sketch Window");
    imgButtonPlay = new GImageButton(this, 310, 10, 80, 30, new String[] { "play.png", "play_on.png", "play_on.png" } );
    imgButtonPlay.addEventHandler(this, "imgButtonPlay_click1");
    imgButtonEdit1 = new GImageButton(this, 110, 302, 80, 25, new String[] { "edit.png", "edit_on.png", "edit_on.png" } );
    imgButtonEdit1.addEventHandler(this, "imgButtonEdit1_click1");
    imgButtonAuto1 = new GImageButton(this, 305, 70, 90, 25, new String[] { "auto1.png", "auto1_on.png", "auto1_on.png" } );
    imgButtonAuto1.addEventHandler(this, "imgButtonAuto1_click1");
    imgButtonAuto2 = new GImageButton(this, 301, 105, 97, 25, new String[] { "auto2.png", "auto2_on.png", "auto2_on.png" } );
    imgButtonAuto2.addEventHandler(this, "imgButtonAuto2_click1");
    imgButtonEdit2 = new GImageButton(this, 510, 302, 80, 25, new String[] { "edit.png", "edit_on.png", "edit_on.png" } );
    imgButtonEdit2.addEventHandler(this, "imgButtonEdit2_click1");
}

// Variable declarations
// autogenerated do not edit
GImageButton imgButtonPlay;
GImageButton imgButtonEdit1;
GImageButton imgButtonAuto1;
GImageButton imgButtonAuto2;
GImageButton imgButtonEdit2;
