Skip to content
This repository was archived by the owner on Aug 17, 2023. It is now read-only.

Commit 33b01d7

Browse files
committed
Refactoring resource
Fix minor bug for GUI
1 parent bfef82d commit 33b01d7

Some content is hidden

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

57 files changed

+242
-126
lines changed

.idea/compiler.xml

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Maven__org_locationtech_jts_jts_core_1_15_0.xml .idea/libraries/Maven__org_locationtech_jts_jts_core_1_16_0.xml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IndoorMapmatching/IndoorMapmatching.iml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
88
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
99
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10+
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
1011
<excludeFolder url="file://$MODULE_DIR$/target" />
1112
</content>
1213
<orderEntry type="inheritedJdk" />
@@ -26,7 +27,6 @@
2627
</orderEntry>
2728
<orderEntry type="library" name="poi-3.17" level="project" />
2829
<orderEntry type="library" name="gt-jts-wrapper-18.1" level="project" />
29-
<orderEntry type="library" name="Maven: org.locationtech.jts:jts-core:1.15.0" level="project" />
3030
<orderEntry type="library" name="Maven: org.geotools:gt-graph:20.0" level="project" />
3131
<orderEntry type="library" name="Maven: org.geotools:gt-main:20.0" level="project" />
3232
<orderEntry type="library" name="Maven: org.geotools:gt-api:20.0" level="project" />
@@ -44,6 +44,7 @@
4444
<orderEntry type="library" name="Maven: si.uom:si-units-java8:0.7.1" level="project" />
4545
<orderEntry type="library" name="Maven: jgridshift:jgridshift:1.0" level="project" />
4646
<orderEntry type="library" name="Maven: net.sf.geographiclib:GeographicLib-Java:1.49" level="project" />
47+
<orderEntry type="library" name="Maven: org.locationtech.jts:jts-core:1.16.0" level="project" />
4748
<orderEntry type="library" name="Maven: org.jdom:jdom2:2.0.6" level="project" />
4849
<orderEntry type="library" name="Maven: javax.media:jai_core:1.1.3" level="project" />
4950
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.9" level="project" />

IndoorMapmatching/pom.xml

+86-23
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6-
76
<developers>
87
<developer>
98
<id>TaehoonK</id>
@@ -16,34 +15,103 @@
1615
</roles>
1716
</developer>
1817
</developers>
18+
<organization>
19+
<name>STEMLab in Pusan National University</name>
20+
<url>http://stem.pnu.edu</url>
21+
</organization>
22+
<properties>
23+
<jts.version>1.15.0</jts.version>
24+
<jar.name>simmApplication</jar.name>
25+
<lib.dir>lib</lib.dir>
26+
</properties>
27+
<groupId>edu.pnu.stem</groupId>
28+
<artifactId>IndoorMapmatching</artifactId>
29+
<version>1.0-SNAPSHOT</version>
30+
<packaging>jar</packaging>
31+
<!-- <packaging>jar</packaging> -->
32+
1933
<build>
2034
<plugins>
35+
<!-- ======================================================= -->
36+
<!-- JAR packaging. -->
37+
<!-- ======================================================= -->
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-jar-plugin</artifactId>
41+
<version>2.4</version>
42+
<configuration>
43+
<finalName>${jar.name}</finalName>
44+
<outputDirectory>${project.basedir}</outputDirectory>
45+
<archive>
46+
<manifest>
47+
<mainClass>edu.pnu.stem.indoor.gui.IndoorMapmatchingSim</mainClass>
48+
<addClasspath>true</addClasspath>
49+
<classpathPrefix>${lib.dir}/</classpathPrefix>
50+
</manifest>
51+
</archive>
52+
</configuration>
53+
</plugin>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-dependency-plugin</artifactId>
57+
<version>2.3</version>
58+
<executions>
59+
<execution>
60+
<id>copy-dependencies</id>
61+
<phase>package</phase>
62+
<goals>
63+
<goal>copy-dependencies</goal>
64+
</goals>
65+
</execution>
66+
</executions>
67+
<configuration>
68+
<outputDirectory>${project.basedir}/${lib.dir}</outputDirectory>
69+
<overWriteIfNewer>true</overWriteIfNewer>
70+
</configuration>
71+
</plugin>
72+
<plugin>
73+
<groupId>org.apache.maven.plugins</groupId>
74+
<artifactId>maven-resources-plugin</artifactId>
75+
<version>2.6</version>
76+
<inherited>false</inherited>
77+
<executions>
78+
<execution>
79+
<id>copy-resources</id>
80+
<phase>install</phase>
81+
<goals>
82+
<goal>copy-resources</goal>
83+
</goals>
84+
</execution>
85+
</executions>
86+
<configuration>
87+
<encoding>UTF-8</encoding>
88+
<outputDirectory>${basedir}/target</outputDirectory>
89+
<resources>
90+
<resource>
91+
<filtering>true</filtering>
92+
<directory>${basedir}</directory>
93+
<includes>
94+
<include>VERSION.txt</include>
95+
</includes>
96+
</resource>
97+
</resources>
98+
</configuration>
99+
</plugin>
21100
<plugin>
22101
<groupId>org.apache.maven.plugins</groupId>
23102
<artifactId>maven-compiler-plugin</artifactId>
103+
<version>3.7.0</version>
24104
<configuration>
25-
<source>8</source>
26-
<target>8</target>
105+
<source>1.8</source>
106+
<target>1.8</target>
107+
<fork>true</fork>
108+
<encoding>utf-8</encoding>
109+
<maxmem>512M</maxmem>
27110
</configuration>
28111
</plugin>
29112
</plugins>
30113
</build>
31114

