Skip to content

Commit

Permalink
Initial push
Browse files Browse the repository at this point in the history
  • Loading branch information
chocoearly44 committed Jan 21, 2022
0 parents commit 1857626
Show file tree
Hide file tree
Showing 23 changed files with 1,383 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.idea
/target
*.iml
/out/
.env
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 chocoearly44

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<p align="center">
<img align="center" src="assets/linux/zapit.png" height="150px">
</p>

<h1 align="center">ZapIt</h1>
<h3 align="center">An advanced MQTT client made for the modern age.</h3>
<br>

<div align="center">

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]

</div>

## Documentation
Please refer to the [Wiki Section](https://github.com/chocoearly44/bsoverlay-vscode/issues).

## Installing
![][linux-shield]
![][windows-shield]
![][macos-shield]

Go to the [Releases section][releases-url] and download the latest release.

### Requirements
- [Liberica Full JRE](https://bell-sw.com/pages/downloads) (not needed if you're using an installer)

## Contributing
### Requirements
- [Liberica Full JDK and JRE](https://bell-sw.com/pages/downloads)
- [Apache Maven](https://maven.apache.org)

If you have a suggestion that would make this better, please fork the repo and create a pull request.
Don't forget to give the project a star! Thanks again!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Added some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## Bug reporting
If you encounter any bugs while using the tools please report them in the [Issues Section][issues-url] on GitHub Repository.

## Support
You can receive additional support in an official Discord Server or in a [Discussions Section][discussions-url] here on GitHub.

[![Widget for the TSL Support guild](https://discord.com/api/guilds/807666401300316160/widget.png?style=banner1)](https://discord.gg/Wa24skGscR)

[contributors-shield]: https://img.shields.io/github/contributors/chocoearly44/ZapIt.svg?style=for-the-badge
[forks-shield]: https://img.shields.io/github/forks/chocoearly44/ZapIt.svg?style=for-the-badge
[stars-shield]: https://img.shields.io/github/stars/chocoearly44/ZapIt.svg?style=for-the-badge
[issues-shield]: https://img.shields.io/github/issues/chocoearly44/ZapIt.svg?style=for-the-badge
[license-shield]: https://img.shields.io/github/license/chocoearly44/ZapIt.svg?style=for-the-badge

[linux-shield]: https://img.shields.io/badge/Linux-Yes-green?style=for-the-badge&logo=linux
[windows-shield]: https://img.shields.io/badge/Windows-Not%20yet-red?style=for-the-badge&logo=windows
[macos-shield]: https://img.shields.io/badge/MacOs-Not%20yet-red?style=for-the-badge&logo=apple

[contributors-url]: https://github.com/chocoearly44/ZapIt/graphs/contributors
[forks-url]: https://github.com/chocoearly44/ZapIt/network/members
[stars-url]: https://github.com/chocoearly44/ZapIt/stargazers
[issues-url]: https://github.com/chocoearly44/ZapIt/issues
[license-url]: https://github.com/chocoearly44/ZapIt/blob/master/LICENSE
[wiki-url]: https://github.com/chocoearly44/ZapIt/wiki
[releases-url]: https://github.com/chocoearly44/ZapIt/releases
[discussions-url]: https://github.com/chocoearly44/ZapIt/discussions
Binary file added assets/linux/zapit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
127 changes: 127 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>tk.thesuperlab</groupId>
<artifactId>zapit</artifactId>
<version>1.0</version>
<name>ZapIt</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<!-- Custom -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>1.2.5</version>
</dependency>

<dependency>
<groupId>org.jfxtras</groupId>
<artifactId>jmetro</artifactId>
<version>11.6.15</version>
</dependency>

<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>11.1.1</version>
</dependency>

<!-- JavaFX -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17.0.0.1</version>
</dependency>

<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>17.0.0.1</version>
</dependency>

<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17.0.0.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>

<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<mainClass>tk.thesuperlab.zapit/tk.thesuperlab.zapit.Launcher</mainClass>
<launcher>app</launcher>
<jlinkZipName>app</jlinkZipName>
<jlinkImageName>app</jlinkImageName>
<noManPages>true</noManPages>
<stripDebug>true</stripDebug>
<noHeaderFiles>true</noHeaderFiles>
<executable>${java.home}/bin/java</executable>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.6.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<mainClass>tk.thesuperlab.zapit.Launcher</mainClass>

<displayName>ZapIt</displayName>
<name>zapit</name>
<envPath>zapit</envPath>
<description>An advanced MQTT client made for the modern age.</description>
<url>https://github.com/chocoearly44/ZapIt</url>

<organizationName>chocoearly44</organizationName>
<organizationUrl>https://thesuperlab.tk</organizationUrl>
<organizationEmail>chocoearly44@gmail.com</organizationEmail>

<jrePath>${java.home}</jrePath>
<bundleJre>true</bundleJre>
<copyDependencies>true</copyDependencies>

<linuxConfig>
<generateDeb>true</generateDeb>
<generateRpm>true</generateRpm>
<wrapJar>true</wrapJar>
</linuxConfig>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
3 changes: 3 additions & 0 deletions src/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: tk.thesuperlab.zapit.Launcher

17 changes: 17 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module tk.thesuperlab.zapit {
requires javafx.controls;
requires javafx.fxml;
requires org.controlsfx.controls;
requires org.jfxtras.styles.jmetro;
requires org.eclipse.paho.client.mqttv3;
requires java.desktop;
requires java.sql;

opens tk.thesuperlab.zapit to javafx.fxml;
opens tk.thesuperlab.zapit.popups to javafx.fxml;
opens tk.thesuperlab.zapit.entities to javafx.base;

exports tk.thesuperlab.zapit;
exports tk.thesuperlab.zapit.entities;
exports tk.thesuperlab.zapit.utils;
}
7 changes: 7 additions & 0 deletions src/main/java/tk/thesuperlab/zapit/Launcher.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package tk.thesuperlab.zapit;

public class Launcher {
public static void main(String[] args) {
ZapitApplication.main(args);
}
}
76 changes: 76 additions & 0 deletions src/main/java/tk/thesuperlab/zapit/ZapitApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package tk.thesuperlab.zapit;

import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import jfxtras.styles.jmetro.JMetro;
import jfxtras.styles.jmetro.Style;
import tk.thesuperlab.zapit.entities.Workspace;
import tk.thesuperlab.zapit.utils.StorageUtils;
import tk.thesuperlab.zapit.utils.filesystem.UnixStorage;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class ZapitApplication extends Application {
public static StorageUtils storageUtils;
public static Workspace workspace;

private Stage stage;

@Override
public void start(Stage stage) throws IOException {
// Initialise filesystem
switch(System.getProperty("os.name").toLowerCase()) {
case "windows":
//TODO: Windows support
break;
case "linux":
storageUtils = new UnixStorage();
break;
}

storageUtils.initialise();

// Read default workspace
File defaultWorkspace = storageUtils.createDefaultWorkspace();

try {
FileInputStream fis = new FileInputStream(defaultWorkspace);
ObjectInputStream ois = new ObjectInputStream(fis);
workspace = (Workspace) ois.readObject();
} catch(IOException | ClassNotFoundException e) {
e.printStackTrace();
}

// Setup JavaFX
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("zapit-view.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 1280, 720);
stage.setTitle("ZapIt");
stage.getIcons().add(new Image(ZapitController.class.getResourceAsStream("icon.png")));
stage.setScene(scene);

JMetro jMetro = new JMetro(Style.DARK);
jMetro.setScene(scene);

ZapitController controller = fxmlLoader.getController();
stage.show();

stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
controller.stopMqtt();
}
});
}

public static void main(String[] args) {
launch();
}
}
Loading

0 comments on commit 1857626

Please sign in to comment.