- fill more data for android target list

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8194 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
nor..67 2011-09-05 21:43:30 +00:00
parent 0c193bd5b9
commit 4994f6f0fd

View File

@ -47,18 +47,30 @@ public class ListReader implements Runnable {
while ((line = in.readLine()) != null) {
line = line.trim();
if (line.length() > 0) {
if (line.startsWith("id:")) {
target = new AndroidTarget();
int idstart = line.indexOf(":") + 1;
int idend = line.indexOf("or");
int start = line.indexOf("\"") + 1;
int end = line.lastIndexOf("\"");
target.setId(Integer.parseInt(line.substring(idstart, idend).trim()));
target.setName(line.substring(start, end));
list.add(target);
}
if (line.startsWith("Name:") && target != null) {
target.setTitle(line.split(":")[1].trim());
try {
if (line.startsWith("id:")) {
target = new AndroidTarget();
int idstart = line.indexOf(":") + 1;
int idend = line.indexOf("or");
int start = line.indexOf("\"") + 1;
int end = line.lastIndexOf("\"");
target.setId(Integer.parseInt(line.substring(idstart, idend).trim()));
target.setName(line.substring(start, end));
list.add(target);
} else if (line.startsWith("Name:") && target != null) {
target.setTitle(line.split(":")[1].trim());
} else if (line.startsWith("Type:") && target != null) {
target.setPlatform(line.split(":")[1].trim());
} else if (line.startsWith("API level:") && target != null) {
target.setApiLevel(Integer.parseInt(line.split(":")[1].trim()));
} else if (line.startsWith("Revision:") && target != null) {
target.setRevision(Integer.parseInt(line.split(":")[1].trim()));
} else if (line.startsWith("Skins:") && target != null) {
target.setSkins(line.split(":")[1].trim());
}
} catch (Exception e) {
Exceptions.printStackTrace(e);
}
if (progress != null) {
progress.progress(line);