Skip to content

Method: notify(UserNotification)

1: /*
2: * *************************************************************************************************************************************************************
3: *
4: * blueMarine III: Semantic DAM
5: * http://tidalwave.it/projects/bluemarine3
6: *
7: * Copyright (C) 2024 - 2025 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *************************************************************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
12: * You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
17: * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
18: *
19: * *************************************************************************************************************************************************************
20: *
21: * git clone https://bitbucket.org/tidalwave/bluemarine3-src
22: * git clone https://github.com/tidalwave-it/bluemarine3-src
23: *
24: * *************************************************************************************************************************************************************
25: */
26: package it.tidalwave.bluemarine3.ui.impl.javafx;
27:
28: import jakarta.annotation.Nonnull;
29: import javafx.fxml.FXML;
30: import javafx.scene.control.MenuBar;
31: import javafx.scene.control.ToolBar;
32: import javafx.scene.layout.AnchorPane;
33: import it.tidalwave.bluemarine3.ui.ApplicationPresentation;
34: import it.tidalwave.ui.core.UserNotification;
35: import it.tidalwave.ui.core.annotation.Assemble;
36: import it.tidalwave.ui.core.annotation.PresentationAssembler;
37: import it.tidalwave.ui.javafx.JavaFXBinder;
38: import it.tidalwave.ui.javafx.JavaFXPanelGroupControl;
39: import it.tidalwave.ui.javafx.JavaFXMenuBarControl;
40: import it.tidalwave.ui.javafx.JavaFXToolBarControl;
41: import lombok.Getter;
42: import lombok.extern.slf4j.Slf4j;
43: import static it.tidalwave.ui.core.PanelGroupControl.Options.*;
44: import static it.tidalwave.ui.core.PanelGroupControl.DefaultGroups.*;
45:
46: /***************************************************************************************************************************************************************
47: *
48: * @stereotype Presentation
49: * @author Fabrizio Giudici
50: *
51: **************************************************************************************************************************************************************/
52: @PresentationAssembler /* @RequiredArgsConstructor */ @Slf4j @Getter
53: public class JavaFXApplicationPresentationDelegate implements ApplicationPresentation
54: {
55: @FXML
56: private MenuBar mbMenuBar;
57:
58: @FXML
59: private ToolBar tbToolBar;
60:
61: @FXML
62: private AnchorPane pnLeft;
63:
64: @FXML
65: private AnchorPane pnCenter;
66:
67: @FXML
68: private AnchorPane pnBottom;
69:
70: @Nonnull
71: private /* final */ JavaFXBinder binder; // FIXME
72:
73: /***********************************************************************************************************************************************************
74: * {@inheritDoc}
75: **********************************************************************************************************************************************************/
76: @Override
77: public void notify (@Nonnull final UserNotification notification)
78: {
79: binder.showInModalDialog(notification);
80: }
81:
82: /***********************************************************************************************************************************************************
83: * {@inheritDoc}
84: **********************************************************************************************************************************************************/
85: @Assemble
86: public void assemble (@Nonnull final JavaFXBinder binder,
87: @Nonnull final JavaFXToolBarControl toolBarControl,
88: @Nonnull final JavaFXMenuBarControl menuBarControl,
89: @Nonnull final JavaFXPanelGroupControl panelGroupControl)
90: {
91: this.binder = binder;
92: toolBarControl.populate(binder, tbToolBar);
93: menuBarControl.populate(binder, mbMenuBar);
94: panelGroupControl.setup(panelGroupControl.config()
95: .withGroup(LEFT, pnLeft, USE_ACCORDION)
96: .withGroup(CENTER, pnCenter)
97: .withGroup(BOTTOM, pnBottom)
98: .withOptions(ALWAYS_WRAP, DISABLE_ACCORDION_ANIMATION));
99: }
100: }