/**
 * 
 */
package xal.app.machinesimulator;

/**
 * @author luxiaohan
 *this class define a scalar parameter with label name, key path which map to the parameter
 */
public class ScalarParameter extends Parameter {
	/**the key path map to this parameter*/
	private String keyPath;
	
	/**
	 * Constructor
	 * @param label the label of parameter
	 * @param key the key path
	 */
	public ScalarParameter(final String label,final String key) {
		super(label);
		keyPath=key;
	}
	/**
	 * get the name of the specified parameter
	 * @param keyPath the key path 
	 * @return the name
	 */
	public String getParameterName(final String keyPath) {
       return super.getLable();
	}
	/**
	 * get the key path map to this parameter
	 * @return the key path
	 */
	public String getKeyPath(){
		return keyPath;
	}
	/**
	 * get the plane of the parameter
	 * this method is to stay the same with VectorParameter
	 * sometimes we need to set different property in different plane
	 * but the vector parameter and scalar parameter mix together
	 * we don't want to write another code to separate them.
	 * so just add a method in ScalarParameter to return a invalid character.
	 */
	public String getPlane(final String keyPath){
		return "0";
	}
	/**
	 * Identify whether the key path map to this parameter
	 * @param keyPath the key path
	 * @return true or false
	 */
	public boolean isThisParameter(final String keyPath){
		return this.keyPath.equals(keyPath);
	}

}

@@ -276,16 +276,89 @@
 eyPath;%0A
+%09/**the name of the specified parameter*/%0A%09private String parameterName;%0A
 %09%0A%09/**%0A%09
@@ -710,38 +710,125 @@
 ) %7B%0A
-       return super.getLable()
+%09%09if(isThisParameter(keyPath)) parameterName=super.getLable();%0A%09%09else parameterName=null;%0A       return parameterName
 ;%0A%09%7D

correct a error