32-
<groupId>edu.pnu.stem</groupId>
33-
<artifactId>IndoorMapmatching</artifactId>
34-
<version>1.0-SNAPSHOT</version>
35-
36-
<organization>
37-
<name>STEMLab in Pusan National University</name>
38-
<url>http://stem.pnu.edu</url>
39-
</organization>
40-
41-
<packaging>pom</packaging>
42-
43-
<properties>
44-
<jts.version>1.15.0</jts.version>
45-
</properties>
46-
47115
<repositories>
48116
<repository>
49117
<id>boundless</id>
@@ -57,11 +125,6 @@
57125
</repositories>
58126

59127
<dependencies>
60-
<dependency>
61-
<groupId>org.locationtech.jts</groupId>
62-
<artifactId>jts-core</artifactId>
63-
<version>${jts.version}</version>
64-
</dependency>
65128
<!-- https://mvnrepository.com/artifact/org.geotools/gt-graph -->
66129
<dependency>
67130
<groupId>org.geotools</groupId>
File renamed without changes.
File renamed without changes.
File renamed without changes.

IndoorMapmatching/src/main/java/edu/pnu/stem/indoor/gui/CanvasPanel.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class CanvasPanel extends JPanel implements MouseListener, MouseMotionLis
4040
private static final double SNAP_THRESHOLD = 10; // Threshold value for snapping function
4141
private static final double POINT_RADIUS = 5; // Radius of point for draw point (circle shape)
4242
private static final double SCREEN_BUFFER = 50; // Screen buffer value
43-
private static final int ARR_SIZE = 8; // Arrow size of directed line
43+
private static final int ARR_SIZE = 8; // Arrow size of directed line
4444
private static final double MAX_DISTANCE = ChangeCoord.CANVAS_MULTIPLE * 3; // The distance that humans can move per unit time
4545
private static final double MIN_DISTANCE = ChangeCoord.CANVAS_MULTIPLE * 0.5;
4646

@@ -59,10 +59,12 @@ public class CanvasPanel extends JPanel implements MouseListener, MouseMotionLis
5959
private ArrayList<LineString> relatedD2DEdge = null;
6060
private ArrayList<Polygon> circleBufferArray = null;
6161

62+
private IndoorMapmatchingSim parent;
63+
6264
int mousePositionX;
6365
int mousePositionY;
6466

65-
CanvasPanel() {
67+
CanvasPanel(IndoorMapmatchingSim parent) {
6668
gf = new GeometryFactory();
6769
indoorFeatures = new IndoorFeatures(gf);
6870
relatedVisibilityEdge = new ArrayList<>();
@@ -72,6 +74,7 @@ public class CanvasPanel extends JPanel implements MouseListener, MouseMotionLis
7274
this.addMouseMotionListener(this);
7375
this.addMouseWheelListener(this);
7476
this.addKeyListener(this);
77+
this.parent = parent;
7578
}
7679

7780
void setIndoorFeatures(IndoorFeatures indoorFeatures) {
@@ -178,6 +181,7 @@ protected void paintComponent(Graphics g) {
178181
}
179182
}
180183
}
184+
parent.changeCanvasArea(ChangeCoord.getArea());
181185
}
182186
if(trajectory != null) {
183187
drawArrowLines(g2, trajectory.getCoordinates(), trajectory.getNumPoints(), Color.GREEN);
@@ -423,7 +427,7 @@ public void mouseMoved(MouseEvent e) {
423427

424428
mousePositionX = e.getX();
425429
mousePositionY = e.getY();
426-
repaint();
430+
//repaint();
427431

428432
}
429433

0 commit comments

Comments
 (0)