Skip to content

Commit

Permalink
Full rewrite (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkryst committed Feb 27, 2021
1 parent f98a284 commit 8ab49b5
Show file tree
Hide file tree
Showing 210 changed files with 5,149 additions and 43,939 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: Valkryst
github: Valkryst
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 15
java-package: jdk
architecture: x64

Expand All @@ -30,4 +30,4 @@ jobs:
- name: Build with Maven
env:
DISPLAY: :1
run: xvfb-run --server-args="-screen 0 1920x1080x24" mvn --batch-mode --update-snapshots verify --file pom.xml
run: xvfb-run --server-args="-screen 0 1920x1080x24" mvn --batch-mode --update-snapshots -Dmaven.javadoc.skip=true verify --file pom.xml
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
110 changes: 89 additions & 21 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
![Java CI with Maven](https://github.com/Valkryst/VTerminal/workflows/Java%20CI%20with%20Maven/badge.svg)
![Java CI with Maven](https://github.com/Valkryst/VTerminal/workflows/Java%20CI%20with%20Maven/badge.svg?branch=master)
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/Valkryst/VTerminal.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Valkryst/VTerminal/context:java)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/Valkryst/VTerminal.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Valkryst/VTerminal/alerts/)

This project is currently under a full rewrite. Support is still available for
the version that is currently on the `master` branch.

## Table of Contents

* [Links](https://github.com/Valkryst/VTerminal#links)
* [Importing the Library](https://github.com/Valkryst/VTerminal#importing-the-library)
* [Gradle](https://github.com/Valkryst/VTerminal#gradle)
* [Maven](https://github.com/Valkryst/VTerminal#maven)
* [Jar](https://github.com/Valkryst/VTerminal#jar)

* [Installation](https://github.com/Valkryst/VTerminal#installation)
* [Gradle](https://github.com/Valkryst/VTerminal#-gradle)
* [Maven](https://github.com/Valkryst/VTerminal#-maven)
* [sbt](https://github.com/Valkryst/VTerminal#-scala-sbt)
* [Supported Components](https://github.com/Valkryst/VTerminal#supported-components)
* [Enhanced Components](https://github.com/Valkryst/VTerminal#enhanced-components)
* [Credits & Inspiration](https://github.com/Valkryst/VTerminal#credits--inspiration)

## Links

* [Discord Channel](https://discord.gg/TwgPHSW)
* Documentation
* [Roguelike Development Tutorial with VTerminal](https://github.com/Valkryst/VTerminal_Tutorial/wiki)
* [JavaDoc Documentation](https://jitpack.io/com/github/Valkryst/VTerminal/latest/javadoc/)
* [Usage Guide](https://github.com/Valkryst/VTerminal/wiki)
* [JavaDoc Documentation](https://jitpack.io/com/github/Valkryst/VTerminal/latest/javadoc/)
* [Usage Guide](https://github.com/Valkryst/VTerminal/wiki)
* [Performance Tips](https://valkryst.com/posts/13)
* [Resolving Compatibility & Render Issues](https://valkryst.com/posts/10)


## Importing the Library
## Installation

VTerminal is hosted on the [JitPack package repository](https://jitpack.io/#Valkryst/VTerminal)
which supports both Gradle and Maven.
which supports Gradle, Maven, and sbt.

### Gradle
### ![Gradle](https://i.imgur.com/qtc6bXq.png?1) Gradle

Add JitPack to your `build.gradle` at the end of repositories.

Expand All @@ -45,11 +45,11 @@ Add VTerminal as a dependency.

```
dependencies {
implementation 'com.github.Valkryst:VTerminal:2020.12.28'
implementation 'com.github.Valkryst:VTerminal:2021.02.26-break'
}
```

### Maven
### ![Maven](https://i.imgur.com/2TZzobp.png?1) Maven

Add JitPack as a repository.

Expand All @@ -67,11 +67,79 @@ Add VTerminal as a dependency.
<dependency>
<groupId>com.github.Valkryst</groupId>
<artifactId>VTerminal</artifactId>
<version>2020.12.28</version>
<version>2021.02.26-break</version>
</dependency>
```

### Jar
### ![Scala SBT](https://i.imgur.com/Nqv3mVd.png?1) Scala SBT

Add JitPack as a resolver.

```
resolvers += "jitpack" at "https://jitpack.io"
```

Add VTerminal as a dependency.

```
libraryDependencies += "com.github.Valkryst" % "VTerminal" % "2021.02.26-break"
```

You can find the Jar file on the [releases](https://github.com/Valkryst/VTerminal/releases)
page. Please ensure to use the `jar-with-dependencies` Jar.
## Supported Components

If there is a component that you'd like VTerminal to support, or if you're
experiencing any issues with the supported components, then please feel free to
[open an issue](https://github.com/Valkryst/VTerminal/issues/new).

* [JButton](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JButton.html)
* [JCheckBox](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JCheckBox.html)
* [JEditorPane](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JEditorPane.html)
* [JLabel](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JLabel.html)
* [JPanel](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JPanel.html)
* [JPasswordField](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JPasswordField.html)
* [JProgressBar](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JProgressBar.html)
* [JRadioButton](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JRadioButton.html)
* [JScrollPane](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JScrollPane.html)
* [JTextArea](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JTextArea.html)
* [JTextField](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JTextField.html)
* [JTextPane](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JTextPane.html)
* [JToolTip](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/javax/swing/JToolTip.html)
* [VFrame](https://github.com/Valkryst/VTerminal/tree/master/src/main/java/com/valkryst/VTerminal/component/VFrame.java)
* A subclass of _JFrame_ which allows for easier en/disabling of full screen
mode and which has a number of convenience methods.
* [VPanel](https://github.com/Valkryst/VTerminal/tree/master/src/main/java/com/valkryst/VTerminal/component/VPanel.java)
* A subclass of _JPanel_ which allows for displaying a 2D grid of characters
in which each cell can display a unique fore/background color and
[code point](https://en.wikipedia.org/wiki/Code_point) (Unicode character).
## Enhanced Components

Unless otherwise specified, the following components have an overridden
`paintComponent` method which ensures the component is rendered at a higher
quality than its default counterpart.

The following image shows a `JEditorPane` and a `VEditorPane` side-by-side.

![](https://i.imgur.com/6XfbVar.png)

Unfortunately, I was unable to find a fool-proof way of ensuring that all
components render with high-quality [RenderingHints](https://docs.oracle.com/en/java/javase/15/docs/api/java.desktop/java/awt/RenderingHints.html).
If a method is ever discovered, then these classes _may_ be depreciated and/or
removed from this repository.

* [VEditorPane](https://github.com/Valkryst/VTerminal/tree/master/src/main/java/com/valkryst/VTerminal/component/VEditorPane.java)
* [VPasswordField](https://github.com/Valkryst/VTerminal/tree/master/src/main/java/com/valkryst/VTerminal/component/VPasswordField.java)
* [VTextArea](https://github.com/Valkryst/VTerminal/tree/master/src/main/java/com/valkryst/VTerminal/component/VTextArea.java)
* [VTextField](https://github.com/Valkryst/VTerminal/tree/master/src/main/java/com/valkryst/VTerminal/component/VTextField.java)
* [VTextPane](https://github.com/Valkryst/VTerminal/tree/master/src/main/java/com/valkryst/VTerminal/component/VTextPane.java)

## Credits & Inspiration

* Architecture
* Robert Eckstein's ["Java SE Application Design With MVC"](https://www.oracle.com/technical-resources/articles/javase/application-design-with-mvc.html).
* Juri Strumpflohner's ["Logical separation with MVC"](https://juristr.com/blog/2008/03/logical-separation-with-mvc/), a follow-up to Eckstein's article.
* [Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java™ Applications](https://www.amazon.ca/Filthy-Rich-Clients-Developing-Applications/dp/0132413930/)
* Trystan's [AsciiPanel](https://github.com/trystan/AsciiPanel).
* [VFont](https://github.com/Valkryst/VTerminal/tree/master/src/main/java/com/valkryst/VTerminal/font/VFont.java)
* The [FontGenerator](https://github.com/ZenDarva/AsylumRLE/blob/FpsRefactor/src/main/java/xyz/theasylum/zendarva/rle/FontGenerator.java) from ZenDarva's [AsylumRLE](https://github.com/ZenDarva/AsylumRLE).
* The [FontRenderer](https://github.com/sunenielsen/tribaltrouble/blob/master/tools/classes/com/oddlabs/fontutil/FontRenderer.java) from Oddlabs' [Tribal Trouble](https://github.com/sunenielsen/tribaltrouble).
106 changes: 45 additions & 61 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,25 @@

<groupId>com.github.Valkryst</groupId>
<artifactId>VTerminal</artifactId>
<version>2020.12.28</version>
<version>2021.02.26-break</version>
<packaging>jar</packaging>
<name>VTerminal</name>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
<maven.compiler.release>15</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
Expand All @@ -26,27 +33,10 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>

<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.8.1</version>
</dependency>

<dependency>
<groupId>com.jhlabs</groupId>
<artifactId>filters</artifactId>
<version>2.0.235-1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.8</version>
<version>2.8.8</version>
</dependency>

<!-- Testing -->
Expand All @@ -62,6 +52,30 @@
<version>5.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>3.7.7</version>
<scope>test</scope>
</dependency>
<dependency> <!-- In-Memory File System -->
<groupId>com.google.jimfs</groupId>
<artifactId>jimfs</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency> <!-- Data Generation -->
<groupId>com.github.javafaker</groupId>
<artifactId>javafaker</artifactId>
<version>1.0.2</version>
<scope>test</scope>
</dependency>
<dependency> <!-- BufferedImageOps for visually testing the VPanel -->
<groupId>com.jhlabs</groupId>
<artifactId>filters</artifactId>
<version>2.0.235-1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -73,53 +87,23 @@
<version>3.0.0-M5</version>
</plugin>

<!--- Generates JavaDoc files during build. -->
<!--- Generates JavaDoc files during build phase. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<!-- Solution to problem:
MavenReportException: Error while creating archive: Unable to find
javadoc command: The environment variable JAVA_HOME is not correctly set.
<!--
Solution to problem:
MavenReportException: Error while creating archive: Unable to
find javadoc command: The environment variable JAVA_HOME is not
correctly set.
Unable to find javadoc command - maven
Reference: https://stackoverflow.com/a/54323506 -->
Unable to find javadoc command - maven
Reference: https://stackoverflow.com/a/54323506
-->
<configuration>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Used to include all of the dependencies in the packaged Jar file -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<!-- Is important that the name specified in the project
name is the same in finalName tag, with it avoid the
error: Cannot include project artifact [...] it
doesn't have an associated file or directory. -->
<finalName>VTerminal</finalName>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 8ab49b5

Please sign in to comment.