Skip to content

Commit 13db4aa

Browse files
author
ganjun
committed
version1.0
0 parents  commit 13db4aa

File tree

192 files changed

+14637
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+14637
-0
lines changed

README.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# MultiSourceDataFusion
2+
NJU iip kjb MutiSourceDataFusion
3+
4+
## Java Maven 创建 fx程序
5+
6+
### 编译问题
7+
8+
1. java编译的过程默认不会将资源文件加入到编译中,IDEA创建的maven项目,编译后的文件保存在target中。
9+
10+
fxml,css等文件未被加入到编译,如果希望通过
11+
12+
```java
13+
getClass().getResource()
14+
```
15+
16+
来加载资源,必须保证这些文件加入编译,出现在target中
17+
18+
可以在pom.xml中添加编译的配置类似如下
19+
20+
```xml
21+
<build>
22+
<resources>
23+
<resource>
24+
<directory>src/main/java</directory>
25+
<includes>
26+
<include>**/*.fxml</include>
27+
<include>**/*.css</include>
28+
<include>**/*.png</include>
29+
</includes>
30+
<filtering>true</filtering>
31+
</resource>
32+
</resources>
33+
</build>
34+
```
35+
36+
37+
38+
39+
### Controller变量命名统一
40+
41+
1. 每一个组件的命名尽量按照比如
42+
43+
一个账号存在 TextField 的controller中,取所有的大写字母以tf作为前缀
44+
45+
比如Button这种只有一个大写的,可以以比较通用的格式如btn作为前缀
46+
47+
```java
48+
private TextField account;
49+
private Button btnLogin;
50+
```
51+
52+
如果是fxml中文件定义的变量请按照正确的前缀命名
53+
54+
```java
55+
@FXML
56+
private Label LblMainTitle;
57+
@FXML
58+
private AnchorPane APLoadData;
59+
@FXML
60+
private AnchorPane APParticiple;
61+
@FXML
62+
private AnchorPane APEntity;
63+
@FXML
64+
private AnchorPane APSetting;
65+
@FXML
66+
private BorderPane BPMainViewPane;
67+
```
68+
69+
如果是辅助的定义的变量
70+
就根据普通的驼峰命名法命名
71+
72+
```java
73+
private AnchorPane currentMenuPane;
74+
private AnchorPane connectionConfigPane;
75+
private List<MenuModule> menuModules;
76+
```
77+
78+
79+
### 直接在代码中添加控件的方式
80+
81+
```java
82+
public class Login extends Application {
83+
84+
@Override
85+
public void start(Stage primaryStage) {
86+
primaryStage.setTitle("JavaFX Welcome");
87+
GridPane grid = new GridPane();
88+
grid.setAlignment(Pos.CENTER);
89+
grid.setHgap(10);
90+
grid.setVgap(10);
91+
grid.setPadding(new Insets(25, 25, 25, 25));
92+
93+
Text scenetitle = new Text("Welcome");
94+
scenetitle.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
95+
grid.add(scenetitle, 0, 0, 2, 1);
96+
97+
Label userName = new Label("User Name:");
98+
grid.add(userName, 0, 1);
99+
100+
TextField userTextField = new TextField();
101+
grid.add(userTextField, 1, 1);
102+
103+
Label pw = new Label("Password:");
104+
grid.add(pw, 0, 2);
105+
106+
PasswordField pwBox = new PasswordField();
107+
grid.add(pwBox, 1, 2);
108+
109+
Button btn = new Button("Sign in");
110+
HBox hbBtn = new HBox(10);
111+
hbBtn.setAlignment(Pos.BOTTOM_RIGHT);
112+
hbBtn.getChildren().add(btn);
113+
grid.add(hbBtn, 1, 4);
114+
115+
final Text actiontarget = new Text();
116+
grid.add(actiontarget, 0, 6);
117+
grid.setColumnSpan(actiontarget, 2);
118+
grid.setHalignment(actiontarget, RIGHT);
119+
actiontarget.setId("actiontarget");
120+
btn.setOnAction(e -> {
121+
122+
@Override
123+
public void handle(ActionEvent e) {
124+
actiontarget.setFill(Color.FIREBRICK);
125+
actiontarget.setText("Sign in button pressed");
126+
}
127+
});
128+
btn.setOnAction(new EventHandler<ActionEvent>() {
129+
130+
@Override
131+
public void handle(ActionEvent e) {
132+
actiontarget.setFill(Color.FIREBRICK);
133+
actiontarget.setText("Sign in button pressed");
134+
}
135+
});
136+
137+
Scene scene = new Scene(grid, 300, 275);
138+
primaryStage.setScene(scene);
139+
primaryStage.show();
140+
}
141+
142+
public static void main(String[] args) {
143+
launch(args);
144+
}
145+
146+
}
147+
```
148+
149+
150+
151+
### Reference
152+
153+
1. 登录界面的参考:https://blog.csdn.net/legendnovo/article/details/10555941

