Skip to content

Commit 700f457

Browse files
committed
UI/UX: Add 'No Properties File' UI when there is no properties file in RunMenu
1 parent f7fe403 commit 700f457

File tree

4 files changed

+132
-67
lines changed

4 files changed

+132
-67
lines changed

DBMonitoringWindowApp/src/main/java/root/javafx/Controller/HistoryMenuController.java

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,14 @@ public void initialize(URL location, ResourceBundle resources) {
100100
runConnInfoFileComboBox.getSelectionModel().select(lastUseConnInfoFilePath);
101101
}
102102

103-
noPropertyFileAP.setVisible(false);
104-
topMenuBar.setVisible(true);
103+
setNoPropertyUIVisible(false);
105104
} else {
106-
noPropertyFileAP.setVisible(true);
107-
topMenuBar.setVisible(false);
105+
setNoPropertyUIVisible(true);
108106
return;
109107
}
110108
} catch (PropertyNotFoundException e) {
111109
log.error(e.getMessage());
112-
noPropertyFileAP.setVisible(true);
113-
topMenuBar.setVisible(false);
110+
setNoPropertyUIVisible(true);
114111
return;
115112
}
116113

@@ -195,4 +192,22 @@ public void goSettingMenu(ActionEvent e) throws IOException {
195192
SceneUtils.movePage(DependencyInjection.load("/fxml/SettingMenu.fxml"));
196193
}
197194

195+
/**
196+
* 접속정보 설정파일 열기
197+
*
198+
* @param e
199+
*/
200+
public void openPropertiesFile(ActionEvent e) {
201+
202+
}
203+
204+
/**
205+
* 접속정보 설정 파일이 없을 때 UI Visible 변경
206+
*
207+
* @param isVisible
208+
*/
209+
private void setNoPropertyUIVisible(boolean isVisible) {
210+
noPropertyFileAP.setVisible(true);
211+
topMenuBar.setVisible(false);
212+
}
198213
}

DBMonitoringWindowApp/src/main/java/root/javafx/Controller/RunMenuController.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import javafx.fxml.FXML;
2020
import javafx.fxml.Initializable;
2121
import javafx.scene.Node;
22+
import javafx.scene.control.Button;
2223
import javafx.scene.control.Control;
2324
import javafx.scene.control.Label;
2425
import javafx.scene.control.ScrollPane;
@@ -118,6 +119,9 @@ public class RunMenuController implements Initializable {
118119

119120
@FXML
120121
AnchorPane noPropertyFileAP;
122+
123+
@FXML
124+
Button fileOpenBtn;
121125

122126
private MonitoringTableViewPagingBox dbResults;
123127
private MonitoringTableViewPagingBox serverResults;
@@ -135,10 +139,10 @@ public void initialize(URL location, ResourceBundle resources) {
135139
/* 4. 실행결과 */
136140
// initRunStep4();
137141

138-
noPropertyFileAP.setVisible(false);
142+
setNoPropertyUIVisible(false);
139143
} catch (PropertyNotFoundException e) {
140144
log.error(e.getMessage());
141-
noPropertyFileAP.setVisible(true);
145+
setNoPropertyUIVisible(true);
142146
}
143147
}
144148

