Search in sources :

Example 1 with Category

use of model.Category 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 Category

use of model.Category in project uPMT by coco35700.

the class TypeTreeView method addClass.

// method used to add a class to the current cell
public void addClass(int classNumber) {
    TreeItem<TypeController> newTypeController = new TreeItem<TypeController>();
    Type nt = new Category("Classe " + classNumber);
    TypeController tc;
    if (getItem().getType().getClass().equals(Schema.class)) {
        tc = new TypeController(nt, getTreeItem().getValue().getType());
    } else {
        tc = new TypeController(nt, getTreeItem().getParent().getValue().getType());
    }
    newTypeController.setValue(tc);
    getTreeItem().getChildren().add(newTypeController);
    getItem().getType().getTypes().add(nt);
    this.getTreeItem().setExpanded(true);
}
Also used : TypeController(controller.controller.TypeController) AlertType(javafx.scene.control.Alert.AlertType) ButtonType(javafx.scene.control.ButtonType) Type(model.Type) Category(model.Category) TreeItem(javafx.scene.control.TreeItem)

Example 3 with Category

use of model.Category in project uPMT by coco35700.

the class MainViewController method duplicate.

private Category duplicate(Category c) {
    Category newc = new Category(c.getName());
    newc.setColor(c.getColor());
    for (Type t : c.getTypes()) {
        newc.addType(t);
    }
    return newc;
}
Also used : AlertType(javafx.scene.control.Alert.AlertType) ButtonType(javafx.scene.control.ButtonType) Type(model.Type) Category(model.Category)

Aggregations

AlertType (javafx.scene.control.Alert.AlertType)3 ButtonType (javafx.scene.control.ButtonType)3 Category (model.Category)3 Type (model.Type)3 TypeController (controller.controller.TypeController)1 TreeItem (javafx.scene.control.TreeItem)1 Folder (model.Folder)1 Property (model.Property)1 Schema (model.Schema)1