use of model.Property in project uPMT by coco35700.
the class Main method createBasicSchema.
/**
* Creates a basic scheme as a default
* should be improved if desired
*/
private void createBasicSchema() {
Type s = new Schema((_langBundle.getString("default_scheme")));
Type general = new Folder(_langBundle.getString("general"));
Type autre = new Folder(_langBundle.getString("other"));
Type visuel = new Category(_langBundle.getString("visual"));
Type image = new Property(_langBundle.getString("picture"));
Type sensoriel = new Category(_langBundle.getString("sensory"));
Type emotionnel = new Category(_langBundle.getString("emotional"));
Type sonore = new Category(_langBundle.getString("acoustic"));
visuel.addType(image);
general.addType(visuel);
general.addType(sensoriel);
general.addType(emotionnel);
general.addType(sonore);
s.addType(general);
s.addType(autre);
this.BasicSchema = (Schema) s;
}
use of 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 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 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 model.Property in project uPMT by coco35700.
the class TypeClassRepresentationController method loadProperties.
public void loadProperties() {
// for each Property, add a representation
if (!classe.getTypes().isEmpty()) {
for (Type p : classe.getTypes()) {
Property prop = (Property) p;
TypePropertyRepresentation controller = new TypePropertyRepresentation(prop, moment, treeClassTreeItem, main);
this.properties.getChildren().add(controller);
}
}
}
Aggregations