@@ -315,8 +319,8 @@ private void initRunStep1() throws PropertyNotFoundException {
315319
// 1-1. 모니터링 접속정보 설정파일 콤보박스 아이템 설정
316320
List<String> connInfoFileList = propService.getConnectionInfoList();
317321
if (connInfoFileList == null || ArrayUtils.isEmpty(connInfoFileList.toArray())) {
318-
// TODO 접속정보 설정파일이 없는 경우
319-
addMonitoringConnInfoPreview(new ArrayList<>(), new ArrayList<>());
322+
setNoPropertyUIVisible(true);
323+
// addMonitoringConnInfoPreview(new ArrayList<>(), new ArrayList<>());
320324
} else {
321325
connInfoFileListComboBox.getItems().addAll(connInfoFileList);
322326
}
@@ -457,4 +461,21 @@ private void initRunStep4() {
457461
public void goSettingMenu(ActionEvent e) throws IOException {
458462
SceneUtils.movePage(DependencyInjection.load("/fxml/SettingMenu.fxml"));
459463
}
464+
465+
/**
466+
* 접속정보 설정파일 열기
467+
*
468+
* @param e
469+
*/
470+
public void openPropertiesFile(ActionEvent e) {
471+
}
472+
473+
/**
474+
* 접속정보 설정 파일이 없을 때 UI Visible 변경
475+
*
476+
* @param isVisible
477+
*/
478+
private void setNoPropertyUIVisible(boolean isVisible) {
479+
noPropertyFileAP.setVisible(true);
480+
}
460481
}

DBMonitoringWindowApp/src/main/resources/fxml/HistoryMenu.fxml

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<?import javafx.scene.layout.BorderPane?>
1616
<?import javafx.scene.layout.HBox?>
1717
<?import javafx.scene.layout.StackPane?>
18+
<?import javafx.scene.layout.VBox?>
1819
<?import javafx.scene.text.Font?>
1920

2021
<SplitPane dividerPositions="0.15" minHeight="650.0" minWidth="1200.0" stylesheets="@../../../../../../../DBMonitoring/DBMonitoring/src/main/resources/css/javaFx.css" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="root.javafx.Controller.HistoryMenuController">
@@ -44,7 +45,7 @@
4445
<Font name="Noto Sans Korean Medium" size="13.0" />
4546
</font>
4647
</Label>
47-
<AnchorPane fx:id="topMenuBar" layoutX="217.0" layoutY="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="250.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
48+
<AnchorPane fx:id="topMenuBar" layoutX="217.0" layoutY="5.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="250.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
4849
<children>
4950
<JFXComboBox fx:id="runConnInfoFileComboBox" minWidth="300.0" styleClass="basic-font" stylesheets="@../../../../../../../DBMonitoring/DBMonitoring/src/main/resources/css/javaFx.css" unFocusColor="#ececec" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="60.0" AnchorPane.topAnchor="5.0" />
5051
<Button fx:id="monitoringRunBtn" layoutX="540.6000061035156" mnemonicParsing="false" onAction="#runMonitoring" style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="15.0" AnchorPane.topAnchor="5.0">
@@ -93,30 +94,49 @@
9394
</AnchorPane>
9495
<AnchorPane fx:id="noPropertyFileAP" style="-fx-background-color: white;">
9596
<children>
96-
<HBox alignment="CENTER" layoutY="269.6000061035156" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
97+
<VBox alignment="CENTER" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
9798
<children>
98-
<Label graphicTextGap="13.0" style="-fx-alignment: center;" text="접속정보 설정파일이 없습니다.">
99-
<graphic>
100-
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARCHIVE" size="40" text="" />
101-
</graphic>
102-
<styleClass>
103-
<String fx:value="basic-font" />
104-
<String fx:value="bold" />
105-
</styleClass>
106-
</Label>
107-
<JFXButton fx:id="goSettingMenuBtn" alignment="CENTER" contentDisplay="RIGHT" ellipsisString="" graphicTextGap="5.0" minWidth="70.0" onAction="#goSettingMenu" ripplerFill="BLACK" style="-fx-border-color: #ddd; -fx-font-size: 12px; -fx-border-radius: 30px; -fx-text-fill: black;" styleClass="basic-font" text="설정하기">
108-
<cursor>
109-
<Cursor fx:constant="HAND" />
110-
</cursor>
111-
<graphic>
112-
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARROW_CIRCLE_RIGHT" selectionEnd="0" selectionStart="0" size="13" />
113-
</graphic>
114-
<HBox.margin>
115-
<Insets left="15.0" />
116-
</HBox.margin>
117-
</JFXButton>
99+
<HBox alignment="CENTER">
100+
<children>
101+
<Label graphicTextGap="13.0" style="-fx-alignment: center;" text="접속정보 설정파일이 없습니다.">
102+
<graphic>
103+
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARCHIVE" size="40" text="" />
104+
</graphic>
105+
<styleClass>
106+
<String fx:value="basic-font" />
107+
<String fx:value="bold" />
108+
</styleClass>
109+
</Label>
110+
</children>
111+
</HBox>
112+
<HBox alignment="CENTER" spacing="20.0">
113+
<children>
114+
<JFXButton fx:id="goSettingMenuBtn1" alignment="CENTER" contentDisplay="RIGHT" ellipsisString="" graphicTextGap="5.0" minWidth="70.0" onAction="#goSettingMenu" ripplerFill="BLACK" style="-fx-border-color: #ddd; -fx-font-size: 12px; -fx-border-radius: 30px; -fx-text-fill: black;" styleClass="basic-font" text="설정하기">
115+
<cursor>
116+
<Cursor fx:constant="HAND" />
117+
</cursor>
118+
<graphic>
119+
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARROW_CIRCLE_RIGHT" selectionEnd="0" selectionStart="0" size="13" />
120+
</graphic>
121+
<HBox.margin>
122+
<Insets left="15.0" />
123+
</HBox.margin>
124+
</JFXButton>
125+
<JFXButton fx:id="fileOpenBtn" alignment="CENTER" contentDisplay="RIGHT" ellipsisString="" graphicTextGap="5.0" minWidth="70.0" onAction="#openPropertiesFile" ripplerFill="BLACK" style="-fx-border-color: #ddd; -fx-font-size: 12px; -fx-border-radius: 30px; -fx-text-fill: black;" styleClass="basic-font" text="파일열기">
126+
<cursor>
127+
<Cursor fx:constant="HAND" />
128+
</cursor>
129+
<graphic>
130+
<FontAwesomeIconView fill="#1f6cc4" glyphName="FOLDER_OPEN" selectionEnd="0" selectionStart="0" size="13" />
131+
</graphic>
132+
</JFXButton>
133+
</children>
134+
<VBox.margin>
135+
<Insets top="10.0" />
136+
</VBox.margin>
137+
</HBox>
118138
</children>
119-
</HBox>
139+
</VBox>
120140
</children>
121141
</AnchorPane>
122142
</children>

DBMonitoringWindowApp/src/main/resources/fxml/RunMenu.fxml

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<?import javafx.scene.layout.BorderPane?>
1717
<?import javafx.scene.layout.HBox?>
1818
<?import javafx.scene.layout.StackPane?>
19+
<?import javafx.scene.layout.VBox?>
1920
<?import javafx.scene.text.Font?>
2021

2122
<SplitPane dividerPositions="0.15" minHeight="650.0" minWidth="1200.0" stylesheets="@../css/javaFx.css" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="root.javafx.Controller.RunMenuController">
@@ -45,18 +46,7 @@
4546
<Font name="Noto Sans Korean Medium" size="13.0" />
4647
</font>
4748
</Label>
48-
<AnchorPane layoutX="217.0" layoutY="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="250.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
49-
<children>
50-
<Button layoutX="540.6000061035156" mnemonicParsing="false" style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="15.0" AnchorPane.topAnchor="5.0">
51-
<cursor>
52-
<Cursor fx:constant="HAND" />
53-
</cursor>
54-
<graphic>
55-
<FontAwesomeIconView fill="#4a892f" glyphName="PLAY_CIRCLE" size="22" />
56-
</graphic>
57-
</Button>
58-
</children>
59-
</AnchorPane>
49+
<AnchorPane layoutX="217.0" layoutY="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="250.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
6050
</children>
6151
</AnchorPane>
6252
</top>
@@ -312,30 +302,49 @@
312302
</ScrollPane>
313303
<AnchorPane fx:id="noPropertyFileAP" style="-fx-background-color: white;">
314304
<children>
315-
<HBox alignment="CENTER" layoutY="269.6000061035156" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
305+
<VBox alignment="CENTER" layoutX="10.0" layoutY="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
316306
<children>
317-
<Label graphicTextGap="13.0" style="-fx-alignment: center;" text="접속정보 설정파일이 없습니다.">
318-
<graphic>
319-
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARCHIVE" size="40" text="" />
320-
</graphic>
321-
<styleClass>
322-
<String fx:value="basic-font" />
323-
<String fx:value="bold" />
324-
</styleClass>
325-
</Label>
326-
<JFXButton fx:id="goSettingMenuBtn" alignment="CENTER" contentDisplay="RIGHT" ellipsisString="" graphicTextGap="5.0" minWidth="70.0" onAction="#goSettingMenu" ripplerFill="BLACK" style="-fx-border-color: #ddd; -fx-font-size: 12px; -fx-border-radius: 30px; -fx-text-fill: black;" styleClass="basic-font" text="설정하기">
327-
<cursor>
328-
<Cursor fx:constant="HAND" />
329-
</cursor>
330-
<graphic>
331-
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARROW_CIRCLE_RIGHT" selectionEnd="0" selectionStart="0" size="13" />
332-
</graphic>
333-
<HBox.margin>
334-
<Insets left="15.0" />
335-
</HBox.margin>
336-
</JFXButton>
307+
<HBox alignment="CENTER">
308+
<children>
309+
<Label graphicTextGap="13.0" style="-fx-alignment: center;" text="접속정보 설정파일이 없습니다.">
310+
<graphic>
311+
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARCHIVE" size="40" text="" />
312+
</graphic>
313+
<styleClass>
314+
<String fx:value="basic-font" />
315+
<String fx:value="bold" />
316+
</styleClass>
317+
</Label>
318+
</children>
319+
</HBox>
320+
<HBox alignment="CENTER" spacing="20.0">
321+
<children>
322+
<JFXButton fx:id="goSettingMenuBtn" alignment="CENTER" contentDisplay="RIGHT" ellipsisString="" graphicTextGap="5.0" minWidth="70.0" onAction="#goSettingMenu" ripplerFill="BLACK" style="-fx-border-color: #ddd; -fx-font-size: 12px; -fx-border-radius: 30px; -fx-text-fill: black;" styleClass="basic-font" text="설정하기">
323+
<cursor>
324+
<Cursor fx:constant="HAND" />
325+
</cursor>
326+
<graphic>
327+
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARROW_CIRCLE_RIGHT" selectionEnd="0" selectionStart="0" size="13" />
328+
</graphic>
329+
<HBox.margin>
330+
<Insets left="15.0" />
331+
</HBox.margin>
332+
</JFXButton>
333+
<JFXButton fx:id="fileOpenBtn" alignment="CENTER" contentDisplay="RIGHT" ellipsisString="" graphicTextGap="5.0" minWidth="70.0" onAction="#openPropertiesFile" ripplerFill="BLACK" style="-fx-border-color: #ddd; -fx-font-size: 12px; -fx-border-radius: 30px; -fx-text-fill: black;" styleClass="basic-font" text="파일열기">
334+
<cursor>
335+
<Cursor fx:constant="HAND" />
336+
</cursor>
337+
<graphic>
338+
<FontAwesomeIconView fill="#1f6cc4" glyphName="FOLDER_OPEN" selectionEnd="0" selectionStart="0" size="13" />
339+
</graphic>
340+
</JFXButton>
341+
</children>
342+
<VBox.margin>
343+
<Insets top="10.0" />
344+
</VBox.margin>
345+
</HBox>
337346
</children>
338-
</HBox>
347+
</VBox>
339348
</children>
340349
</AnchorPane>
341350
</children>

0 commit comments

Comments
 (0)