corpus/corpus1.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(2018-06-10 18:00:00)李明在清华大学参观
2+
(2018-05-08 12:30:00)周华在九寨沟风景区买了门票
3+
(2018-03-06 08:00:00)李明到达了舟山群岛
4+
(2018-12-10 11:00:00)周华在北仑区人民政府参观
5+
(2018-04-21 10:00:00)李明在上海交通大学参观
6+
(2018-04-22 10:00:00)李明在四川大学参观
7+
(2018-04-24 10:00:00)李明在大连理工大学参观
8+
(2018-04-26 10:00:00)李明在南京大学参观

pom.xml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>iip</groupId>
8+
<artifactId>kjb</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<build>
12+
<resources>
13+
<resource>
14+
<directory>src/main/java</directory>
15+
<includes>
16+
<include>**/*.fxml</include>
17+
<include>**/*.css</include>
18+
<include>**/*.png</include>
19+
<include>**/*.jng</include>
20+
<include>**/resource/**</include>
21+
</includes>
22+
<filtering>true</filtering>
23+
</resource>
24+
</resources>
25+
<plugins>
26+
<plugin>
27+
<groupId>org.apache.maven.plugins</groupId>
28+
<artifactId>maven-compiler-plugin</artifactId>
29+
<version>2.3.2</version>
30+
<configuration>
31+
<source>1.8</source>
32+
<target>1.8</target>
33+
</configuration>
34+
</plugin>
35+
<plugin>
36+
<groupId>org.apache.maven.plugins</groupId>
37+
<artifactId>maven-compiler-plugin</artifactId>
38+
<version>3.1</version>
39+
<configuration>
40+
<source>1.8</source>
41+
<target>1.8</target>
42+
<encoding>UTF-8</encoding>
43+
</configuration>
44+
</plugin>
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-jar-plugin</artifactId>
48+
<configuration>
49+
<archive>
50+
<manifest>
51+
<addClasspath>true</addClasspath>
52+
<classpathPrefix>lib/</classpathPrefix>
53+
<mainClass>com.yourpakagename.mainClassName</mainClass>
54+
</manifest>
55+
</archive>
56+
</configuration>
57+
</plugin>
58+
<plugin>
59+
<groupId>org.apache.maven.plugins</groupId>
60+
<artifactId>maven-dependency-plugin</artifactId>
61+
<executions>
62+
<execution>
63+
<id>copy</id>
64+
<phase>install</phase>
65+
<goals>
66+
<goal>copy-dependencies</goal>
67+
</goals>
68+
<configuration>
69+
<outputDirectory>${project.build.directory}/lib</outputDirectory>
70+
</configuration>
71+
</execution>
72+
</executions>
73+
</plugin>
74+
<plugin>
75+
<artifactId>maven-assembly-plugin</artifactId>
76+
<configuration>
77+
<appendAssemblyId>false</appendAssemblyId>
78+
<descriptorRefs>
79+
<descriptorRef>jar-with-dependencies</descriptorRef>
80+
</descriptorRefs>
81+
<archive>
82+
<manifest>
83+
<!-- 此处指定main方法入口的class -->
84+
<mainClass>com.xxx.uploadFile</mainClass>
85+
</manifest>
86+
</archive>
87+
</configuration>
88+
<executions>
89+
<execution>
90+
<id>make-assembly</id>
91+
<phase>package</phase>
92+
<goals>
93+
<goal>assembly</goal>
94+
</goals>
95+
</execution>
96+
</executions>
97+
</plugin>
98+
</plugins>
99+
</build>
100+
101+
<dependencies>
102+
<dependency>
103+
<groupId>com.hankcs</groupId>
104+
<artifactId>hanlp</artifactId>
105+
<version>portable-1.7.1</version>
106+
</dependency>
107+
<!-- https://mvnrepository.com/artifact/org.python/jython -->
108+
<dependency>
109+
<groupId>org.python</groupId>
110+
<artifactId>jython</artifactId>
111+
<version>2.7.0</version>
112+
</dependency>
113+
114+
<dependency>
115+
<groupId>mysql</groupId>
116+
<artifactId>mysql-connector-java</artifactId>
117+
<version>5.1.46</version>
118+
</dependency>
119+
</dependencies>
120+
</project>

resource/TimeExp.m

2.96 KB
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.iip.connection;
2+
3+
/**
4+
* @Author Junnor.G
5+
* @Date 2018/12/4 下午4:06
6+
*/
7+
8+
import java.util.List;
9+
import java.util.Map;
10+
11+
public interface Connection {
12+
String getNickName();
13+
String getType();
14+
Map<String, Table> getTables();
15+
boolean isTarget();
16+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.iip.connection;
2+
3+
/**
4+
* Created by gegaojian on 7/20/17.
5+
*/
6+
public class Field {
7+
protected String name;
8+
protected String fieldType;
9+
protected String isKey;//有“Y” “N” “”三种取值
10+
11+
public Field(String name, String fieldType, String isKey) {
12+
this.name = name;
13+
this.fieldType = fieldType;
14+
this.isKey = isKey;
15+
}
16+
17+
public String getName() {
18+
return name;
19+
}
20+
21+
public String getFieldType() {
22+
return fieldType;
23+
}
24+
25+
public String getIsKey() {
26+
return isKey;
27+
}
28+
29+
public boolean isKey() {
30+
return isKey == "Y";
31+
}
32+
33+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.iip.connection;
2+
3+
/**
4+
* 表格类
5+
* Created by gegaojian on 7/20/17.
6+
* finished by ... on ...
7+
* fixed by ... on ...
8+
*/
9+
10+
import java.util.ArrayList;
11+
import java.util.LinkedHashMap;
12+
import java.util.Map;
13+
import java.util.TreeMap;
14+
15+
16+
public class Table {
17+
private String tableName;
18+
private Map<String, Field> fields = new LinkedHashMap<String, Field>();
19+
//....
20+
21+
public Table(String tableName){
22+
this.tableName = tableName;
23+
}
24+
25+
public void setTableName(String tableName) {
26+
this.tableName = tableName;
27+
}
28+
29+
public void setFields(LinkedHashMap<String, Field> fields) {
30+
this.fields = fields;
31+
}
32+
33+
public String getTableName(){ return tableName; }
34+
35+
public Map<String, Field> getFields() {
36+
return fields;
37+
}
38+
39+
// public void addField(TargetField field){
40+
// this.fields.add(field);
41+
// }
42+
43+
// public void deleteFieldByIndex(int index){
44+
// this.fields.remove(index);
45+
// }
46+
47+
// public void editFieldByIndex(int index, TargetField field){
48+
// this.fields.set(index, field);
49+
// }
50+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
保存处理数据的模块

0 commit comments

Comments
 (0)