// Path: src/be/dramaix/ai/slidingpuzzle/shared/AlgorithmType.java
// public enum AlgorithmType {
// 
// 	BDF("Breadth-first search (BDF)"), A_STAR("A*"), IDA_STAR("Iterative Deepening A* (IDA*)");
// 	
// 	private String label;
// 	
// 	private AlgorithmType(String label) {
// 		this.label = label;
// 	}
// 
// 	public String getLabel() {
// 		return label;
// 	}
// 	
// }
// 
// Path: src/be/dramaix/ai/slidingpuzzle/shared/HeuristicType.java
// public enum HeuristicType {
// 
// 	//TODO use resources for label
// 	MANHATTAN_DISTANCE("manhattan distance"), LINEAR_CONFLICT("linear conflict"), PATTERN_DATABASE("pattern database");
// 	
// 	private String label;
// 	
// 	private HeuristicType(String label) {
// 		this.label = label;
// 	}
// 
// 	public String getLabel() {
// 		return label;
// 	}
// }


import static be.dramaix.ai.slidingpuzzle.client.MySelectors.SELECTOR;
import static com.google.gwt.query.client.GQuery.$;
import be.dramaix.ai.slidingpuzzle.shared.AlgorithmType;
import be.dramaix.ai.slidingpuzzle.shared.HeuristicType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.query.client.Function;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Element;
/*
 * Copyright 2011 Julien Dramaix.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package be.dramaix.ai.slidingpuzzle.client;



/**
 * Class managing the ui of the configuration of the puzzle
 * 
 * @author Julien Dramaix (https://plus.google.com/u/0/103916508880440628637)
 * 
 */
public class ConfigPanel {

	public interface Templates extends SafeHtmlTemplates {

		Templates INSTANCE = GWT.create(Templates.class);

		@Template("<option value=\"{0}\">{1}</option>")
		SafeHtml option(String value, String label);

		@Template("<option value=\"{0}\" selected=\"selected\">{1}</option>")
		SafeHtml selectedOption(String value, String label);
	}

	private HeuristicType heuristicType;
	private AlgorithmType algorithmType;

	public ConfigPanel() {
		// Default config
// Path: src/be/dramaix/ai/slidingpuzzle/shared/AlgorithmType.java
// public enum AlgorithmType {
// 
// 	BDF("Breadth-first search (BDF)"), A_STAR("A*"), IDA_STAR("Iterative Deepening A* (IDA*)");
// 	
// 	private String label;
// 	
// 	private AlgorithmType(String label) {
// 		this.label = label;
// 	}
// 
// 	public String getLabel() {
// 		return label;
// 	}
// 	
// }
// 
// Path: src/be/dramaix/ai/slidingpuzzle/shared/HeuristicType.java
// public enum HeuristicType {
// 
// 	//TODO use resources for label
// 	MANHATTAN_DISTANCE("manhattan distance"), LINEAR_CONFLICT("linear conflict"), PATTERN_DATABASE("pattern database");
// 	
// 	private String label;
// 	
// 	private HeuristicType(String label) {
// 		this.label = label;
// 	}
// 
// 	public String getLabel() {
// 		return label;
// 	}
// }


// Path: src/be/dramaix/ai/slidingpuzzle/client/ConfigPanel.java
import static be.dramaix.ai.slidingpuzzle.client.MySelectors.SELECTOR;
import static com.google.gwt.query.client.GQuery.$;
import be.dramaix.ai.slidingpuzzle.shared.AlgorithmType;
import be.dramaix.ai.slidingpuzzle.shared.HeuristicType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.query.client.Function;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Element;

/*
 * Copyright 2011 Julien Dramaix.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package be.dramaix.ai.slidingpuzzle.client;



/**
 * Class managing the ui of the configuration of the puzzle
 * 
 * @author Julien Dramaix (https://plus.google.com/u/0/103916508880440628637)
 * 
 */
public class ConfigPanel {

	public interface Templates extends SafeHtmlTemplates {

		Templates INSTANCE = GWT.create(Templates.class);

		@Template("<option value=\"{0}\">{1}</option>")
		SafeHtml option(String value, String label);

		@Template("<option value=\"{0}\" selected=\"selected\">{1}</option>")
		SafeHtml selectedOption(String value, String label);
	}

	private HeuristicType heuristicType;
	private AlgorithmType algorithmType;

	public ConfigPanel() {
		// Default config
		algorithmType = AlgorithmType.IDA_STAR;