Skip to content

Commit aaf0067

Browse files
committed
UI/UX: Add 'TagBar' in Alert Log Monitoring menu (at Search keyword region)
1 parent 97329d6 commit aaf0067

File tree

2 files changed

+30
-15
lines changed

2 files changed

+30
-15
lines changed

src/main/java/root/javafx/Controller/AlertLogMonitoringMenuController.java

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
import javafx.event.EventHandler;
1919
import javafx.fxml.FXML;
2020
import javafx.fxml.Initializable;
21+
import javafx.geometry.Insets;
2122
import javafx.scene.control.Alert.AlertType;
2223
import javafx.scene.control.DatePicker;
24+
import javafx.scene.control.ScrollPane;
25+
import javafx.scene.control.ScrollPane.ScrollBarPolicy;
2326
import javafx.scene.control.TextField;
2427
import javafx.scene.input.KeyCode;
2528
import javafx.scene.input.KeyEvent;
2629
import javafx.scene.layout.AnchorPane;
30+
import javafx.scene.layout.HBox;
2731
import javafx.scene.layout.StackPane;
2832
import lombok.extern.slf4j.Slf4j;
2933
import root.common.server.implement.JschServer;
@@ -43,6 +47,7 @@
4347
import root.javafx.CustomView.AlertLogListViewCell;
4448
import root.javafx.CustomView.AlertLogMonitoringSummaryAP;
4549
import root.javafx.CustomView.NumberTextFormatter;
50+
import root.javafx.CustomView.TagBar;
4651
import root.javafx.CustomView.dateCell.DisableAfterTodayDateCell;
4752
import root.utils.AlertUtils;
4853

@@ -70,7 +75,10 @@ public class AlertLogMonitoringMenuController implements Initializable {
7075

7176
@FXML
7277
StackPane alertLogSummarySP;
73-
78+
79+
@FXML
80+
HBox searchKeywordHBox;
81+
7482
@FXML
7583
TextField navigatorTF;
7684

@@ -83,6 +91,8 @@ public class AlertLogMonitoringMenuController implements Initializable {
8391
@FXML
8492
AnchorPane summaryNodataAP;
8593

94+
TagBar tagBar = new TagBar();
95+
8696
Map<String, AlertLog> alertLogMonitoringResultMap;
8797

8898
public AlertLogMonitoringMenuController() {
@@ -182,7 +192,22 @@ public void handle(KeyEvent e) {
182192
}
183193
}
184194
});
185-
195+
196+
// Search Keyword Tagbar
197+
ScrollPane tagBarWrapper = new ScrollPane(tagBar);
198+
tagBarWrapper.setStyle("-fx-border-width: 0.2px; -fx-border-color: gray;");
199+
tagBarWrapper.getStyleClass().add("gray-scrollbar");
200+
tagBarWrapper.setMaxWidth(375);
201+
tagBarWrapper.setMinHeight(45);
202+
tagBarWrapper.setFitToHeight(true);
203+
tagBarWrapper.prefHeightProperty().bind(searchKeywordHBox.heightProperty());
204+
tagBarWrapper.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
205+
HBox.setMargin(tagBarWrapper, new Insets(0, 0, 0, 25));
206+
searchKeywordHBox.getChildren().add(tagBarWrapper);
207+
208+
tagBar.setMaxWidth(355);
209+
tagBarWrapper.vvalueProperty().bind(tagBar.heightProperty());
210+
186211
// Set view visible
187212
mainNodataAP.setVisible(true);
188213
alertLogLV.setVisible(false);

src/main/resources/fxml/AlertLogMonitoringMenu.fxml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<?import com.jfoenix.controls.JFXButton?>
44
<?import com.jfoenix.controls.JFXComboBox?>
55
<?import com.jfoenix.controls.JFXListView?>
6-
<?import com.jfoenix.controls.JFXTextArea?>
76
<?import com.jfoenix.controls.JFXToggleButton?>
87
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?>
98
<?import java.lang.String?>
@@ -167,7 +166,7 @@
167166
</items>
168167
</SplitPane>
169168
<Separator layoutX="5.0" layoutY="505.6000061035156" AnchorPane.bottomAnchor="120.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
170-
<SplitPane dividerPositions="0.5" layoutX="5.0" layoutY="508.6000061035156" maxHeight="110.0" minHeight="110.0" prefHeight="110.0" style="-fx-background-radius: 5px; -fx-background-color: white;" styleClass="divider-exist" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
169+
<SplitPane dividerPositions="0.5" layoutX="5.0" layoutY="508.6000061035156" maxHeight="115.0" minHeight="115.0" prefHeight="115.0" style="-fx-background-radius: 5px; -fx-background-color: white;" styleClass="divider-exist" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
171170
<items>
172171
<AnchorPane>
173172
<children>
@@ -209,20 +208,11 @@
209208
<String fx:value="basic-font" />
210209
</styleClass>
211210
</Label>
212-
<JFXTextArea maxWidth="375.0" style="-fx-border-width: 0.2px; -fx-border-color: black;">
213-
<HBox.margin>
214-
<Insets left="25.0" />
215-
</HBox.margin>
216-
<styleClass>
217-
<String fx:value="gray-scrollbar" />
218-
<String fx:value="basic-font" />
219-
</styleClass>
220-
</JFXTextArea>
221211
</children>
222212
</HBox>
223213
</children>
224214
<padding>
225-
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
215+
<Insets bottom="10.0" left="10.0" right="10.0" />
226216
</padding>
227217
</AnchorPane>
228218
<AnchorPane>
@@ -282,7 +272,7 @@
282272
</HBox>
283273
</children>
284274
<padding>
285-
<Insets bottom="10.0" left="20.0" right="10.0" top="10.0" />
275+
<Insets bottom="10.0" left="20.0" right="10.0" />
286276
</padding>
287277
</AnchorPane>
288278
</items>

0 commit comments

Comments
 (0)