fix: 修复GUI模块编译错误,添加缺失的JavaFX import

main
SLMS Development Team 4 months ago
parent b192fda59a
commit d890f19dbe

@ -10,6 +10,9 @@ import com.smartlibrary.service.BookService;
import com.smartlibrary.service.UserService;
import com.smartlibrary.uml.PlantUMLService;
import javafx.stage.FileChooser;
import javafx.geometry.Orientation;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.util.List;
@ -36,8 +39,18 @@ import java.time.LocalDate;
*/
public class GUIApplication extends Application {
// 样式常量
private static final String STYLE_CARD = "-fx-background-color: white; -fx-border-radius: 5; -fx-border-color: #e0e0e0;";
private static final String STYLE_WHITE_BG = "-fx-background-color: white;";
private static final String COLOR_GREEN = "#4caf50";
private static final String COLOR_ORANGE = "#ff9800";
private static final String COLOR_BLUE = "#2196f3";
private static final String UML_TYPE_CLASS = "class";
private static final String MSG_EMPTY_PUML = "请先输入或生成PlantUML代码";
private static final String MSG_INVALID_PUML = "PlantUML代码无效请检查语法";
private static final String ROLE_READER = "READER";
private BookService bookService;
private AIService aiService;
private PlantUMLService plantUMLService;
private UserService userService;
private Stage primaryStage;
@ -57,7 +70,7 @@ public class GUIApplication extends Application {
public void start(Stage primaryStage) {
this.primaryStage = primaryStage;
bookService = new BookService();
aiService = new SmartAIService(bookService);
AIService aiService = new SmartAIService(bookService);
plantUMLService = new PlantUMLService();
userService = UserService.getInstance();
@ -93,9 +106,6 @@ public class GUIApplication extends Application {
// 创建场景
Scene scene = new Scene(root, 1200, 800);
// 暂时注释掉CSS加载避免空CSS文件导致问题
// scene.getStylesheets().add(getClass().getResource("/styles.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.setMinWidth(1000);
primaryStage.setMinHeight(700);

Loading…
Cancel
Save