cuixubin 4 年之前
父節點
當前提交
8db75db7a5

+ 2 - 1
file-move-tool.iml

@@ -5,7 +5,8 @@
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
       <excludeFolder url="file://$MODULE_DIR$/target" />
     </content>
     <orderEntry type="inheritedJdk" />

+ 14 - 1
src/main/java/com/persagy/filemove/app/SagaFileMoveApp.java

@@ -1,5 +1,7 @@
 package com.persagy.filemove.app;
 
+import com.persagy.filemove.dialog.FileMoveHelpDialog;
+import com.persagy.filemove.dialog.MessageDialog;
 import com.persagy.filemove.dto.SagaFileMoveDTO;
 import com.persagy.filemove.dto.WorkerFactory;
 import com.persagy.filemove.service.SagaFileMoveService;
@@ -26,6 +28,8 @@ import java.util.LinkedHashMap;
 public class SagaFileMoveApp extends Application {
     private static final Logger log = LoggerFactory.getLogger(SagaFileMoveApp.class);
 
+    private static final String aboutInfo = "Version:1.0\nJDK:1.8\nAuthor:cuixubin@persagy.com";
+
     private static int appWidth = 640;
     private static int appHeight = 560;
     public static SagaFileMoveDTO dto = new SagaFileMoveDTO();
@@ -79,7 +83,7 @@ public class SagaFileMoveApp extends Application {
     private ChoiceBox cbImgFromApiType = new ChoiceBox(FXCollections.observableArrayList(apiTypes));
 
     /** 文件服务To地址 */
-    private TextField tfImgToURL = new TextField("http://27.115.36.114:9909/image-service");
+    private TextField tfImgToURL = new TextField("http://127.0.0.1:6666/image-service");
     /** 文件服务To的systemId */
     private TextField tfImgToSysId = new TextField(sysId_dpf);
     /** 文件服务To的secret */
@@ -433,10 +437,19 @@ public class SagaFileMoveApp extends Application {
     private Menu getHelpMenu() {
         // 菜单项
         MenuItem mi_help = new MenuItem("Help");
+        mi_help.setOnAction((e)->{
+            new FileMoveHelpDialog().showAndWait();
+        });
+
         MenuItem mi_about = new MenuItem("About");
+        mi_about.setOnAction((e)->{
+            new MessageDialog("About", aboutInfo, 300, 120).showAndWait();
+        });
         SeparatorMenuItem seline = new SeparatorMenuItem();
 
+
         Menu helpMenu = new Menu("Help");
+
         helpMenu.getItems().addAll(mi_help, seline, mi_about);
         return helpMenu;
     }

+ 42 - 0
src/main/java/com/persagy/filemove/dialog/FileMoveHelpDialog.java

@@ -0,0 +1,42 @@
+package com.persagy.filemove.dialog;
+
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.layout.Pane;
+import javafx.stage.Modality;
+import javafx.stage.Stage;
+import javafx.stage.StageStyle;
+
+
+public class FileMoveHelpDialog extends Stage {
+    public FileMoveHelpDialog() {
+        StringBuilder msg = new StringBuilder("功能说明:实现两个SaaS环境中楼层地图文件(或设备、空间、\n系统、部件的二维码文件)的转移导入\n\n");
+        msg.append("使用说明:本应用需要运行在能同时访问SaaS环境A(至少能保证\n");
+        msg.append("与该环境的data-platform-3和image-service两个服务通信)\n");
+        msg.append("和SaaS环境B(至少能保证与该环境的image-service服务通信)\n");
+        msg.append("的服务器上。\n\n");
+
+        msg.append("参数说明:接口类型有三种[default, file, image]\n");
+        msg.append("在文件服务-From中,default为默认方式。表示对非.jsonz文件\n");
+        msg.append("用image_get接口获取数据,对.jsonz文件,用file_get获取数据。\n");
+        msg.append("在文件服务-To中,default表示用file_upload接口上传数据。\n");
+        Label label = new Label(msg.toString());
+        label.setLayoutX(20); label.setLayoutY(20);
+
+//        Image img = new Image(FileMoveHelpDialog.class.getResourceAsStream("/img/logic.jpg"));
+//        Label lbImg = new Label("");
+//        lbImg.setGraphic(new ImageView(img));
+//        lbImg.setLayoutX(16); lbImg.setLayoutY(130);
+//        lbImg.setPrefSize(320, 320);
+
+        Pane pane = new Pane();
+        pane.getChildren().addAll(label);
+
+        Scene scene = new Scene(pane, 480, 300);
+        setScene(scene);
+        setTitle("Help");
+        setResizable(false);
+        initStyle(StageStyle.UTILITY);
+        initModality(Modality.APPLICATION_MODAL);
+    }
+}

+ 25 - 0
src/main/java/com/persagy/filemove/dialog/MessageDialog.java

@@ -0,0 +1,25 @@
+package com.persagy.filemove.dialog;
+
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.layout.Pane;
+import javafx.stage.Modality;
+import javafx.stage.Stage;
+import javafx.stage.StageStyle;
+
+
+public class MessageDialog extends Stage {
+    public MessageDialog(String title, String msg, int width, int heigt) {
+        Label label = new Label(msg);
+        label.setLayoutX(20); label.setLayoutY(20);
+        Pane pane = new Pane();
+        pane.getChildren().add(label);
+
+        Scene scene = new Scene(pane, width, heigt);
+        setScene(scene);
+        setTitle(title);
+        setResizable(false);
+        initStyle(StageStyle.UTILITY);
+        initModality(Modality.APPLICATION_MODAL);
+    }
+}