File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
159 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
165 |
box.setValue(enumObj.getSelectedValue());
// box.select(enumObj.getSelectedValue());
}
box.setImmediate(true);
box.setDescription(enumObj.getDescription());
f.addField(enumObj.getType(), box);
if (enumObj.isRequired()) {
box.setRequired(true);
box.setRequiredError(enumObj.getLabel() + " is required");
}
}
// Add simpel objects to form
for (SimpleObject simpl : tab.getSimpleObjects()) {
createForm(simpl, f);
}
// Adding collection objects as a list to form
if (tab.getCollections().size() > 0) {
for (CollectionValues cols : tab.getCollections()) {
ListSelect list = new ListSelect();
list.setCaption(cols.getLabel());
list.setWidth("120px");
list.setDescription(cols.getDescription());
if (cols.isMultiselect()) {
list.setMultiSelect(true);
}
if (cols.getValue_type().equals("string")) {
for (SimpleObject sim : cols.getCollection()) {
StringValue s = (StringValue) sim;
list.addItem(s.getValue());
list.select(s.getValue());
}
}
if (cols.getValue_type().equals("integer")) {
for (SimpleObject sim : cols.getCollection()) {
IntegerValue i = (IntegerValue) sim;
list.addItem(i.getValue());
list.select(i.getValue());
}
}
if (cols.getValue_type().equals("double")) {
for (SimpleObject sim : cols.getCollection()) {
DoubleValue d = (DoubleValue) sim;
list.addItem(d.getValue());
list.select(d.getValue());
}
}
// Adding List to Form
list.setImmediate(true);
list.setNullSelectionAllowed(true);
list.setRows(5);
list.setNewItemsAllowed(true);
f.addField(cols.getLabel(), list);
}
}
f.createFooter();
f.getSaveButton().addListener((Button.ClickListener) this);
f.getEditButton().addListener((Button.ClickListener) this);
f.getResetButton().addListener((Button.ClickListener) this);
f.getDeleteButton().addListener((Button.ClickListener) this);
f.setReadOnly(true);
f.setHeader(tab.getName());
userForms.get(o.getId()).add(f);
ontInstances.get(o.getId()).add(tab);
}
}
}
private TabForm createForm(SimpleObject simpleObject, TabForm form) throws ParseException {
if (simpleObject instanceof CalendarValue) {
CalendarValue cal = (CalendarValue) simpleObject;
PopupDateField date = new PopupDateField(cal.getLabel());
DateFormat format = new SimpleDateFormat();
if (cal.getCalendar() != null && !cal.getCalendar().equals("")) {
String d = cal.getCalendar();
Date da = null;
if (d.contains("/")) {
format = new SimpleDateFormat("MM/dd/yy H:mm a");
da = format.parse(d);
date.setLocale(Locale.US);
} else {
format = new SimpleDateFormat("dd.MM.yy H:mm");
da = format.parse(d);
date.setLocale(Locale.GERMANY);
}
date.setValue(da);
date.setResolution(PopupDateField.RESOLUTION_MIN);
date.setImmediate(true);
date.setInputPrompt(cal.getLabel());
date.setShowISOWeekNumbers(true);
date.setDescription(cal.getDescription());
form.addField(cal.getLabel(), date);
} else {
if (cal.getName().equals("hardwareSettingTime")) {
date.setValue(format.format(new Date()));
} else {
date.setInputPrompt("Last activity");
}
date.setDescription(cal.getDescription());
form.addField(cal.getLabel(), date);
}
if (cal.isRequired()) {
date.setRequired(true);
date.setRequiredError(cal.getLabel() + " is required");
}
} else if (simpleObject instanceof StringValue) {
StringValue st = (StringValue) simpleObject;
if (st.getValue().length() > 30) {
TextArea area = new TextArea(st.getLabel());
area.setImmediate(true);
area.setWriteThrough(false);
area.setRows(5);
area.setValue(st.getValue());
area.setDescription(st.getDescription());
form.addField(st.getLabel(), area);
if (st.isRequired()) {
area.setRequired(true);
area.setRequiredError(st.getLabel() + " is required");
}
if (st.getValidator() != null) {
if (st.getValidator().equals("EmailValidator")) {
area.addValidator(new EmailValidator("Emailaddress isn't correct"));
}
}
} else {
TextField tf = new TextField(st.getLabel());
tf.setWriteThrough(false);
tf.setImmediate(true);
tf.setValue(st.getValue());
tf.setDescription(st.getDescription());
form.addField(simpleObject.getLabel(), tf);
if (st.isRequired()) {
tf.setRequired(true);
tf.setRequiredError(st.getLabel() + " is required");
}
if (st.getValidator() != null) {
if (st.getValidator().equals("EmailValidator")) {
tf.addValidator(new EmailValidator("Emailaddress isn't correct"));
}
}
}
form.createFooter();
} else if (simpleObject instanceof IntegerValue) {
IntegerValue integer = (IntegerValue) simpleObject;
TextField t = new TextField(integer.getLabel());
t.setImmediate(true);
t.setWriteThrough(false);
t.setValue(((IntegerValue) simpleObject).getValue());
t.setDescription(integer.getDescription());
form.addField(simpleObject.getLabel(), t);
if (integer.isRequired()) {
t.setRequired(true);
t.setRequiredError(integer.getLabel() + " is required");
}
if (integer.getValidator() != null) {
if (integer.getValidator().equals("RegexpValidator")) {
if (integer.getName().contains("postalCode")) {
t.addValidator(new RegexpValidator("[1-9][0-9]{4}", "Postal Code isn't correct"));
} else {
t.addValidator(new RegexpValidator("[1-9][0-9]*", "Number isn't correct"));
}
}
}
} else if (simpleObject instanceof BooleanValue) {
BooleanValue bool = (BooleanValue) simpleObject;
CheckBox box = new CheckBox(bool.getLabel());
box.setImmediate(true);
box.setWriteThrough(false);
if (bool.getValue()) {
box.setValue(true);
} else {
box.setValue(false);
}
box.setDescription(bool.getDescription());
form.addField(bool.getLabel(), box);
if (bool.isRequired()) {
box.setRequired(true);
box.setRequiredError(bool.getLabel() + " is required");
}
} else if (simpleObject instanceof DoubleValue) {
DoubleValue doub = (DoubleValue) simpleObject;
TextField tf = new TextField(doub.getLabel());
tf.setImmediate(true);
tf.setWriteThrough(false);
tf.setValue(doub.getValue());
tf.setDescription(doub.getDescription());
form.addField(doub.getLabel(), tf);
if (doub.isRequired()) {
tf.setRequired(true);
tf.setRequiredError(doub.getLabel() + " is required");
}
if (doub.getValidator() != null) {
if (doub.getValidator().equals("RegexpValidator")) {
tf.addValidator(new RegexpValidator("[0-9]*[.][0-9]{5}", "The floating value isn't correct"));
}
}
}
return form;
}
public void buttonClick(ClickEvent event) {
String id = selectedItem;
if (event.getButton() == ((TabForm) tabSheet.getSelectedTab()).getSaveButton()) {
TabForm tab = ((TabForm) tabSheet.getSelectedTab());
Subprofile sub = subprofiles.get(tabSheet.getTab(tab).getCaption());
Subprofile subRoom = roomprofiles.get(tabSheet.getTab(tab).getCaption());
// Aktuelles Subprofile ubernimmt die anderungen des Formulars
ArrayList<SimpleObject> tempSim = new ArrayList<SimpleObject>();
for (SimpleObject simi : sub.getSimpleObjects()) {
tempSim.add(simi);
}
for (SimpleObject simpl : tempSim/* sub.getSimpleObjects() */) {
// tab.getItemProperty(simpl.getLabel());
if (simpl instanceof StringValue) {
StringValue val = (StringValue) simpl;
if (val.isId())
id = (String) tab.getField(simpl.getLabel()).getValue();
val.setValue((String) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof IntegerValue) {
IntegerValue val = (IntegerValue) simpl;
if (isIntegerNum(tab.getField(val.getLabel()).getValue().toString())) {
val.setValue(Integer.parseInt(tab.getField(simpl.getLabel()).getValue().toString()));
} else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof DoubleValue) {
DoubleValue val = (DoubleValue) simpl;
if (isDoubleNum(tab.getField(val.getLabel()).getValue().toString()))
val.setValue(Double.parseDouble(tab.getItemProperty(simpl.getLabel()).getValue().toString()));
else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof BooleanValue) {
BooleanValue val = (BooleanValue) simpl;
val.setValue((Boolean) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof CalendarValue) {
CalendarValue cal = (CalendarValue) simpl;
DateFormat df = new SimpleDateFormat();
if (cal.getName().equals("hardwareSettingTime")) {
String date = df.format(new Date());
cal.setCalendar(date);
}
}
}
// Enum Objecte
ArrayList<EnumObject> tempEnums = new ArrayList<EnumObject>();
for (EnumObject e : sub.getEnums()) {
tempEnums.add(e);
}
for (EnumObject en : tempEnums/* sub.getEnums() */) {
if (en.isTreeParentNode()) {
String sel = (String) ((Tree) win.getUserTree()).getValue();
win.getUserTree().setParent(sel, tab.getField(en.getType()).getValue());
}
en.setSelectedValue((String) tab.getField(en.getType()).getValue());
}
// Collections
ArrayList<CollectionValues> tempCols = new ArrayList<CollectionValues>();
for (CollectionValues v : sub.getCollections()) {
tempCols.add(v);
}
for (CollectionValues col : tempCols /* sub.getCollections() */) {
Collection<SimpleObject> values = new ArrayList<SimpleObject>();
Collection<SimpleObject> newVal = null;
for (SimpleObject sim : col.getCollection()) {
if (sim instanceof StringValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
StringValue n = new StringValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
n.setValue(array[i].toString());
values.add(n);
}
} else if (sim instanceof IntegerValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
IntegerValue n = new IntegerValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isIntegerNum(array[i].toString()))
n.setValue(Integer.parseInt(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
} else if (sim instanceof DoubleValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
DoubleValue n = new DoubleValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isDoubleNum(array[i].toString()))
n.setValue(Double.parseDouble(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
}
col.setCollection(values);
}
}
// Roomsfile
ArrayList<SimpleObject> roomSimpls = new ArrayList<SimpleObject>();
for (SimpleObject teSim : subRoom.getSimpleObjects()) {
roomSimpls.add(teSim);
}
for (SimpleObject simpl : roomSimpls/* subRoom.getSimpleObjects() */) {
// tab.getItemProperty(simpl.getLabel());
if (simpl instanceof StringValue) {
StringValue val = (StringValue) simpl;
val.setValue((String) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof IntegerValue) {
IntegerValue val = (IntegerValue) simpl;
if (isIntegerNum(tab.getField(val.getLabel()).getValue().toString())) {
val.setValue(Integer.parseInt(tab.getField(simpl.getLabel()).getValue().toString()));
} else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof DoubleValue) {
DoubleValue val = (DoubleValue) simpl;
if (isDoubleNum(tab.getField(val.getLabel()).getValue().toString()))
val.setValue(Double.parseDouble(tab.getItemProperty(simpl.getLabel()).getValue().toString()));
else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof BooleanValue) {
BooleanValue val = (BooleanValue) simpl;
val.setValue((Boolean) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof CalendarValue) {
CalendarValue cal = (CalendarValue) simpl;
DateFormat df = new SimpleDateFormat();
if (cal.getName().equals("hardwareSettingTime")) {
String date = df.format(new Date());
cal.setCalendar(date);
}
}
}
// Enum Objecte
ArrayList<EnumObject> roomEns = new ArrayList<EnumObject>();
for (EnumObject te : subRoom.getEnums()) {
roomEns.add(te);
}
for (EnumObject en : roomEns/* subRoom.getEnums() */) {
en.setSelectedValue((String) tab.getItemProperty(en.getType()).getValue());
}
ArrayList<CollectionValues> roomCols = new ArrayList<CollectionValues>();
for (CollectionValues c : subRoom.getCollections()) {
roomCols.add(c);
}
for (CollectionValues col : roomCols /* subRoom.getCollections() */) {
Collection<SimpleObject> values = new ArrayList<SimpleObject>();
Collection<SimpleObject> newVal = null;
for (SimpleObject sim : col.getCollection()) {
if (sim instanceof StringValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
StringValue n = new StringValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
n.setValue(array[i].toString());
values.add(n);
}
} else if (sim instanceof IntegerValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
IntegerValue n = new IntegerValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isIntegerNum(array[i].toString()))
n.setValue(Integer.parseInt(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
} else if (sim instanceof DoubleValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
DoubleValue n = new DoubleValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isDoubleNum(array[i].toString()))
n.setValue(Double.parseDouble(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
}
col.setCollection(values);
}
}
sub.setCollections(tempCols);
sub.setEnums(tempEnums);
sub.setSimpleObjects(tempSim);
subRoom.setCollections(roomCols);
subRoom.setEnums(roomEns);
subRoom.setSimpleObjects(roomSimpls);
HashMap<String, ArrayList<Subprofile>> nOntInstances = new HashMap<String, ArrayList<Subprofile>>();
for (Map.Entry<String, ArrayList<Subprofile>> tOnt : ontInstances.entrySet()) {
if (tOnt.getKey().equals(id)) { |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
269 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
253 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
276 |
if (st.getValue().length() > 30) {
TextArea area = new TextArea(st.getLabel());
area.setImmediate(true);
area.setWriteThrough(false);
area.setRows(5);
area.setValue(st.getValue());
area.setDescription(st.getDescription());
form.addField(st.getLabel(), area);
if (st.isRequired()) {
area.setRequired(true);
area.setRequiredError(st.getLabel() + " is required");
}
if (st.getValidator() != null) {
if (st.getValidator().equals("EmailValidator")) {
area.addValidator(new EmailValidator("Emailaddress isn't correct"));
}
}
} else {
TextField tf = new TextField(st.getLabel());
tf.setWriteThrough(false);
tf.setImmediate(true);
tf.setValue(st.getValue());
tf.setDescription(st.getDescription());
form.addField(simpleObject.getLabel(), tf);
if (st.isRequired()) {
tf.setRequired(true);
tf.setRequiredError(st.getLabel() + " is required");
}
if (st.getValidator() != null) {
if (st.getValidator().equals("EmailValidator")) {
tf.addValidator(new EmailValidator("Emailaddress isn't correct"));
}
}
}
form.createFooter();
} else if (simpleObject instanceof IntegerValue) {
IntegerValue integer = (IntegerValue) simpleObject;
TextField t = new TextField(integer.getLabel());
t.setImmediate(true);
t.setWriteThrough(false);
t.setValue(((IntegerValue) simpleObject).getValue());
t.setDescription(integer.getDescription());
form.addField(simpleObject.getLabel(), t);
if (integer.isRequired()) {
t.setRequired(true);
t.setRequiredError(integer.getLabel() + " is required");
}
if (integer.getValidator() != null) {
if (integer.getValidator().equals("RegexpValidator")) {
if (integer.getName().contains("postalCode")) {
t.addValidator(new RegexpValidator("[1-9][0-9]{4}", "Postal Code isn't correct"));
} else {
t.addValidator(new RegexpValidator("[1-9][0-9]*", "Number isn't correct"));
}
}
}
} else if (simpleObject instanceof BooleanValue) {
BooleanValue bool = (BooleanValue) simpleObject;
CheckBox box = new CheckBox(bool.getLabel());
box.setImmediate(true);
box.setWriteThrough(false);
if (bool.getValue()) {
box.setValue(true);
} else {
box.setValue(false);
}
box.setDescription(bool.getDescription());
form.addField(bool.getLabel(), box);
if (bool.isRequired()) {
box.setRequired(true);
box.setRequiredError(bool.getLabel() + " is required");
}
} else if (simpleObject instanceof DoubleValue) {
DoubleValue doub = (DoubleValue) simpleObject;
TextField tf = new TextField(doub.getLabel());
tf.setImmediate(true);
tf.setWriteThrough(false);
tf.setValue(doub.getValue());
tf.setDescription(doub.getDescription());
form.addField(doub.getLabel(), tf);
if (doub.isRequired()) {
tf.setRequired(true);
tf.setRequiredError(doub.getLabel() + " is required");
}
if (doub.getValidator() != null) {
if (doub.getValidator().equals("RegexpValidator")) {
tf.addValidator(new RegexpValidator("[0-9]*[.][0-9]{5}", "The floating value isn't correct"));
}
}
}
return form;
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
267 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
223 |
if (st.getValue().length() > 30) {
TextArea area = new TextArea(st.getLabel());
area.setImmediate(true);
area.setWriteThrough(false);
area.setRows(5);
area.setDescription(st.getDescription());
if (st.isRequired()) {
area.setRequired(true);
area.setRequiredError(st.getLabel() + " is required");
}
if (st.getValidator() != null) {
if (st.getValidator().equals("EmailValidator")) {
area.addValidator(new EmailValidator("The Emailaddress isn't correct"));
}
}
form.addField(st.getLabel(), area);
} else {
TextField tf = new TextField(st.getLabel());
tf.setWriteThrough(false);
tf.setImmediate(true);
tf.setDescription(st.getDescription());
if (st.isRequired()) {
tf.setRequired(true);
tf.setRequiredError(st.getLabel() + " is required");
}
if (st.getValidator() != null) {
if (st.getValidator().equals("EmailValidator")) {
tf.addValidator(new EmailValidator("The Emailaddress isn't correct"));
}
}
form.addField(simpleObject.getLabel(), tf);
}
form.createFooter();
} else if (simpleObject instanceof IntegerValue) {
IntegerValue integer = (IntegerValue) simpleObject;
TextField t = new TextField(integer.getLabel());
t.setImmediate(true);
t.setWriteThrough(false);
t.setDescription(integer.getDescription());
if (integer.isRequired()) {
t.setRequired(true);
t.setRequiredError(integer.getLabel() + " is required");
}
if (integer.getValidator() != null) {
if (integer.getValidator().equals("RegexpValidator")) {
if (integer.getName().contains("postalCode")) {
t.addValidator(new RegexpValidator("[1-9][0-9]{4}", "The postal code isn't correct"));
} else {
t.addValidator(new RegexpValidator("[1-9][0-9]*", "Please insert an valid number"));
}
}
}
form.addField(simpleObject.getLabel(), t);
} else if (simpleObject instanceof BooleanValue) {
BooleanValue bool = (BooleanValue) simpleObject;
CheckBox box = new CheckBox(bool.getLabel());
box.setImmediate(true);
box.setWriteThrough(false);
box.setDescription(bool.getDescription());
if (bool.isRequired()) {
box.setRequired(true);
box.setRequiredError(bool.getLabel() + " is required");
}
form.addField(bool.getLabel(), box);
} else if (simpleObject instanceof DoubleValue) {
DoubleValue doub = (DoubleValue) simpleObject;
TextField tf = new TextField(doub.getLabel());
tf.setImmediate(true);
tf.setWriteThrough(false);
tf.setDescription(doub.getDescription());
if (doub.isRequired()) {
tf.setRequired(true);
tf.setRequiredError(doub.getLabel() + " is required");
}
if (doub.getValidator() != null) {
if (doub.getValidator().equals("RegexpValidator")) {
tf.addValidator(new RegexpValidator("[0-9]*[.][0-9]{5}", "Please insert a valid floating number"));
}
}
form.addField(doub.getLabel(), tf);
}
return form;
}
String hw = ""; |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
418 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
369 |
}
sub.setEnums(enums);
// CollectionValues
ArrayList<CollectionValues> collections = new ArrayList<CollectionValues>();
for (CollectionValues cols : subprofiles.get(tabHeader).getCollections()) {
Collection<SimpleObject> values = new ArrayList<SimpleObject>();
Collection<SimpleObject> newVal = null;
for (SimpleObject sim : cols.getCollection()) {
if (sim instanceof StringValue) {
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
StringValue n = new StringValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
n.setValue(array[i].toString());
values.add(n);
}
} else if (sim instanceof IntegerValue) {
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
IntegerValue n = new IntegerValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isIntegerNum(array[i].toString()))
n.setValue(Integer.parseInt(array[i].toString()));
else
n.setValue(0);
values.add(n);
}
} else if (sim instanceof DoubleValue) {
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
DoubleValue n = new DoubleValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isDoubleNum(array[i].toString()))
n.setValue(Double.parseDouble(array[i].toString()));
else
n.setValue(0.0);
values.add(n);
}
}
cols.setCollection(values);
}
collections.add(cols);
}
sub.setCollections(collections); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
526 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
403 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
533 |
for (CollectionValues col : roomCols /* subRoom.getCollections() */) {
Collection<SimpleObject> values = new ArrayList<SimpleObject>();
Collection<SimpleObject> newVal = null;
for (SimpleObject sim : col.getCollection()) {
if (sim instanceof StringValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
StringValue n = new StringValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
n.setValue(array[i].toString());
values.add(n);
}
} else if (sim instanceof IntegerValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
IntegerValue n = new IntegerValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isIntegerNum(array[i].toString()))
n.setValue(Integer.parseInt(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
} else if (sim instanceof DoubleValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
DoubleValue n = new DoubleValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isDoubleNum(array[i].toString()))
n.setValue(Double.parseDouble(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
}
col.setCollection(values);
}
}
sub.setCollections(tempCols);
sub.setEnums(tempEnums);
sub.setSimpleObjects(tempSim); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
422 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
401 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
429 |
tempCols.add(v);
}
for (CollectionValues col : tempCols /* sub.getCollections() */) {
Collection<SimpleObject> values = new ArrayList<SimpleObject>();
Collection<SimpleObject> newVal = null;
for (SimpleObject sim : col.getCollection()) {
if (sim instanceof StringValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
StringValue n = new StringValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
n.setValue(array[i].toString());
values.add(n);
}
} else if (sim instanceof IntegerValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
IntegerValue n = new IntegerValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isIntegerNum(array[i].toString()))
n.setValue(Integer.parseInt(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
} else if (sim instanceof DoubleValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
DoubleValue n = new DoubleValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isDoubleNum(array[i].toString()))
n.setValue(Double.parseDouble(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
}
col.setCollection(values);
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
423 |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
541 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
374 |
for (CollectionValues cols : subprofiles.get(tabHeader).getCollections()) {
Collection<SimpleObject> values = new ArrayList<SimpleObject>();
Collection<SimpleObject> newVal = null;
for (SimpleObject sim : cols.getCollection()) {
if (sim instanceof StringValue) {
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
StringValue n = new StringValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
n.setValue(array[i].toString());
values.add(n);
}
} else if (sim instanceof IntegerValue) {
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
IntegerValue n = new IntegerValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isIntegerNum(array[i].toString()))
n.setValue(Integer.parseInt(array[i].toString()));
else
n.setValue(0);
values.add(n);
}
} else if (sim instanceof DoubleValue) {
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
DoubleValue n = new DoubleValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isDoubleNum(array[i].toString()))
n.setValue(Double.parseDouble(array[i].toString()));
else
n.setValue(0.0);
values.add(n);
}
}
cols.setCollection(values);
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
424 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
526 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
431 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
533 |
for (CollectionValues col : tempCols /* sub.getCollections() */) {
Collection<SimpleObject> values = new ArrayList<SimpleObject>();
Collection<SimpleObject> newVal = null;
for (SimpleObject sim : col.getCollection()) {
if (sim instanceof StringValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
StringValue n = new StringValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
n.setValue(array[i].toString());
values.add(n);
}
} else if (sim instanceof IntegerValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
IntegerValue n = new IntegerValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isIntegerNum(array[i].toString()))
n.setValue(Integer.parseInt(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
} else if (sim instanceof DoubleValue) {
newVal = (Collection<SimpleObject>) tab.getField(col.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
DoubleValue n = new DoubleValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isDoubleNum(array[i].toString()))
n.setValue(Double.parseDouble(array[i].toString()));
else
n.setValue(n.getDefaultValue());
values.add(n);
}
}
col.setCollection(values);
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
153 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
131 |
}
// Create ComboBox with enum objects and add to form
for (String item : enumObj.getValues()) {
box.addItem(item);
box.setNullSelectionAllowed(false);
box.setNewItemsAllowed(false);
box.setValue(enumObj.getSelectedValue());
// box.select(enumObj.getSelectedValue());
}
box.setImmediate(true);
box.setDescription(enumObj.getDescription());
f.addField(enumObj.getType(), box);
if (enumObj.isRequired()) {
box.setRequired(true);
box.setRequiredError(enumObj.getLabel() + " is required");
}
}
// Add simpel objects to form
for (SimpleObject simpl : tab.getSimpleObjects()) {
createForm(simpl, f);
}
// Adding collection objects as a list to form
if (tab.getCollections().size() > 0) {
for (CollectionValues cols : tab.getCollections()) {
ListSelect list = new ListSelect();
list.setCaption(cols.getLabel());
list.setWidth("120px");
list.setDescription(cols.getDescription());
if (cols.isMultiselect()) {
list.setMultiSelect(true);
}
if (cols.getValue_type().equals("string")) {
for (SimpleObject sim : cols.getCollection()) {
StringValue s = (StringValue) sim;
list.addItem(s.getValue());
list.select(s.getValue());
}
}
if (cols.getValue_type().equals("integer")) {
for (SimpleObject sim : cols.getCollection()) {
IntegerValue i = (IntegerValue) sim;
list.addItem(i.getValue());
list.select(i.getValue());
}
}
if (cols.getValue_type().equals("double")) {
for (SimpleObject sim : cols.getCollection()) {
DoubleValue d = (DoubleValue) sim;
list.addItem(d.getValue());
list.select(d.getValue());
}
}
// Adding List to Form
list.setImmediate(true);
list.setNullSelectionAllowed(true); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
137 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
165 |
box.setValue(enumObj.getSelectedValue());
// box.select(enumObj.getSelectedValue());
}
box.setImmediate(true);
box.setDescription(enumObj.getDescription());
f.addField(enumObj.getType(), box);
if (enumObj.isRequired()) {
box.setRequired(true);
box.setRequiredError(enumObj.getLabel() + " is required");
}
}
// Add simpel objects to form
for (SimpleObject simpl : tab.getSimpleObjects()) {
createForm(simpl, f);
}
// Adding collection objects as a list to form
if (tab.getCollections().size() > 0) {
for (CollectionValues cols : tab.getCollections()) {
ListSelect list = new ListSelect();
list.setCaption(cols.getLabel());
list.setWidth("120px");
list.setDescription(cols.getDescription());
if (cols.isMultiselect()) {
list.setMultiSelect(true);
}
if (cols.getValue_type().equals("string")) {
for (SimpleObject sim : cols.getCollection()) {
StringValue s = (StringValue) sim;
list.addItem(s.getValue());
list.select(s.getValue());
}
}
if (cols.getValue_type().equals("integer")) {
for (SimpleObject sim : cols.getCollection()) {
IntegerValue i = (IntegerValue) sim;
list.addItem(i.getValue());
list.select(i.getValue());
}
}
if (cols.getValue_type().equals("double")) {
for (SimpleObject sim : cols.getCollection()) {
DoubleValue d = (DoubleValue) sim;
list.addItem(d.getValue());
list.select(d.getValue());
}
}
// Adding List to Form
list.setImmediate(true);
list.setNullSelectionAllowed(false); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
363 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
316 |
room.setName(tabHeader);
// SimpleObjects
ArrayList<SimpleObject> simpleObjects = new ArrayList<SimpleObject>();
for (SimpleObject sim : subprofiles.get(tabHeader).getSimpleObjects()) {
if (sim instanceof StringValue) {
StringValue s = (StringValue) sim;
s.setValue((String) tab.getField(s.getLabel()).getValue());
simpleObjects.add(s);
if (s.isId()) {
ontId = s.getValue();
}
}
if (sim instanceof IntegerValue) {
IntegerValue integer = (IntegerValue) sim;
if (isIntegerNum(tab.getField(sim.getLabel()).getValue().toString()))
integer.setValue(Integer.parseInt(tab.getField(sim.getLabel()).getValue().toString()));
else
integer.setValue(0);
simpleObjects.add(integer);
}
if (sim instanceof DoubleValue) {
DoubleValue doub = (DoubleValue) sim;
if (isDoubleNum(tab.getField(doub.getLabel()).getValue().toString()))
doub.setValue(Double.parseDouble(tab.getField(doub.getLabel()).getValue().toString()));
else
doub.setValue(0.0);
simpleObjects.add(doub);
}
if (sim instanceof BooleanValue) {
BooleanValue bool = (BooleanValue) sim;
bool.setValue((Boolean) tab.getField(bool.getLabel()).getValue());
simpleObjects.add(bool);
}
if (sim instanceof CalendarValue) {
CalendarValue cal = (CalendarValue) sim;
DateFormat df = new SimpleDateFormat();
if (cal.getName().equals("hardwareSettingTime")) { |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
589 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
596 |
if (tOnt.getKey().equals(id)) {
nOntInstances.put(tOnt.getKey(), new ArrayList<Subprofile>());
for (Subprofile sp : tOnt.getValue()) {
if (sp.getName().equals(sub.getName())) {
nOntInstances.get(tOnt.getKey()).add(sub);
} else {
nOntInstances.get(tOnt.getKey()).add(sp);
}
}
} else {
nOntInstances.put(tOnt.getKey(), tOnt.getValue());
}
}
// For room
HashMap<String, ArrayList<Subprofile>> ri = new HashMap<String, ArrayList<Subprofile>>();
for (Map.Entry<String, ArrayList<Subprofile>> tOnt : roomInstances.entrySet()) {
if (tOnt.getKey().equals(id)) {
ri.put(tOnt.getKey(), new ArrayList<Subprofile>());
for (Subprofile sp : tOnt.getValue()) {
if (sp.getName().equals(subRoom.getName())) {
ri.get(tOnt.getKey()).add(subRoom);
} else {
ri.get(tOnt.getKey()).add(sp);
}
}
} else {
ri.put(tOnt.getKey(), tOnt.getValue());
}
}
dataAccess.updateUserData(actualFlat, id, nOntInstances);
dataAccess.updateUserData(actualRoom, id, ri); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
380 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
487 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
387 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
494 |
val.setValue((String) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof IntegerValue) {
IntegerValue val = (IntegerValue) simpl;
if (isIntegerNum(tab.getField(val.getLabel()).getValue().toString())) {
val.setValue(Integer.parseInt(tab.getField(simpl.getLabel()).getValue().toString()));
} else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof DoubleValue) {
DoubleValue val = (DoubleValue) simpl;
if (isDoubleNum(tab.getField(val.getLabel()).getValue().toString()))
val.setValue(Double.parseDouble(tab.getItemProperty(simpl.getLabel()).getValue().toString()));
else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof BooleanValue) {
BooleanValue val = (BooleanValue) simpl;
val.setValue((Boolean) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof CalendarValue) {
CalendarValue cal = (CalendarValue) simpl;
DateFormat df = new SimpleDateFormat();
if (cal.getName().equals("hardwareSettingTime")) {
String date = df.format(new Date());
cal.setCalendar(date);
}
}
}
// Enum Objecte
ArrayList<EnumObject> tempEnums = new ArrayList<EnumObject>(); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
124 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
116 |
TabForm form = null;
// Every Subprofile is shown in a seperate tab
for (Subprofile tab : objects.get(0).getSubprofiles()) {
instance.getSubprofiles().add(tab);
f = new TabForm();
// Save Subprofile Tabs for later use
subprofiles.put(tab.getName(), tab);
// Creating User tree and Comboboxes
for (EnumObject enumObj : tab.getEnums()) {
NativeSelect box = new NativeSelect(enumObj.getLabel());
box.setDescription(enumObj.getDescription());
// Create ComboBox with enum objects and add to form
for (String item : enumObj.getValues()) {
box.addItem(item);
}
box.setImmediate(true);
if (enumObj.isRequired()) {
box.setRequired(true);
box.setRequiredError(enumObj.getLabel() + " is required");
}
if (enumObj.isTreeParentNode()) {
f.setId(enumObj.getType());
}
f.addField(enumObj.getType(), box);
}
// Add simpel objects to form
for (SimpleObject simpl : tab.getSimpleObjects()) {
createForm(simpl, f);
}
// Adding collection objects as a list to form
if (tab.getCollections().size() > 0) {
for (CollectionValues cols : tab.getCollections()) {
ListSelect list = new ListSelect();
list.setCaption(cols.getLabel());
list.setWidth("120px");
list.setDescription(cols.getDescription());
if (cols.isMultiselect()) {
list.setMultiSelect(true);
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
483 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
358 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
490 |
for (SimpleObject simpl : roomSimpls/* subRoom.getSimpleObjects() */) {
// tab.getItemProperty(simpl.getLabel());
if (simpl instanceof StringValue) {
StringValue val = (StringValue) simpl;
val.setValue((String) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof IntegerValue) {
IntegerValue val = (IntegerValue) simpl;
if (isIntegerNum(tab.getField(val.getLabel()).getValue().toString())) {
val.setValue(Integer.parseInt(tab.getField(simpl.getLabel()).getValue().toString()));
} else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof DoubleValue) {
DoubleValue val = (DoubleValue) simpl;
if (isDoubleNum(tab.getField(val.getLabel()).getValue().toString()))
val.setValue(Double.parseDouble(tab.getItemProperty(simpl.getLabel()).getValue().toString()));
else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof BooleanValue) {
BooleanValue val = (BooleanValue) simpl;
val.setValue((Boolean) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof CalendarValue) {
CalendarValue cal = (CalendarValue) simpl;
DateFormat df = new SimpleDateFormat(); |
File |
Project |
Line |
org/universAAL/tools/ucc/configuration/view/ConfigurationListSelect.java |
universAAL Tools uCC Configuration Configurator |
39 |
org/universAAL/tools/ucc/configuration/view/MultiselectionList.java |
universAAL Tools uCC Configuration Configurator |
30 |
public ConfigurationListSelect(VaadinConfigurationController controller, MapConfigurationOption mapOption,
ConfigOptionRegistry registry) {
super(mapOption.getLabel());
b = new BeanItemContainer<Option>(Option.class);
b.addAll(mapOption.getOptions());
setContainerDataSource(b);
this.controller = controller;
factory = new ObjectFactory();
configOption = mapOption;
setSelection();
configOption.addListener(this);
addListener(new Property.ValueChangeListener() {
public void valueChange(Property.ValueChangeEvent event) {
setComponentError(null);
try {
if (isMultiSelect()) {
Collection<Option> values = (Collection<Option>) event.getProperty().getValue();
List<Value> configValues = new LinkedList<Value>();
for (Option option : values) {
Value v = factory.createValue();
v.setKey(option.getKey());
v.setValue(option.getValue());
configValues.add(v);
}
configOption.setValue(configValues);
} else {
Value v = factory.createValue();
Option p = (Option) event.getProperty().getValue();
v.setKey(p.getKey());
v.setValue(p.getValue());
configOption.setValue(v);
}
} catch (ValidationException e) {
// Set the error of the validators as error message of this
// list select.
setComponentError(new UserError(e.getMessage()));
} |
File |
Project |
Line |
org/universAAL/tools/ucc/configuration/view/SimpleConfiguratorPasswordField.java |
universAAL Tools uCC Configuration Configurator |
45 |
org/universAAL/tools/ucc/configuration/view/SimpleConfiguratorTextField.java |
universAAL Tools uCC Configuration Configurator |
54 |
SimpleConfiguratorPasswordField.this.controller.checkDependencies();
} catch (ValidationException e) {
// Set the error message of the validators as the error
// message of the text field
setComponentError(new UserError(e.getMessage()));
}
}
});
}
/**
* Set default validators for double and integer.
*
* @param option
*/
private void setDefaultValidators(SimpleConfigurationOption option) {
if (option.getType().equals(SimpleConfigItemTypes.INTEGER)) {
configOption.addValidator(IntegerValidator.class.getName(),
new IntegerValidator("Please use only numbers"));
} else if (option.getType().equals(SimpleConfigItemTypes.DOUBLE)) {
configOption.addValidator(DoubleValidator.class.getName(),
new DoubleValidator("Please use only floating point numbers"));
}
setRequired(configOption.isRequired());
}
public SimpleConfigurationOption getConfigOption() {
return configOption;
}
/**
* return true if the TextField is valid and the configuration option.
*/
public boolean isValid() {
if (!super.isValid()) {
return false;
}
return configOption.isValid();
}
public String getID() {
return configOption.getId();
}
@Override
public void detach() {
super.detach();
configOption.removeListener(this);
}
public void configurationChanged(ConfigOptionRegistry registry, ConfigurationOption option) {
setComponentError(null);
try {
option.doDeepValidation();
} catch (ValidationException e) {
setComponentError(new UserError(e.getMessage()));
}
setEnabled(configOption.isActive());
setRequired(configOption.isRequired());
setValue(configOption.getValue());
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
620 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
627 |
dataAccess.updateUserData(actualRoom, id, ri);
tab.setReadOnly(true);
tab.getSaveButton().setVisible(false);
tab.getEditButton().setVisible(true);
tab.getDeleteButton().setVisible(true);
app.getMainWindow().showNotification(tab.getHeader() + " was updated", Notification.POSITION_CENTERED);
} // Edit button was pushed
else if (event.getButton() == ((TabForm) tabSheet.getSelectedTab()).getEditButton()) {
TabForm tab = ((TabForm) tabSheet.getSelectedTab());
tab.getSaveButton().setVisible(true);
tab.getEditButton().setVisible(false);
tab.getResetButton().setVisible(true);
tab.getDeleteButton().setVisible(false);
tab.setReadOnly(false);
if (tab.getField("Device Address:") != null)
tab.getField("Device Address:").setReadOnly(true);
if (tab.getField("Last activity time:") != null)
tab.getField("Last activity time:").setReadOnly(true);
if (tab.getField("Setting time:") != null)
tab.getField("Setting time:").setReadOnly(true);
} // Delete Button was pushed
else if (event.getButton() == ((TabForm) tabSheet.getSelectedTab()).getDeleteButton()) {
dataAccess.deleteUserData(actualFlat, selectedItem);
dataAccess.deleteUserData(actualRoom, selectedItem); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
380 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
361 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
387 |
val.setValue((String) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof IntegerValue) {
IntegerValue val = (IntegerValue) simpl;
if (isIntegerNum(tab.getField(val.getLabel()).getValue().toString())) {
val.setValue(Integer.parseInt(tab.getField(simpl.getLabel()).getValue().toString()));
} else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof DoubleValue) {
DoubleValue val = (DoubleValue) simpl;
if (isDoubleNum(tab.getField(val.getLabel()).getValue().toString()))
val.setValue(Double.parseDouble(tab.getItemProperty(simpl.getLabel()).getValue().toString()));
else
val.setValue(val.getDefaultValue());
} else if (simpl instanceof BooleanValue) {
BooleanValue val = (BooleanValue) simpl;
val.setValue((Boolean) tab.getField(simpl.getLabel()).getValue());
} else if (simpl instanceof CalendarValue) {
CalendarValue cal = (CalendarValue) simpl;
DateFormat df = new SimpleDateFormat(); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/install/DeploymentInfoController.java |
universAAL Tools uCC Frontend |
496 |
org/universAAL/tools/ucc/windows/SelectUserWindow.java |
universAAL Tools uCC Frontend |
247 |
app.getMainWindow().addWindow(sw);
// Selecting user for which service will be installed
List<String> users = new ArrayList<String>();
DataAccess da = Activator.getDataAccess();
ArrayList<OntologyInstance> ontList = da.getEmptyCHEFormFields("User");
String uname = "";
String role = "";
for (OntologyInstance o : ontList) {
System.err.println("Getting all users!");
for (Subprofile s : o.getSubprofiles()) {
for (SimpleObject sim : s.getSimpleObjects()) {
StringValue st = (StringValue) sim;
if (st.getName().equals("username")) {
uname = st.getValue();
}
}
System.err.println(s.getEnums().size());
for (EnumObject en : s.getEnums()) {
System.err.println(en.getType());
if (en.equals("userRole")) {
role = en.getSelectedValue();
System.err.println(role);
}
}
if (role.equals(Role.ASSISTEDPERSON.name()) || role.equals(Role.ENDUSER.name())) {
System.err.println(role);
users.add(uname);
}
}
users.add(uname);
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
657 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
664 |
rWin.getRwc().getTabSheet().removeAllComponents();
}
}
}
tabSheet.removeAllComponents();
app.getMainWindow().showNotification(selectedItem + " was deleted", Notification.POSITION_CENTERED);
}
}
public TabSheet getTabSheet() {
return tabSheet;
}
public void setTabSheet(TabSheet tabSheet) {
this.tabSheet = tabSheet;
}
public void valueChange(ValueChangeEvent event) {
Tree tree = ((Tree) event.getProperty());
if (tree.getValue() != null) {
if (!tree.isRoot(tree.getValue())) {
selectedItem = (String) tree.getValue();
try {
loadData();
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
tabSheet.removeAllComponents();
for (TabForm form : userForms.get(selectedItem)) {
Tab act = tabSheet.addTab(form, form.getHeader());
act.setClosable(true);
}
} else {
try {
AddNewHardwareWindow personWindow = new AddNewHardwareWindow(win, null, app); |
File |
Project |
Line |
org/universAAL/tools/ucc/windows/SelectUserWindow.java |
universAAL Tools uCC Frontend |
55 |
org/universAAL/tools/ucc/windows/SelectUserWindow.java |
universAAL Tools uCC Frontend |
279 |
vl = new VerticalLayout();
vl.setSizeFull();
vl.setMargin(true);
vl.setSpacing(true);
setContent(vl);
Label l = new Label("For which user do you want to install the service?");
list = new ListSelect("List of users in space");
list.setImmediate(true);
list.setMultiSelect(false);
list.setWidth("200px");
list.setNullSelectionAllowed(false);
// list.setNewItemsAllowed(false);
for (String u : users) {
list.addItem(u);
}
vl.addComponent(l);
vl.addComponent(list);
vl.setComponentAlignment(list, Alignment.TOP_CENTER);
addUser = new Button("Add User");
addUser.addListener(this);
ok = new Button("OK");
ok.addListener(this);
HorizontalLayout hl = new HorizontalLayout();
hl.setSpacing(true);
hl.setMargin(true);
hl.addComponent(addUser);
hl.addComponent(ok);
cancel = new Button("Cancel");
cancel.addListener(this);
hl.addComponent(cancel);
vl.addComponent(hl);
vl.setComponentAlignment(hl, Alignment.BOTTOM_CENTER); |
File |
Project |
Line |
org/universAAL/tools/ucc/configuration/view/ConfigurationListSelect.java |
universAAL Tools uCC Configuration Configurator |
98 |
org/universAAL/tools/ucc/configuration/view/MultiselectionList.java |
universAAL Tools uCC Configuration Configurator |
89 |
setMultiSelect(configOption.allowMultiselection());
}
/**
* If the is valid method of the list select is valid and the configuration
* option is valid return true else false.
*/
public boolean isValid() {
if (!super.isValid()) {
return false;
}
return configOption.isValid();
}
@Override
public void detach() {
super.detach();
configOption.removeListener(this);
}
private void setSelection() {
List<Option> selects = new ArrayList<Option>();
for (Value value : configOption.getValues()) {
for (Option option : (Collection<Option>) b.getItemIds()) {
if (value.getValue().equals(option.getValue())) {
selects.add(option);
}
}
}
if (selects.size() > 1) {
setValue(selects);
} else if (selects.size() == 1) {
setValue(selects.get(0));
}
}
public ConfigurationOption getConfigOption() {
return configOption;
}
public void configurationChanged(ConfigOptionRegistry registry, ConfigurationOption option) {
setEnabled(configOption.isActive()); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
210 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
188 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
216 |
list.setNullSelectionAllowed(true);
list.setRows(5);
list.setNewItemsAllowed(true);
f.addField(cols.getLabel(), list);
}
}
f.createFooter();
f.getSaveButton().addListener((Button.ClickListener) this);
f.getEditButton().addListener((Button.ClickListener) this);
f.getResetButton().addListener((Button.ClickListener) this);
f.getDeleteButton().addListener((Button.ClickListener) this);
f.setReadOnly(true);
f.setHeader(tab.getName());
userForms.get(o.getId()).add(f);
ontInstances.get(o.getId()).add(tab);
}
}
}
private TabForm createForm(SimpleObject simpleObject, TabForm form) throws ParseException {
if (simpleObject instanceof CalendarValue) {
CalendarValue cal = (CalendarValue) simpleObject;
PopupDateField date = new PopupDateField(cal.getLabel()); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
134 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
139 |
f = new TabForm();
// Save Subprofile Tabs for later use
subprofiles.put(tab.getName(), tab);
String selectedRole = null;
// Creating User tree and Comboboxes
for (EnumObject enumObj : tab.getEnums()) {
NativeSelect box = new NativeSelect(enumObj.getLabel());
box.setImmediate(true);
if (enumObj.isTreeParentNode()) {
for (String item : enumObj.getValues()) {
win.getUserTree().addItem(item);
win.getUserTree().setChildrenAllowed(item, true);
win.getUserTree().expandItemsRecursively(item);
}
selectedRole = enumObj.getSelectedValue();
win.getUserTree().addItem(o.getId());
win.getUserTree().setParent(o.getId(), selectedRole);
win.getUserTree().setChildrenAllowed(o.getId(), false);
}
// Create ComboBox with enum objects and add to form
for (String item : enumObj.getValues()) {
box.addItem(item);
box.setNullSelectionAllowed(false); |
File |
Project |
Line |
org/universAAL/tools/ucc/windows/NoConfigurationWindow.java |
universAAL Tools uCC Frontend |
24 |
org/universAAL/tools/ucc/windows/SuccessWindow.java |
universAAL Tools uCC Frontend |
28 |
setWidth("425px");
setHeight("300px");
Label label = new Label("<b>" + msg + "</b>", Label.CONTENT_XHTML);
panel = new Panel();
panel.setStyleName(Reindeer.PANEL_LIGHT);
panel.setWidth("300px");
VerticalLayout vl = new VerticalLayout();
vl.setSizeFull();
vl.setSpacing(true);
vl.setMargin(true);
VerticalLayout pl = (VerticalLayout) panel.getContent();
pl.setSpacing(true);
pl.setMargin(true);
pl.addComponent(label);
vl.addComponent(panel);
vl.setComponentAlignment(panel, Alignment.MIDDLE_CENTER);
ok = new Button(bundle.getString("ok.button"));
ok.addListener(this);
vl.addComponent(ok);
vl.setComponentAlignment(ok, Alignment.BOTTOM_CENTER);
setContent(vl);
center();
setResizable(false);
setModal(true);
setClosable(false);
}
public void buttonClick(ClickEvent event) { |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
461 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
592 |
sub.setSimpleObjects(tempSim);
HashMap<String, ArrayList<Subprofile>> nOntInstances = new HashMap<String, ArrayList<Subprofile>>();
for (Map.Entry<String, ArrayList<Subprofile>> tOnt : ontInstances.entrySet()) {
if (tOnt.getKey().equals(selectedItem)) {
nOntInstances.put(tOnt.getKey(), new ArrayList<Subprofile>());
for (Subprofile sp : tOnt.getValue()) {
if (sp.getName().equals(sub.getName())) {
nOntInstances.get(tOnt.getKey()).add(sub);
} else {
nOntInstances.get(tOnt.getKey()).add(sp);
}
}
} else {
nOntInstances.put(tOnt.getKey(), tOnt.getValue());
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
167 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
172 |
list.setNullSelectionAllowed(true);
list.setRows(5);
list.setNewItemsAllowed(true);
f.addField(cols.getLabel(), list);
}
}
f.createFooter();
f.getSaveButton().addListener((Button.ClickListener) this);
f.getEditButton().addListener((Button.ClickListener) this);
f.getResetButton().addListener((Button.ClickListener) this);
f.getDeleteButton().addListener((Button.ClickListener) this);
f.getEditButton().setVisible(false);
f.getSaveButton().setVisible(true);
f.getDeleteButton().setVisible(false);
f.setHeader(tab.getName());
f.setReadOnly(false); |
File |
Project |
Line |
org/universAAL/tools/makrorecorder/swingGUI/pattern/PatternEditFrame.java |
universAAL Tools Makro Recorder GUI |
73 |
org/universAAL/tools/makrorecorder/swingGUI/pattern/resource/ResourceList.java |
universAAL Tools Makro Recorder GUI |
116 |
patternPanel.outputsListReload();
}
public static String shortResourceInfo(Resource r) {
String ret = "";
if (r instanceof ContextEvent) {
ContextEvent ce = (ContextEvent) r;
ret += shortURI(ce.getRDFSubject().toString()) + " ";
ret += shortURI(ce.getRDFPredicate()) + " ";
ret += shortURI(ce.getRDFObject().toString());
} else if (r instanceof ServiceRequest) {
ServiceRequest sr = (ServiceRequest) r;
ret += shortURI(sr.getRequestedService().getType());
for (Resource effect : sr.getRequiredEffects()) {
for (String type : effect.getTypes()) {
ret += " " + shortURI(type);
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
121 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
123 |
for (OntologyInstance o : tabs) {
if (userForms.get(o.getId()) == null) {
userForms.put(o.getId(), new ArrayList<TabForm>());
} else {
userForms.get(o.getId()).clear();
}
if (ontInstances.get(o.getId()) == null) {
ontInstances.put(o.getId(), new ArrayList<Subprofile>());
} else {
ontInstances.get(o.getId()).clear();
}
// Every Subprofile is shown in a seperate tab
for (Subprofile tab : o.getSubprofiles()) {
f = new TabForm(); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
428 |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
546 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
379 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
429 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
531 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
408 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
436 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
538 |
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
StringValue n = new StringValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
n.setValue(array[i].toString());
values.add(n);
}
} else if (sim instanceof IntegerValue) {
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue(); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
440 |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
558 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
391 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
442 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
544 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
421 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
449 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
551 |
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
IntegerValue n = new IntegerValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isIntegerNum(array[i].toString()))
n.setValue(Integer.parseInt(array[i].toString()));
else
n.setValue(0); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
456 |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
574 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
407 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
458 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
560 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
437 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
465 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
567 |
newVal = (Collection<SimpleObject>) tab.getField(cols.getLabel()).getValue();
Object[] array = newVal.toArray();
for (int i = 0; i < array.length; i++) {
DoubleValue n = new DoubleValue();
n.setDescription(sim.getDescription());
n.setLabel(sim.getLabel());
n.setRequired(sim.isRequired());
n.setValidator(sim.getValidator());
if (isDoubleNum(array[i].toString()))
n.setValue(Double.parseDouble(array[i].toString()));
else
n.setValue(0.0); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/install/DeploymentInfoController.java |
universAAL Tools uCC Frontend |
248 |
org/universAAL/tools/ucc/controller/install/UsrvInfoController.java |
universAAL Tools uCC Frontend |
75 |
app.getMainWindow().showNotification(bundle.getString("break.note"), Notification.TYPE_HUMANIZED_MESSAGE);
deleteFiles(Activator.getTempUsrvFiles());
}
}
private void deleteFiles(File path) {
File[] files = path.listFiles();
for (File del : files) {
if (del.isDirectory() && !del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv")) {
deleteFiles(del);
}
if (!del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv"))
del.delete();
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/startup/model/User.java |
universAAL Tools uCC Database |
12 |
org/universAAL/tools/ucc/startup/model/UserAccountInfo.java |
universAAL Tools uCC Database |
12 |
public class User {
private String name;
private String password;
private List<Role> role;
private boolean checked;
/**
* Gets the name of a user.
*
* @return name of a user
*/
public String getName() {
return name;
}
/**
* Sets the name of a user.
*
* @param name
* the name of a user
*/
public void setName(String name) {
this.name = name;
}
/**
* Gets the password of a user.
*
* @return the password of a user
*/
public String getPassword() {
return password;
}
/**
* Sets the password of a user
*
* @param password
* the password of a user
*/
public void setPassword(String password) {
this.password = password;
}
/**
* Gets the role of a user.
*
* @return the role of a user
*/
public List<Role> getRole() {
return role;
}
/**
* Sets the role of a user.
*
* @param role
* the role of a user
*/
public void setRole(List<Role> role) {
this.role = role;
}
/**
* Shows if the checkbox is checked
*
* @return true or false
*/
public boolean isChecked() {
return checked;
}
/**
* Sets, if the checkbox is checked
*
* @param checked
* true of false
*/
public void setChecked(boolean checked) {
this.checked = checked;
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/subscriber/SensorEventSubscriber.java |
universAAL Tools uCC Frontend |
84 |
org/universAAL/tools/ucc/subscriber/SensorEventSubscriber.java |
universAAL Tools uCC Frontend |
103 |
for (OntologyInstance oi : rooms) {
if (oi.getId().equals(adress)) {
for (Subprofile sp : oi.getSubprofiles()) {
for (SimpleObject so : sp.getSimpleObjects()) {
if (so instanceof CalendarValue) {
CalendarValue cv = (CalendarValue) so;
if (cv.getName().equals("lastActivityTime")) {
DateFormat df = new SimpleDateFormat();
String date = df.format(time);
cv.setCalendar(date);
}
}
}
}
ontInstances.put(oi.getId(), oi.getSubprofiles());
db.updateUserData(room, oi.getId(), ontInstances); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
166 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
182 |
list.select(st.getValue());
}
}
// Adding List to Form
list.setImmediate(true);
list.setNullSelectionAllowed(false);
list.setRows(5);
list.setNewItemsAllowed(true);
f.addField(cols.getLabel(), list);
}
}
f.createFooter();
f.getSaveButton().addListener((Button.ClickListener) this);
f.getEditButton().addListener((Button.ClickListener) this);
f.getResetButton().addListener((Button.ClickListener) this);
f.getDeleteButton().addListener((Button.ClickListener) this);
f.getEditButton().setVisible(false); |
File |
Project |
Line |
org/universAAL/tools/ucc/model/usrv/AalUapp.java |
universAAL Tools uCC Model |
1115 |
org/universAAL/tools/ucc/model/usrv/Part.java |
universAAL Tools uCC Model |
319 |
public static class ApplicationCapabilities implements Serializable {
private final static long serialVersionUID = 12343L;
@XmlElement(required = true)
protected List<CapabilityType> capability;
/**
* Gets the value of the capability property.
*
* <p>
* This accessor method returns a reference to the live list, not a
* snapshot. Therefore any modification you make to the returned list
* will be present inside the JAXB object. This is why there is not a
* <CODE>set</CODE> method for the capability property.
*
* <p>
* For example, to add a new item, do as follows:
*
* <pre>
* getCapability().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CapabilityType }
*
*
*/
public List<CapabilityType> getCapability() {
if (capability == null) {
capability = new ArrayList<CapabilityType>();
}
return this.capability;
}
public boolean isSetCapability() {
return ((this.capability != null) && (!this.capability.isEmpty()));
}
public void unsetCapability() {
this.capability = null;
}
}
/**
* <p>
* Java class for anonymous complex type.
*
* <p>
* The following schema fragment specifies the expected content contained
* within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="contactPoint" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="remoteManagement" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="protocols" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
* <element name="software" type="{http://www.universaal.org/aal-uapp/v1.0.2}artifactType"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "contactPoint", "remoteManagement" }) |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
625 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
560 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
632 |
app.getMainWindow().showNotification(tab.getHeader() + " was updated", Notification.POSITION_CENTERED);
} // Edit button was pushed
else if (event.getButton() == ((TabForm) tabSheet.getSelectedTab()).getEditButton()) {
TabForm tab = ((TabForm) tabSheet.getSelectedTab());
tab.getSaveButton().setVisible(true);
tab.getEditButton().setVisible(false);
tab.getResetButton().setVisible(true);
tab.getDeleteButton().setVisible(false);
tab.setReadOnly(false);
if (tab.getField("Device Address:") != null) |
File |
Project |
Line |
org/universAAL/tools/logmonitor/rdfvis/gui/RDFVis.java |
universAAL Tools Log Monitor |
90 |
org/universAAL/tools/logmonitor/service_bus_matching/Matchmaking.java |
universAAL Tools Log Monitor |
127 |
String getDateString() {
Calendar c = new GregorianCalendar();
c.setTime(date);
String dateString = new String();
dateString += c.get(Calendar.YEAR) + "-";
dateString += c.get(Calendar.MONTH) + "-";
dateString += c.get(Calendar.DAY_OF_MONTH) + " ";
dateString += c.get(Calendar.HOUR_OF_DAY) + ":";
dateString += c.get(Calendar.MINUTE) + ":";
dateString += c.get(Calendar.SECOND) + ".";
dateString += c.get(Calendar.MILLISECOND);
return dateString;
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
246 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
193 |
}
}
private TabForm createForm(SimpleObject simpleObject, TabForm form) throws ParseException {
if (simpleObject instanceof CalendarValue) {
CalendarValue cal = (CalendarValue) simpleObject;
PopupDateField date = new PopupDateField(cal.getLabel());
date.setResolution(PopupDateField.RESOLUTION_MIN);
date.setImmediate(true);
date.setInputPrompt(cal.getLabel());
date.setShowISOWeekNumbers(true);
date.setDescription(cal.getDescription());
if (cal.isRequired()) {
date.setRequired(true);
date.setRequiredError(cal.getLabel() + " is required");
} |
File |
Project |
Line |
org/universAAL/tools/logmonitor/Utils.java |
universAAL Tools Log Monitor |
24 |
org/universAAL/tools/logmonitor/service_bus_matching/Matchmaking.java |
universAAL Tools Log Monitor |
127 |
public static String getDateString(Date date) {
Calendar c = new GregorianCalendar();
c.setTime(date);
String dateString = new String();
dateString += c.get(Calendar.YEAR) + "-";
dateString += c.get(Calendar.MONTH) + "-";
dateString += c.get(Calendar.DAY_OF_MONTH) + " ";
dateString += c.get(Calendar.HOUR_OF_DAY) + ":";
dateString += c.get(Calendar.MINUTE) + ":";
dateString += c.get(Calendar.SECOND) + ".";
dateString += c.get(Calendar.MILLISECOND);
return dateString;
}
public static String buildMessage(Object[] msgPart) { |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/install/LicenseController.java |
universAAL Tools uCC Frontend |
126 |
org/universAAL/tools/ucc/controller/install/UsrvInfoController.java |
universAAL Tools uCC Frontend |
77 |
}
}
private void deleteFiles(File path) {
File[] files = path.listFiles();
for (File del : files) {
if (del.isDirectory() && !del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv")) {
deleteFiles(del);
}
if (!del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv"))
del.delete();
}
}
} |
File |
Project |
Line |
org/universAAL/tools/logmonitor/Utils.java |
universAAL Tools Log Monitor |
24 |
org/universAAL/tools/logmonitor/rdfvis/gui/RDFVis.java |
universAAL Tools Log Monitor |
90 |
public static String getDateString(Date date) {
Calendar c = new GregorianCalendar();
c.setTime(date);
String dateString = new String();
dateString += c.get(Calendar.YEAR) + "-";
dateString += c.get(Calendar.MONTH) + "-";
dateString += c.get(Calendar.DAY_OF_MONTH) + " ";
dateString += c.get(Calendar.HOUR_OF_DAY) + ":";
dateString += c.get(Calendar.MINUTE) + ":";
dateString += c.get(Calendar.SECOND) + ".";
dateString += c.get(Calendar.MILLISECOND);
return dateString;
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/install/DeploymentInfoController.java |
universAAL Tools uCC Frontend |
250 |
org/universAAL/tools/ucc/controller/install/LicenseController.java |
universAAL Tools uCC Frontend |
126 |
}
}
private void deleteFiles(File path) {
File[] files = path.listFiles();
for (File del : files) {
if (del.isDirectory() && !del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv")) {
deleteFiles(del);
}
if (!del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv"))
del.delete();
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/install/DeploymentInfoController.java |
universAAL Tools uCC Frontend |
252 |
org/universAAL/tools/ucc/service/manager/Activator.java |
universAAL Tools uCC Frontend |
225 |
}
private void deleteFiles(File path) {
File[] files = path.listFiles();
for (File del : files) {
if (del.isDirectory() && !del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv")) {
deleteFiles(del);
}
if (!del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv"))
del.delete();
}
}
public void valueChange(ValueChangeEvent event) { |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
130 |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
191 |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
122 |
subprofiles.put(tab.getName(), tab);
// Creating User tree and Comboboxes
for (EnumObject enumObj : tab.getEnums()) {
NativeSelect box = new NativeSelect(enumObj.getLabel());
box.setDescription(enumObj.getDescription());
// Create ComboBox with enum objects and add to form
for (String item : enumObj.getValues()) {
box.addItem(item);
}
box.setImmediate(true);
if (enumObj.isRequired()) {
box.setRequired(true);
box.setRequiredError(enumObj.getLabel() + " is required");
}
if (enumObj.isTreeParentNode()) { |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
589 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
466 |
if (tOnt.getKey().equals(id)) {
nOntInstances.put(tOnt.getKey(), new ArrayList<Subprofile>());
for (Subprofile sp : tOnt.getValue()) {
if (sp.getName().equals(sub.getName())) {
nOntInstances.get(tOnt.getKey()).add(sub);
} else {
nOntInstances.get(tOnt.getKey()).add(sp);
}
}
} else {
nOntInstances.put(tOnt.getKey(), tOnt.getValue());
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/install/LicenseController.java |
universAAL Tools uCC Frontend |
127 |
org/universAAL/tools/ucc/controller/install/UsrvInfoController.java |
universAAL Tools uCC Frontend |
79 |
org/universAAL/tools/ucc/service/manager/Activator.java |
universAAL Tools uCC Frontend |
225 |
}
private void deleteFiles(File path) {
File[] files = path.listFiles();
for (File del : files) {
if (del.isDirectory() && !del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv")) {
deleteFiles(del);
}
if (!del.getPath().substring(del.getPath().lastIndexOf(".") + 1).equals("usrv"))
del.delete();
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
163 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
207 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
213 |
}
// Adding List to Form
list.setImmediate(true);
list.setNullSelectionAllowed(true);
list.setRows(5);
list.setNewItemsAllowed(true);
f.addField(cols.getLabel(), list);
}
}
f.createFooter();
f.getSaveButton().addListener((Button.ClickListener) this);
f.getEditButton().addListener((Button.ClickListener) this);
f.getResetButton().addListener((Button.ClickListener) this);
f.getDeleteButton().addListener((Button.ClickListener) this);
f.getEditButton().setVisible(false); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
91 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
89 |
subprofiles = new HashMap<String, Subprofile>();
userForms = new HashMap<String, ArrayList<TabForm>>();
tabSheet = new TabSheet();
tabSheet.setSizeFull();
tabSheet.setImmediate(true);
win.getUserTree().addListener(this);
loadData();
win.addFirstComponent(win.getUserTree());
win.addSecondComponent(tabSheet);
}
private void loadData() throws JAXBException, IOException, ParseException {
// Creating Tabs with Forms
ArrayList<OntologyInstance> tabs = dataAccess.getFormFields(actualFlat);
ArrayList<OntologyInstance> roomSubs = dataAccess.getFormFields(actualRoom); |
File |
Project |
Line |
org/universAAL/tools/ucc/model/usrv/AalUsrv.java |
universAAL Tools uCC Model |
410 |
org/universAAL/tools/ucc/model/usrv/Part.java |
universAAL Tools uCC Model |
322 |
@XmlElement(namespace = "http://www.universaal.org/aal-usrv/v1.0.2", required = true)
protected List<CapabilityType> capability;
/**
* Gets the value of the capability property.
*
* <p>
* This accessor method returns a reference to the live list, not a
* snapshot. Therefore any modification you make to the returned list
* will be present inside the JAXB object. This is why there is not a
* <CODE>set</CODE> method for the capability property.
*
* <p>
* For example, to add a new item, do as follows:
*
* <pre>
* getCapability().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CapabilityType }
*
*
*/
public List<CapabilityType> getCapability() {
if (capability == null) {
capability = new ArrayList<CapabilityType>();
}
return this.capability;
}
public boolean isSetCapability() {
return ((this.capability != null) && (!this.capability.isEmpty()));
}
public void unsetCapability() {
this.capability = null;
}
}
/**
* <p>
* Java class for anonymous complex type.
*
* <p>
* The following schema fragment specifies the expected content contained
* within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="requirement" type="{http://www.universaal.org/aal-uapp/v1.0.2}reqType" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "requirement" })
public static class ServiceRequirements implements Serializable { |
File |
Project |
Line |
org/universAAL/tools/ucc/configuration/view/SimpleConfiguratorPasswordField.java |
universAAL Tools uCC Configuration Configurator |
25 |
org/universAAL/tools/ucc/configuration/view/SimpleConfiguratorTextField.java |
universAAL Tools uCC Configuration Configurator |
34 |
public SimpleConfiguratorPasswordField(SimpleConfigurationOption option, VaadinConfigurationController controller) {
super(option.getLabel());
this.controller = controller;
factory = new ObjectFactory();
configOption = option;
configOption.addListener(this);
setDefaultValidators(configOption);
setImmediate(true);
addListener(new ValueChangeListener() {
public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
try {
Value v = factory.createValue();
v.setValue((String) event.getProperty().getValue());
configOption.setValue(v);
setComponentError(null); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
152 |
org/universAAL/tools/ucc/controller/space/AddNewHardwareController.java |
universAAL Tools uCC Frontend |
213 |
createForm(simpl, f);
}
// Adding collection objects as a list to form
if (tab.getCollections().size() > 0) {
for (CollectionValues cols : tab.getCollections()) {
ListSelect list = new ListSelect();
list.setCaption(cols.getLabel());
list.setWidth("120px");
list.setDescription(cols.getDescription());
if (cols.isMultiselect()) {
list.setMultiSelect(true);
}
// Adding List to Form
list.setImmediate(true);
list.setNullSelectionAllowed(true);
list.setRows(5);
list.setNewItemsAllowed(true); |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
107 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
110 |
for (OntologyInstance r : roomSubs) {
if (roomInstances.get(r.getId()) == null) {
roomInstances.put(r.getId(), new ArrayList<Subprofile>());
} else {
roomInstances.get(r.getId()).clear();
}
for (Subprofile s : r.getSubprofiles()) {
roomInstances.get(r.getId()).add(s);
roomprofiles.put(s.getName(), s);
}
} |
File |
Project |
Line |
org/universAAL/tools/ucc/controller/space/AddNewPersonController.java |
universAAL Tools uCC Frontend |
143 |
org/universAAL/tools/ucc/controller/space/HardwareWindowController.java |
universAAL Tools uCC Frontend |
169 |
org/universAAL/tools/ucc/controller/space/PersonWindowController.java |
universAAL Tools uCC Frontend |
147 |
org/universAAL/tools/ucc/controller/space/RoomsWindowController.java |
universAAL Tools uCC Frontend |
175 |
}
// Add simpel objects to form
for (SimpleObject simpl : tab.getSimpleObjects()) {
createForm(simpl, f);
}
// Adding collection objects as a list to form
if (tab.getCollections().size() > 0) {
for (CollectionValues cols : tab.getCollections()) {
ListSelect list = new ListSelect();
list.setCaption(cols.getLabel());
list.setWidth("120px");
list.setDescription(cols.getDescription());
if (cols.isMultiselect()) {
list.setMultiSelect(true);
}
if (cols.isRequired()) { |