Skip to content

Commit

Permalink
More demo settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Sep 19, 2022
1 parent 8a6d00d commit 39770e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ public Node getControlPanel() {
daysBox.setValue(resourcesView.getNumberOfDays());
daysBox.valueProperty().addListener(it -> resourcesView.setNumberOfDays(daysBox.getValue()));

ChoiceBox<Integer> clicksBox = new ChoiceBox<>();
clicksBox.getItems().setAll(1, 2, 3);
clicksBox.setValue(resourcesView.getCreateEntryClickCount());
clicksBox.valueProperty().addListener(it -> resourcesView.setCreateEntryClickCount(clicksBox.getValue()));

ChoiceBox<AvailabilityEditingEntryBehaviour> behaviourBox = new ChoiceBox<>();
behaviourBox.getItems().setAll(AvailabilityEditingEntryBehaviour.values());
behaviourBox.valueProperty().bindBidirectional(resourcesView.entryViewAvailabilityEditingBehaviourProperty());
Expand All @@ -87,18 +92,26 @@ public Node getControlPanel() {
CheckBox adjustBox = new CheckBox("Adjust first day of week");
adjustBox.selectedProperty().bindBidirectional(resourcesView.adjustToFirstDayOfWeekProperty());

CheckBox scrollbarBox = new CheckBox("Show scrollbar");
scrollbarBox.selectedProperty().bindBidirectional(resourcesView.showScrollBarProperty());

CheckBox detailsBox = new CheckBox("Show details upon creation");
detailsBox.selectedProperty().bindBidirectional(resourcesView.showDetailsUponEntryCreationProperty());

Slider slider = new Slider();
slider.setMin(0);
slider.setMax(1);
slider.valueProperty().bindBidirectional(resourcesView.entryViewAvailabilityEditingOpacityProperty());

return new VBox(10, availabilityButton, datePicker, adjustBox, daysBox, new Label("Availability Behaviour"), behaviourBox, new Label("Availability Opacity"), slider, new Label("Grid Type"), gridTypeBox);
return new VBox(10, availabilityButton, datePicker, adjustBox, new Label("Number of days"), daysBox, new Label("Clicks to create"), clicksBox,
new Label("Availability Behaviour"), behaviourBox, new Label("Availability Opacity"), slider, new Label("Grid Type"), gridTypeBox, scrollbarBox, detailsBox);
}

@Override
protected DateControl createControl() {
resourcesView = new ResourcesView();
resourcesView.setNumberOfDays(5);
resourcesView.setCreateEntryClickCount(1);
resourcesView.setGridType(GridType.CUSTOM);
resourcesView.setEarlyLateHoursStrategy(EarlyLateHoursStrategy.HIDE);
resourcesView.getResources().addAll(create("Dirk", Style.STYLE1), create("Katja", Style.STYLE2), create("Philip", Style.STYLE3)); //, create("Jule", Style.STYLE4), create("Armin", Style.STYLE5));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ private void updateView() {
upperLeftCorner.getStyleClass().add("upper-left-corner");
gridPane.add(upperLeftCorner, 0, 0);

Region upperRightCorner = new Region();
upperRightCorner.getStyleClass().add("upper-right-corner");
gridPane.add(upperRightCorner, 2, 0);
if (view.isShowScrollBar()) {
Region upperRightCorner = new Region();
upperRightCorner.getStyleClass().add("upper-right-corner");
gridPane.add(upperRightCorner, 2, 0);
}

HBox headerBox = new HBox();
headerBox.getStyleClass().add("header-box");
Expand Down

0 comments on commit 39770e3

Please sign in to comment.