Skip to content

Commit c0ef6ad

Browse files
committed
UI/UX: Add AnchorPane that showed when there is no configuration file
1 parent 34c407c commit c0ef6ad

File tree

2 files changed

+62
-22
lines changed

2 files changed

+62
-22
lines changed

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ public class SettingMenuController implements Initializable {
7272
SplitPane rootSplitPane;
7373

7474
@FXML
75-
AnchorPane noPropertiesFileAP1; // [설정] - [모니터링 여부 설정] 설정파일이 지정되지 않았을 때 보여줄 AnchorPane
75+
AnchorPane noConnInfoConfigAP; // [설정] - [접속정보 설정] 설정파일이 지정되지 않았을 때 보여줄 AnchorPane
7676

7777
@FXML
78-
AnchorPane noPropertiesFileAP2; // [설정] - [접속정보 설정] 설정파일이 지정되지 않았을 때 보여줄 AnchorPane
78+
AnchorPane noMonitoringConfigAP; // [설정] - [모니터링 여부 설정] 설정파일이 지정되지 않았을 때 보여줄 AnchorPane
7979

8080
@FXML
8181
VBox monitoringElementsVBox;
@@ -119,13 +119,16 @@ public void initialize(URL location, ResourceBundle resources) {
119119
logger.debug("최근 사용된 프로퍼티파일: " + lastUsePropertiesFile);
120120
if (lastUsePropertiesFile != null && propertyRepository.isFileExist(lastUsePropertiesFile)) {
121121
loadSelectedConfigFile(lastUsePropertiesFile);
122-
}
123122

124-
// [설정] - [모니터링 여부 설정] - Preset 변경 Event
125-
monitoringPresetComboBox.getSelectionModel().selectedItemProperty()
126-
.addListener((options, oldValue, newValue) -> {
127-
loadMonitoringConfigFile(monitoringPresetMap.get(newValue));
128-
});
123+
// [설정] - [모니터링 여부 설정] - Preset 변경 Event
124+
monitoringPresetComboBox.getSelectionModel().selectedItemProperty()
125+
.addListener((options, oldValue, newValue) -> {
126+
loadMonitoringConfigFile(monitoringPresetMap.get(newValue));
127+
});
128+
} else {
129+
noConnInfoConfigAP.toFront();
130+
noMonitoringConfigAP.toFront();
131+
}
129132
}
130133

131134
/**

src/main/resources/fxml/SettingMenu.fxml

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,61 @@
4747
<center>
4848
<AnchorPane fx:id="connectInfoAnchorPane" style="-fx-background-color: white;">
4949
<children>
50-
<AnchorPane fx:id="noPropertiesFileAP2" style="-fx-background-color: white;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
51-
<children>
52-
<Label graphicTextGap="13.0" style="-fx-alignment: center;" text="설정파일을 열어주세요." AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
53-
<graphic>
54-
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARCHIVE" size="40" />
55-
</graphic>
56-
<styleClass>
57-
<String fx:value="basic-font" />
58-
<String fx:value="bold" />
59-
</styleClass>
60-
</Label>
61-
</children>
62-
</AnchorPane>
6350
<ScrollPane fitToHeight="true" fitToWidth="true" style="-fx-background-color: white;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
6451
<content>
6552
<VBox fx:id="connInfoVBox" style="-fx-background-color: white;" />
6653
</content>
6754
</ScrollPane>
55+
<AnchorPane fx:id="noConnInfoConfigAP" style="-fx-background-color: white;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
56+
<children>
57+
<VBox alignment="CENTER" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
58+
<children>
59+
<HBox alignment="CENTER">
60+
<children>
61+
<Label alignment="CENTER" graphicTextGap="13.0" text="설정파일을 생성하거나 열어주세요.">
62+
<graphic>
63+
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARCHIVE" size="40" />
64+
</graphic>
65+
<styleClass>
66+
<String fx:value="basic-font" />
67+
<String fx:value="bold" />
68+
</styleClass>
69+
</Label>
70+
</children>
71+
</HBox>
72+
<HBox alignment="CENTER">
73+
<children>
74+
<JFXButton alignment="CENTER" ellipsisString="" graphicTextGap="5.0" minWidth="70.0" ripplerFill="BLACK" style="-fx-border-color: #ddd; -fx-font-size: 12px; -fx-border-radius: 30px; -fx-text-fill: black;" styleClass="basic-font" text="새로만들기" textOverrun="CLIP">
75+
<cursor>
76+
<Cursor fx:constant="HAND" />
77+
</cursor>
78+
<graphic>
79+
<FontAwesomeIconView glyphName="PLUS_SQUARE_ALT" selectionEnd="0" selectionStart="0" size="13" />
80+
</graphic>
81+
<HBox.margin>
82+
<Insets right="15.0" />
83+
</HBox.margin>
84+
</JFXButton>
85+
<JFXButton alignment="CENTER" ellipsisString="" graphicTextGap="5.0" minWidth="70.0" onAction="#openFileChooser" ripplerFill="BLACK" style="-fx-border-color: #ddd; -fx-font-size: 12px; -fx-border-radius: 30px; -fx-text-fill: black;" styleClass="basic-font" text="열기">
86+
<cursor>
87+
<Cursor fx:constant="HAND" />
88+
</cursor>
89+
<graphic>
90+
<FontAwesomeIconView glyphName="FOLDER_OPEN_ALT" selectionEnd="0" selectionStart="0" size="13" />
91+
</graphic>
92+
<HBox.margin>
93+
<Insets left="15.0" />
94+
</HBox.margin>
95+
</JFXButton>
96+
</children>
97+
<VBox.margin>
98+
<Insets top="20.0" />
99+
</VBox.margin>
100+
</HBox>
101+
</children>
102+
</VBox>
103+
</children>
104+
</AnchorPane>
68105
</children>
69106
</AnchorPane>
70107
</center>
@@ -104,7 +141,7 @@
104141
<center>
105142
<AnchorPane>
106143
<children>
107-
<AnchorPane fx:id="noPropertiesFileAP1" style="-fx-background-color: white;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
144+
<AnchorPane fx:id="noMonitoringConfigAP" style="-fx-background-color: white;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
108145
<children>
109146
<Label graphicTextGap="13.0" style="-fx-alignment: center;" text="설정파일을 열어주세요." AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
110147
<graphic>

0 commit comments

Comments
 (0)