Search in sources :

Example 1 with Property

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;
}
Also used : AlertType(javafx.scene.control.Alert.AlertType) ButtonType(javafx.scene.control.ButtonType) Type(model.Type) Category(model.Category) Schema(model.Schema) Folder(model.Folder) Property(model.Property)

Example 2 with Property

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));
    }
}
Also used : AlertType(javafx.scene.control.Alert.AlertType) ButtonType(javafx.scene.control.ButtonType) Type(model.Type) MomentExperience(model.MomentExperience) Property(model.Property) LinkedList(java.util.LinkedList)

Example 3 with Property

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();
    }
}
Also used : Type(model.Type) Property(model.Property)

Example 4 with Property

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);
}
Also used : AddPropertyToClassCommand(controller.command.AddPropertyToClassCommand) Property(model.Property) FXML(javafx.fxml.FXML)

Example 5 with Property

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);
        }
    }
}
Also used : Type(model.Type) Property(model.Property)

Aggregations

Property (model.Property)5 Type (model.Type)4 AlertType (javafx.scene.control.Alert.AlertType)2 ButtonType (javafx.scene.control.ButtonType)2 AddPropertyToClassCommand (controller.command.AddPropertyToClassCommand)1 LinkedList (java.util.LinkedList)1 FXML (javafx.fxml.FXML)1 Category (model.Category)1 Folder (model.Folder)1 MomentExperience (model.MomentExperience)1 Schema (model.Schema)1