Skip to content

Commit f31f2ee

Browse files
committed
- handle socket errors
- add popup dialog to retry connection - add system tray icon - add pause grabber action in system tray icon menu - add about dialog - bump to 1.0.0
1 parent a2ee44e commit f31f2ee

File tree

5 files changed

+380
-42
lines changed

5 files changed

+380
-42
lines changed

pom.xml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,25 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.b1project.neolights</groupId>
55
<artifactId>neo-light</artifactId>
6-
<version>0.0.1</version>
6+
<version>1.0.0</version>
77
<name>Udoo Neo ambiant light control</name>
8-
<url></url>
8+
<url>https://github.com/BOSSoNe0013/NeoLights</url>
9+
<organization>
10+
<name>The B1 Project</name>
11+
<url>https://www.b1project.com</url>
12+
</organization>
13+
<developers>
14+
<developer>
15+
<name>Cyril Bosselut</name>
16+
<email>bossone0013@gmail.com</email>
17+
</developer>
18+
</developers>
19+
<licenses>
20+
<license>
21+
<name>Apache-2.0</name>
22+
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
23+
</license>
24+
</licenses>
925

1026
<properties>
1127
<java.version>1.7</java.version>
@@ -31,10 +47,39 @@
3147
<artifactId>javacv</artifactId>
3248
<version>1.2</version>
3349
</dependency>
50+
<dependency>
51+
<groupId>com.dorkbox</groupId>
52+
<artifactId>SystemTray</artifactId>
53+
<version>2.20</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.slf4j</groupId>
57+
<artifactId>slf4j-nop</artifactId>
58+
<version>1.7.21</version>
59+
</dependency>
3460
</dependencies>
3561
<build>
3662
<sourceDirectory>src</sourceDirectory>
63+
<resources>
64+
<resource>
65+
<directory>src/res</directory>
66+
</resource>
67+
</resources>
3768
<plugins>
69+
<plugin>
70+
<groupId>org.apache.maven.plugins</groupId>
71+
<artifactId>maven-jar-plugin</artifactId>
72+
<configuration>
73+
<archive>
74+
<manifest>
75+
<mainClass>test.App</mainClass>
76+
<addDefaultImplementationEntries>
77+
true
78+
</addDefaultImplementationEntries>
79+
</manifest>
80+
</archive>
81+
</configuration>
82+
</plugin>
3883
<plugin>
3984
<groupId>org.apache.maven.plugins</groupId>
4085
<artifactId>maven-compiler-plugin</artifactId>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.b1project.neolights;
2+
3+
import javax.swing.*;
4+
import java.awt.*;
5+
import java.net.URL;
6+
7+
/**
8+
* Copyright (C) 2016 Cyril Bosselut <bossone0013@gmail.com>
9+
* <p>
10+
* This file is part of NeoLights
11+
* <p>
12+
* NeoLights is free software: you can redistribute it and/or modify
13+
* it under the terms of the GNU General Public License as published by
14+
* the Free Software Foundation, either version 3 of the License, or
15+
* (at your option) any later version.
16+
* <p>
17+
* This libraries are distributed in the hope that it will be useful,
18+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
* GNU General Public License for more details.
21+
* <p>
22+
* You should have received a copy of the GNU General Public License
23+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
24+
*/
25+
class AppIcon {
26+
private String path = "";
27+
private String description = "Application Icon";
28+
29+
AppIcon(String path, String description){
30+
this.path = path;
31+
this.description = description;
32+
}
33+
34+
ImageIcon getIcon(){
35+
java.net.URL imgURL = this.getURL();
36+
if (imgURL != null) {
37+
return new ImageIcon(imgURL, this.description);
38+
} else {
39+
System.err.println("Couldn't find file: " + this.path);
40+
return null;
41+
}
42+
}
43+
44+
Image getImage(){
45+
return this.getIcon().getImage();
46+
}
47+
48+
URL getURL(){
49+
return getClass().getResource(this.path);
50+
}
51+
}

0 commit comments

Comments
 (0)