use of com.adobe.target.delivery.v1.model.Property in project uPMT by coco35700.
the class Main method writeMoment.
/**
* Recursive method used to recursively transform a Moment and its sub Moments into CSV compatible DATAZ
*/
private void writeMoment(DescriptionInterview ent, MomentExperience m, PrintWriter writer, String hierarchy) {
LinkedList<String> classes = new LinkedList<String>();
for (Type t : m.getTypes()) {
for (Type prop : t.getTypes()) {
Property p = (Property) prop;
classes.add(format(t.getName()) + "," + format(p.getName()) + "," + format(p.getValue()));
}
}
if (!classes.isEmpty()) {
for (String s : classes) {
writer.println(format(ent.getName()) + ",\"" + hierarchy + "\"" + "," + format(m.getName()) + "," + format(m.getDescripteme()) + "," + format(m.getColor()) + "," + format(m.getDuration()) + "," + s);
}
} else {
writer.println(format(ent.getName()) + ",\"" + hierarchy + "\"" + "," + format(m.getName()) + "," + format(m.getDescripteme()) + "," + format(m.getColor()) + "," + format(m.getDuration()) + ",\"\",\"\",\"\"");
}
for (int i = 0; i < m.getSubMoments().size(); i++) {
MomentExperience sub = m.getSubMoments().get(i);
writeMoment(ent, sub, writer, hierarchy + "." + (i + 1));
}
}
use of com.adobe.target.delivery.v1.model.Property in project uPMT by coco35700.
the class TypeClassRepresentationController method updateVue.
@Override
public void updateVue(Observable obs, Object value) {
// TODO Auto-generated method stub
if (obs.getClass().equals(RenameClassSchemeController.class)) {
renameClass((String) value);
}
if (obs.getClass().equals(ChangeColorClassSchemeController.class)) {
setColor((String) value);
}
if (obs.getClass().equals(AddPropertySchemeController.class)) {
Property n = new Property(((Property) value).getName());
boolean contain = false;
for (Type t : classe.getTypes()) {
if (t.getName().equals(n.getName())) {
contain = true;
break;
}
}
if (!this.classe.getTypes().contains(n)) {
addProperty((Property) n);
} else {
// System.out.println("AH BAH VOILA !!!!!");
}
}
if (obs.getClass().equals(RemovePropertySchemeController.class)) {
Property toRemove = (Property) value;
// System.out.println("Remove dans TypeClassRpzCtrl "+toRemove.getName());
RemoveProperty(toRemove);
}
if (obs.getClass().equals(AddPropertySchemeWithValueController.class)) {
addProperty(stack.pop());
}
if (obs.getClass().equals(RemoveClassSchemeController.class)) {
// System.out.println("DELETINGCLASS");
moment.removeTypeClassRep(this);
}
if (obs.getClass().equals(AddClassSchemeController.class)) {
// System.out.println("REPUTINGCLASS");
moment.putPreviousClassRep();
}
}
use of com.adobe.target.delivery.v1.model.Property in project uPMT by coco35700.
the class TypeTreeViewControllerClass method addProperty.
@FXML
public void addProperty() {
propertiesNumber++;
Property nt = new Property("Propriete " + propertiesNumber);
AddPropertyToClassCommand cmd = new AddPropertyToClassCommand(type, nt, tree.getTreeItem(), this.main);
cmd.execute();
UndoCollector.INSTANCE.add(cmd);
}
use of com.adobe.target.delivery.v1.model.Property in project FAAAST-Service by FraunhoferIOSB.
the class AasServiceNodeManager method setOperationArgument.
/**
* Sets the arguments for the given Operation Variable.
*
* @param arg The UA argument
* @param var The corresponding Operation Variable
*/
private void setOperationArgument(Argument arg, OperationVariable operVar) {
try {
if (operVar.getValue() instanceof Property) {
Property prop = (Property) operVar.getValue();
arg.setName(prop.getIdShort());
arg.setValueRank(ValueRanks.Scalar);
arg.setArrayDimensions(null);
// Description
addDescriptions(arg, prop.getDescriptions());
NodeId type = ValueConverter.convertValueTypeStringToNodeId(prop.getValueType());
if (type.isNullNodeId()) {
LOG.warn("setOperationArgument: Property {}: Unknown type: {}", prop.getIdShort(), prop.getValueType());
// Default type is String. That's what we receive from the AAS Service
arg.setDataType(Identifiers.String);
} else {
arg.setDataType(type);
}
} else {
LOG.warn("setOperationArgument: unknown Argument type");
}
} catch (Exception ex) {
LOG.error("setOperationArgument Exception", ex);
throw ex;
}
}
use of com.adobe.target.delivery.v1.model.Property in project FAAAST-Service by FraunhoferIOSB.
the class DeepCopyHelperTest method testDeepCopyReferableSupertype.
@Test
public void testDeepCopyReferableSupertype() {
Property expected = new DefaultProperty.Builder().idShort("property1").build();
SubmodelElement actual = DeepCopyHelper.deepCopy(expected, SubmodelElement.class);
Assert.assertEquals(expected, actual);
}
Aggregations