Search in sources :

Example 1 with EditModeOnly

use of blue.orchestra.editor.blueSynthBuilder.EditModeOnly in project blue by kunstmusik.

the class BSBEditPane method getEditorForBSBObject.

private BSBObjectViewHolder getEditorForBSBObject(BSBObject bsbObj) {
    Region objectView = BSBObjectEditorFactory.getView(bsbObj);
    BooleanProperty editEnabledProperty = allowEditing ? bsbInterface.editEnabledProperty() : null;
    BSBObjectViewHolder viewHolder = new BSBObjectViewHolder(editEnabledProperty, selection, groupsList, objectView);
    if (objectView instanceof EditModeOnly) {
        if (allowEditing) {
            viewHolder.visibleProperty().bind(bsbInterface.editEnabledProperty());
        } else {
            viewHolder.setVisible(false);
        }
    }
    if (bsbObj instanceof BSBGroup) {
        BSBGroupView bsbGroupView = (BSBGroupView) objectView;
        bsbGroupView.initialize(editEnabledProperty, selection, groupsList);
    }
    return viewHolder;
}
Also used : BooleanProperty(javafx.beans.property.BooleanProperty) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) Region(javafx.scene.layout.Region) EditModeOnly(blue.orchestra.editor.blueSynthBuilder.EditModeOnly) BSBGroup(blue.orchestra.blueSynthBuilder.BSBGroup)

Example 2 with EditModeOnly

use of blue.orchestra.editor.blueSynthBuilder.EditModeOnly in project blue by kunstmusik.

the class BSBGroupView method addBSBObject.

protected void addBSBObject(BSBObject bsbObj) {
    try {
        Region objectView = BSBObjectEditorFactory.getView(bsbObj);
        // FIXME
        // BooleanProperty editEnabledProperty = allowEditing ? bsbInterface.editEnabledProperty() : null;
        BSBObjectViewHolder viewHolder = new BSBObjectViewHolder(editEnabledProperty, selection, groupsList, objectView);
        if (objectView instanceof EditModeOnly) {
            if (editEnabledProperty != null) {
                viewHolder.visibleProperty().bind(editEnabledProperty);
            } else {
                viewHolder.setVisible(false);
            }
        }
        if (bsbObj instanceof BSBGroup) {
            BSBGroupView bsbGroupView = (BSBGroupView) objectView;
            bsbGroupView.initialize(editEnabledProperty, selection, groupsList);
        }
        editorPane.getChildren().add(viewHolder);
    } catch (Exception e) {
        Exceptions.printStackTrace(e);
    }
}
Also used : Region(javafx.scene.layout.Region) EditModeOnly(blue.orchestra.editor.blueSynthBuilder.EditModeOnly) BSBGroup(blue.orchestra.blueSynthBuilder.BSBGroup)

Aggregations

BSBGroup (blue.orchestra.blueSynthBuilder.BSBGroup)2 EditModeOnly (blue.orchestra.editor.blueSynthBuilder.EditModeOnly)2 Region (javafx.scene.layout.Region)2 BooleanProperty (javafx.beans.property.BooleanProperty)1 SimpleBooleanProperty (javafx.beans.property.SimpleBooleanProperty)1