cuixubin 4 years ago
commit
d08d7d5199

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+/target/
+/data-platform-tool.iml

+ 117 - 0
pom.xml

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.example</groupId>
+    <artifactId>data-platform-tool</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <properties>
+        <org.apache.httpcomponents.version>4.5.5</org.apache.httpcomponents.version>
+    </properties>
+
+    <dependencies>
+        <!-- log -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.7.25</version>
+        </dependency>
+        <!--json-->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>2.9.8</version>
+        </dependency>
+        <!-- httpclient -->
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>${org.apache.httpcomponents.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient-cache</artifactId>
+            <version>${org.apache.httpcomponents.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient-win</artifactId>
+            <version>${org.apache.httpcomponents.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpmime</artifactId>
+            <version>${org.apache.httpcomponents.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.4.9</version>
+        </dependency>
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>alimaven</id>
+            <name>aliyun maven</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
+        </repository>
+    </repositories>
+
+    <build>
+        <finalName>file-move-tool</finalName>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.fxml</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <includes>
+                    <include>**/*.fxml</include>
+                </includes>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.5.1</version>
+                <inherited>true</inherited>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.1.0</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <transformers>
+                                <transformer
+                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>com.persagy.dptool.MainApp</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+
+    </build>
+
+</project>

+ 26 - 0
src/main/java/com/persagy/dptool/MainApp.java

@@ -0,0 +1,26 @@
+package com.persagy.dptool;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class MainApp extends Application {
+
+    public static void main(String[] args) {
+        launch(args);
+    }
+
+    @Override
+    public void start(Stage primaryStage) throws IOException {
+        InputStream is = MainApp.class.getResourceAsStream("primary.fxml");
+        Parent root = new FXMLLoader().load(is);
+        primaryStage.setTitle("Hello World");
+        primaryStage.setScene(new Scene(root));
+        primaryStage.show();
+    }
+}

+ 19 - 0
src/main/java/com/persagy/dptool/PrimaryController.java

@@ -0,0 +1,19 @@
+package com.persagy.dptool;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.Initializable;
+
+import java.net.URL;
+import java.util.ResourceBundle;
+
+public class PrimaryController implements Initializable {
+
+    @Override
+    public void initialize(URL location, ResourceBundle resources) {
+
+    }
+
+    public void checkConfig(ActionEvent e) {
+        System.out.println("checked");
+    }
+}

+ 80 - 0
src/main/java/com/persagy/dptool/primary.fxml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.effect.*?>
+<?import javafx.scene.text.*?>
+<?import javafx.geometry.*?>
+<?import java.lang.*?>
+<?import java.util.*?>
+<?import javafx.scene.*?>
+<?import javafx.scene.control.*?>
+<?import javafx.scene.layout.*?>
+
+
+<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="640.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.persagy.dptool.PrimaryController">
+   <top>
+      <MenuBar BorderPane.alignment="CENTER">
+        <menus>
+          <Menu mnemonicParsing="false" text="Help">
+            <items>
+                  <MenuItem mnemonicParsing="false" text="Help" />
+                  <SeparatorMenuItem mnemonicParsing="false" />
+              <MenuItem mnemonicParsing="false" text="About" />
+            </items>
+          </Menu>
+        </menus>
+      </MenuBar>
+   </top>
+   <bottom>
+      <Label prefHeight="30.0" prefWidth="800.0" text="Label" BorderPane.alignment="CENTER">
+         <padding>
+            <Insets left="5.0" />
+         </padding>
+      </Label>
+   </bottom>
+   <center>
+      <TabPane prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE" BorderPane.alignment="CENTER">
+        <tabs>
+          <Tab text="配置校验">
+            <content>
+              <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
+                     <children>
+                        <Label layoutX="12.0" layoutY="14.0" prefHeight="26.0" prefWidth="128.0" text="数据平台配置目录:" />
+                        <TextField layoutX="138.0" layoutY="12.0" prefHeight="30.0" prefWidth="516.0" promptText="D:/develop/tomcat9/webapps/data-platform-3/WEB-INF/classes/" />
+                        <Button layoutX="668.0" layoutY="12.0" mnemonicParsing="false" text="选择" />
+                        <Button fx:id="btnCheck" layoutX="736.0" layoutY="12.0" mnemonicParsing="false" onAction="#checkConfig" text="校验" />
+                        <Label layoutX="138.0" layoutY="49.0" prefHeight="20.0" prefWidth="644.0" text="注: 路径为数据平台配置文件config.proerties所在目录" textFill="#7c7c7c">
+                           <font>
+                              <Font size="14.0" />
+                           </font>
+                        </Label>
+                        <StackPane layoutX="138.0" layoutY="96.0" prefHeight="433.0" prefWidth="611.0">
+                           <children>
+                              <FlowPane orientation="VERTICAL" prefHeight="200.0" prefWidth="200.0" vgap="20.0">
+                                 <opaqueInsets>
+                                    <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
+                                 </opaqueInsets>
+                                 <children>
+                                    <TextArea editable="false" prefHeight="436.0" prefWidth="611.0" text="helloworld" />
+                                 </children>
+                              </FlowPane>
+                           </children>
+                        </StackPane>
+                        <Label layoutX="72.0" layoutY="96.0" prefHeight="20.0" prefWidth="66.0" text="校验结果:" />
+                     </children>
+                  </AnchorPane>
+            </content>
+          </Tab>
+          <Tab text="物理世界">
+            <content>
+              <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
+            </content>
+          </Tab>
+            <Tab text="其他">
+              <content>
+                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
+              </content>
+            </Tab>
+        </tabs>
+      </TabPane>
+   </center>
+</BorderPane>