
org.csstudio.utility.adlparser.fileParser.widgets.ChoiceButton Maven / Gradle / Ivy
package org.csstudio.utility.adlparser.fileParser.widgets;
import java.util.ArrayList;
import org.csstudio.utility.adlparser.fileParser.ADLWidget;
import org.csstudio.utility.adlparser.fileParser.FileLine;
import org.csstudio.utility.adlparser.fileParser.WrongADLFormatException;
import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLControl;
import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLObject;
import org.csstudio.utility.adlparser.internationalization.Messages;
/**
*
* @author hammonds
*
*/
public class ChoiceButton extends ADLAbstractWidget {
private String color_mode = new String("static");
private String stacking = new String("row");
public ChoiceButton(ADLWidget adlWidget) {
super(adlWidget);
name = new String("choice button");
try {
for (ADLWidget childWidget : adlWidget.getObjects()) {
if (childWidget.getType().equals("object")){
_adlObject = new ADLObject(childWidget);
if (_adlObject != null){
_hasObject = true;
}
}
else if (childWidget.getType().equals("control")){
_adlControl = new ADLControl(childWidget);
if (_adlControl != null){
_hasControl = true;
}
}
}
for (FileLine fileLine : adlWidget.getBody()){
String bodyPart = fileLine.getLine();
String[] row = bodyPart.trim().split("=");
if (row.length < 2){
throw new WrongADLFormatException(Messages.Label_WrongADLFormatException_Parameter_Begin + bodyPart + Messages.Label_WrongADLFormatException_Parameter_End);
}
if (FileLine.argEquals(row[0], "clrmod")){
setColor_mode(FileLine.getTrimmedValue(row[1]));
}
else if (FileLine.argEquals(row[0], "stacking")){
setStacking(FileLine.getTrimmedValue(row[1]));
}
}
}
catch (WrongADLFormatException ex) {
ex.printStackTrace();
}
// TODO Add Color mode to ChoiceButton
// TODO Add Stacking to ChoiceButton
}
@Override
public Object[] getChildren() {
ArrayList
© 2015 - 2025 Weber Informatics LLC | Privacy Policy