Search in sources :

Example 1 with View

use of com.canoo.dp.impl.platform.projector.view.View in project dolphin-platform by canoo.

the class ViewFactory method updateContentWrapper.

private Pane updateContentWrapper(StackPane mainPane, View projectable) {
    List<Node> children = new ArrayList<>();
    if (!mainPane.getChildren().isEmpty()) {
        Pane internalPane = (Pane) mainPane.getChildren().get(0);
        children.addAll(internalPane.getChildren());
        mainPane.getChildren().clear();
    }
    Pane internalPane = Optional.of(projectable).map(p -> {
        if (ViewMetadata.isOrientationVertical(p)) {
            return new HBox();
        } else {
            return new VBox();
        }
    }).orElse(new HBox());
    internalPane.getChildren().addAll(children);
    mainPane.getChildren().add(internalPane);
    return internalPane;
}
Also used : HBox(javafx.scene.layout.HBox) ControllerProxy(com.canoo.platform.remoting.client.ControllerProxy) Node(javafx.scene.Node) MetadataUtilities(com.canoo.dp.impl.platform.projector.metadata.MetadataUtilities) StackPane(javafx.scene.layout.StackPane) View(com.canoo.dp.impl.platform.projector.view.View) ViewMetadata(com.canoo.dp.impl.platform.projector.view.ViewMetadata) ClientContext(com.canoo.platform.remoting.client.ClientContext) VBox(javafx.scene.layout.VBox) ArrayList(java.util.ArrayList) Parent(javafx.scene.Parent) Priority(javafx.scene.layout.Priority) List(java.util.List) Insets(javafx.geometry.Insets) Optional(java.util.Optional) WithLayoutMetadata(com.canoo.dp.impl.platform.projector.base.WithLayoutMetadata) Pane(javafx.scene.layout.Pane) HBox(javafx.scene.layout.HBox) Node(javafx.scene.Node) ArrayList(java.util.ArrayList) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane) VBox(javafx.scene.layout.VBox)

Aggregations

WithLayoutMetadata (com.canoo.dp.impl.platform.projector.base.WithLayoutMetadata)1 MetadataUtilities (com.canoo.dp.impl.platform.projector.metadata.MetadataUtilities)1 View (com.canoo.dp.impl.platform.projector.view.View)1 ViewMetadata (com.canoo.dp.impl.platform.projector.view.ViewMetadata)1 ClientContext (com.canoo.platform.remoting.client.ClientContext)1 ControllerProxy (com.canoo.platform.remoting.client.ControllerProxy)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Optional (java.util.Optional)1 Insets (javafx.geometry.Insets)1 Node (javafx.scene.Node)1 Parent (javafx.scene.Parent)1 HBox (javafx.scene.layout.HBox)1 Pane (javafx.scene.layout.Pane)1 Priority (javafx.scene.layout.Priority)1 StackPane (javafx.scene.layout.StackPane)1 VBox (javafx.scene.layout.VBox)1