本文整理汇总了Java中com.badlogic.gdx.utils.XmlReader.Element.getAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java Element.getAttributes方法的具体用法?Java Element.getAttributes怎么用?Java Element.getAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.utils.XmlReader.Element
的用法示例。
在下文中一共展示了Element.getAttributes方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addHorizontalGroup
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addHorizontalGroup(Table table, Element element) {
Table horizontalGroup = new Table();
ScrollPane scrollPane = new ScrollPane(horizontalGroup, skin);
Cell<ScrollPane> cell = table.add(scrollPane);
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null) {
atrributes = new ObjectMap<String, String>();
}
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
horizontalGroup.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
addChildrens(element, horizontalGroup);
actorsMap.put(horizontalGroup.getName(), horizontalGroup);
}
示例2: addVerticalGroup
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addVerticalGroup(Table table, Element element) {
VerticalGroup verticalGroup = new VerticalGroup();
ScrollPane scrollPane = new ScrollPane(verticalGroup, skin);
Cell<ScrollPane> cell = table.add(scrollPane);
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null) {
atrributes = new ObjectMap<String, String>();
}
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
verticalGroup.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
// addChildrens(element, horizontalGroup);
actorsMap.put(verticalGroup.getName(), verticalGroup);
}
示例3: addScrollPanel
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addScrollPanel(Table table, Element element) {
Table tableScroll = new Table(skin);
ScrollPane scrollPane = new ScrollPane(tableScroll, skin);
Cell<ScrollPane> cell = table.add(scrollPane);
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null) {
atrributes = new ObjectMap<String, String>();
}
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
tableScroll.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
addChildrens(element, tableScroll);
actorsMap.put(tableScroll.getName(), tableScroll);
}
示例4: addTable
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addTable(Table table, Element element) {
Table newTable = new Table(skin);
parseTable(element, newTable);
Cell<Table> cell = table.add(newTable);
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null) {
atrributes = new ObjectMap<String, String>();
}
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
newTable.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
addChildrens(element, newTable);
actorsMap.put(newTable.getName(), newTable);
}
示例5: addList
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addList(Table table, Element element) {
Gdx.app.log("JXmlUi", "addList");
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null)
atrributes = new ObjectMap<String, String>();
List<String> list = new List<String>(skin);
list.getSelection().setMultiple(false);
ScrollPane scrollPane = new ScrollPane(list, skin);
Cell<ScrollPane> cell = table.add(scrollPane);
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
list.setName(atrributes.get(key));
scrollPane.setName(atrributes.get(key) + "-scroll-panel");
}
}
cellPrepare(cell, atrributes);
actorsMap.put(list.getName(), list);
actorsMap.put(scrollPane.getName(), scrollPane);
addElementsInList(element, list);
}
示例6: addButton
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addButton(Table table, Element element) {
TextButton button = new TextButton("", skin);
Cell<TextButton> cell = table.add(button);
ObjectMap<String, String> atrributes = element.getAttributes();
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("text")) {
button.setText(atrributes.get(key));
} else if (key.equalsIgnoreCase("checked")) {
button.setChecked(Boolean.parseBoolean(atrributes.get(key)));
} else if (key.equalsIgnoreCase("visible")) {
button.setVisible(Boolean.parseBoolean(atrributes.get(key)));
} else if (key.equalsIgnoreCase("enable")) {
button.setDisabled(!Boolean.parseBoolean(atrributes.get(key)));
} else if (key.equalsIgnoreCase("name")) {
button.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
// System.out.println("Dodaje button: " + button.getName());
actorsMap.put(button.getName(), button);
}
示例7: addWindow
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addWindow(Table table, Element element) {
Gdx.app.log("JXmlUi", "addWindow");
String title = element.get("title", "");
Table newTable = new Window(title, skin);
Cell<Table> cell = table.add(newTable);
ObjectMap<String, String> atrributes = element.getAttributes();
if (atrributes == null) {
atrributes = new ObjectMap<String, String>();
}
cellPrepare(cell, atrributes);
addChildrens(element, newTable);
}
示例8: addImage
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addImage(Table table, Element element) {
Image image = new Image(new Texture(element.get("path")));
Cell<Image> cell = table.add(image);
ObjectMap<String, String> atrributes = element.getAttributes();
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
image.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
actorsMap.put(image.getName(), image);
}
示例9: addLabel
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addLabel(Table table, Element element) {
ObjectMap<String, String> atrributes = element.getAttributes();
Label label = new Label(element.get("text", ""), skin);
Cell<Label> cell = table.add(label);
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
label.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
actorsMap.put(label.getName(), label);
}
示例10: addTextArea
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addTextArea(Table table, Element element) {
ObjectMap<String, String> atrributes = element.getAttributes();
TextArea textArea = new TextArea(element.get("text", ""), skin);
Cell<TextArea> cell = table.add(textArea);
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
textArea.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
actorsMap.put(textArea.getName(), textArea);
}
示例11: addTextField
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
private void addTextField(Table table, Element element) {
ObjectMap<String, String> atrributes = element.getAttributes();
TextField textField = new TextField(element.get("text", ""), skin);
Cell<TextField> cell = table.add(textField);
for (String key : atrributes.keys()) {
if (key.equalsIgnoreCase("name")) {
textField.setName(atrributes.get(key));
}
}
cellPrepare(cell, atrributes);
actorsMap.put(textField.getName(), textField);
}
示例12: loadFromXML
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
public void loadFromXML(Element root) {
ObjectMap<String, String> attributes = root.getAttributes();
if (attributes != null) {
for (String statName : attributes.keys()) {
ModifiableStat stat = ModifiableStat.valueOf(statName.toUpperCase(Locale.ENGLISH));
setMod(stat, Float.parseFloat(attributes.get(statName)));
}
}
XMLUtil.readPrimitiveMembers(this, root.getChildByName(XMLUtil.XML_PROPERTIES));
}
示例13: readParameters
import com.badlogic.gdx.utils.XmlReader.Element; //导入方法依赖的package包/类
protected static void readParameters(Condition condition, Element conditionElement) {
ObjectMap<String, String> attributes = conditionElement.getAttributes();
if (attributes == null) {
return;
}
condition.conditionParameters = new ConditionParameter[attributes.size];
int i = 0;
for (String paramName : attributes.keys()) {
condition.conditionParameters[i] = new ConditionParameter(paramName, attributes.get(paramName));
++i;
}
}