Skip to content
Snippets Groups Projects
Commit 1ea9a40f authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

update fromString for new onelab protocol

parent b31367a1
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ public class Parameter { ...@@ -30,7 +30,7 @@ public class Parameter {
_readOnly = readOnly; _readOnly = readOnly;
_changed = false; _changed = false;
} }
protected void update(){ protected void update(){
if(_label != null && !_label.equals("")) if(_label != null && !_label.equals(""))
_title.setText(_label); _title.setText(_label);
...@@ -38,7 +38,7 @@ public class Parameter { ...@@ -38,7 +38,7 @@ public class Parameter {
_title.setText(getShortName()); _title.setText(getShortName());
if(isReadOnly()) _title.setAlpha(0.423f); if(isReadOnly()) _title.setAlpha(0.423f);
} }
public void setName(String name) {_name = name;this.update();} public void setName(String name) {_name = name;this.update();}
public void setReadOnly(boolean readOnly) {_readOnly = readOnly;this.update();} public void setReadOnly(boolean readOnly) {_readOnly = readOnly;this.update();}
public void setLabel(String label) { public void setLabel(String label) {
...@@ -65,19 +65,18 @@ public class Parameter { ...@@ -65,19 +65,18 @@ public class Parameter {
setLabel(infos[pos++]);// label setLabel(infos[pos++]);// label
pos++;// help pos++;// help
pos++;// never change pos++;// never change
pos++;// changed
if(Integer.parseInt(infos[pos++]) != 1)return -1;// visible if(Integer.parseInt(infos[pos++]) != 1)return -1;// visible
this.setReadOnly((infos[pos++].equals("1")));// read only this.setReadOnly((infos[pos++].equals("1")));// read only
int nAttributes = Integer.parseInt(infos[pos++]);// number of attributes int nAttributes = Integer.parseInt(infos[pos++]);// number of attributes
pos+=(nAttributes*2);// key+value pos+=(nAttributes*2);// key+value
int nClients = Integer.parseInt(infos[pos++]);// number of client int nClients = Integer.parseInt(infos[pos++]);// number of client
pos+=nClients;// clients pos+=(nClients*2);// client+changed
this.update(); this.update();
return pos; return pos;
} }
public boolean changed() { if(_changed){_changed=false; return true;}return _changed;} public boolean changed() { if(_changed){_changed=false; return true;}return _changed;}
public String getType(){return "Parameter";} public String getType(){return "Parameter";}
public LinearLayout getView() { public LinearLayout getView() {
LinearLayout paramLayout = new LinearLayout(_context); LinearLayout paramLayout = new LinearLayout(_context);
paramLayout.setOrientation(LinearLayout.VERTICAL); paramLayout.setOrientation(LinearLayout.VERTICAL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment