22
33import javafx .collections .FXCollections ;
44import javafx .collections .ObservableList ;
5- import org .jspecify .annotations .NonNull ;
65import software .coley .bentofx .building .ControlsBuilding ;
76import software .coley .bentofx .building .DockBuilding ;
87import software .coley .bentofx .building .PlaceholderBuilding ;
@@ -34,106 +33,90 @@ public class Bento {
3433 private final DockableDragDropBehavior dragDropBehavior = newDragDropBehavior ();
3534 private final DockableClickBehavior clickBehavior = newClickBehavior ();
3635
37- @ NonNull
3836 protected EventBus newEventBus () {
3937 return new EventBus ();
4038 }
4139
42- @ NonNull
4340 protected SearchHandler newSearchHandler () {
4441 return new SearchHandler (this );
4542 }
4643
47- @ NonNull
4844 protected StageBuilding newStageBuilding () {
4945 return new StageBuilding (this );
5046 }
5147
52- @ NonNull
5348 protected ControlsBuilding newControlsBuilding () {
5449 return new ControlsBuilding ();
5550 }
5651
57- @ NonNull
5852 protected DockBuilding newDockBuilding () {
5953 return new DockBuilding (this );
6054 }
6155
62- @ NonNull
6356 protected PlaceholderBuilding newPlaceholderBuilding () {
6457 return new PlaceholderBuilding ();
6558 }
6659
67- @ NonNull
6860 protected DockableDragDropBehavior newDragDropBehavior () {
6961 return new DockableDragDropBehavior () {};
7062 }
7163
72- @ NonNull
7364 protected DockableClickBehavior newClickBehavior () {
7465 return new DockableClickBehavior () {};
7566 }
7667
7768 /**
7869 * @return Bus for handling event firing and event listeners.
7970 */
80- @ NonNull
8171 public EventBus events () {
8272 return eventBus ;
8373 }
8474
8575 /**
8676 * @return Search operations.
8777 */
88- @ NonNull
8978 public SearchHandler search () {
9079 return searchHandler ;
9180 }
9281
9382 /**
9483 * @return Builders for {@link DragDropStage}.
9584 */
96- @ NonNull
9785 public StageBuilding stageBuilding () {
9886 return stageBuilding ;
9987 }
10088
10189 /**
10290 * @return Builders for various bento UI controls.
10391 */
104- @ NonNull
10592 public ControlsBuilding controlsBuilding () {
10693 return controlsBuilding ;
10794 }
10895
10996 /**
11097 * @return Builders for {@link DockContainer} and {@link Dockable}.
11198 */
112- @ NonNull
11399 public DockBuilding dockBuilding () {
114100 return dockBuilding ;
115101 }
116102
117103 /**
118104 * @return Builders for placeholder content.
119105 */
120- @ NonNull
121106 public PlaceholderBuilding placeholderBuilding () {
122107 return placeholderBuilding ;
123108 }
124109
125110 /**
126111 * @return Behavior implementation for drag-drop operations.
127112 */
128- @ NonNull
129113 public DockableDragDropBehavior getDragDropBehavior () {
130114 return dragDropBehavior ;
131115 }
132116
133117 /**
134118 * @return Behavior implementation for click operations.
135119 */
136- @ NonNull
137120 public DockableClickBehavior getClickBehavior () {
138121 return clickBehavior ;
139122 }
@@ -144,7 +127,6 @@ public DockableClickBehavior getClickBehavior() {
144127 * @see #registerRoot(DockContainerRootBranch)
145128 * @see #unregisterRoot(DockContainerRootBranch)
146129 */
147- @ NonNull
148130 public ObservableList <DockContainerRootBranch > getRootContainers () {
149131 return rootContainersView ;
150132 }
@@ -155,7 +137,7 @@ public ObservableList<DockContainerRootBranch> getRootContainers() {
155137 *
156138 * @return {@code true} when registered.
157139 */
158- public boolean registerRoot (@ NonNull DockContainerRootBranch container ) {
140+ public boolean registerRoot (DockContainerRootBranch container ) {
159141 if (!rootContainers .contains (container )) {
160142 rootContainers .add (container );
161143 eventBus .fire (new DockEvent .RootContainerAdded (container ));
@@ -170,7 +152,7 @@ public boolean registerRoot(@NonNull DockContainerRootBranch container) {
170152 *
171153 * @return {@code true} when unregistered.
172154 */
173- public boolean unregisterRoot (@ NonNull DockContainerRootBranch container ) {
155+ public boolean unregisterRoot (DockContainerRootBranch container ) {
174156 if (rootContainers .remove (container )) {
175157 eventBus .fire (new DockEvent .RootContainerRemoved (container ));
176158 return true ;
0 commit comments