Skip to content

Commit

Permalink
Update mockito-inline from 4.8.1 to 4.10.0
Browse files Browse the repository at this point in the history
Update JavaDoc
Update to Java 18
  • Loading branch information
Valkryst committed Dec 22, 2022
1 parent 830f82d commit 629de98
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .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: 15
java-version: 18
java-package: jdk
architecture: x64

Expand Down
8 changes: 4 additions & 4 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Add VTerminal as a dependency.

```
dependencies {
implementation 'com.github.Valkryst:VTerminal:2021.03.04'
implementation 'com.github.Valkryst:VTerminal:2022.12.22'
}
```

Expand All @@ -64,7 +64,7 @@ Add VTerminal as a dependency.
<dependency>
<groupId>com.github.Valkryst</groupId>
<artifactId>VTerminal</artifactId>
<version>2021.03.04</version>
<version>2022.12.22</version>
</dependency>
```

Expand All @@ -79,7 +79,7 @@ resolvers += "jitpack" at "https://jitpack.io"
Add VTerminal as a dependency.

```
libraryDependencies += "com.github.Valkryst" % "VTerminal" % "2021.03.04"
libraryDependencies += "com.github.Valkryst" % "VTerminal" % "2022.12.22"
```

## Media
Expand All @@ -104,7 +104,7 @@ libraryDependencies += "com.github.Valkryst" % "VTerminal" % "2021.03.04"
### Videos

* [Click-through of the example GUI](https://youtu.be/dH1yRMyEL0s) used for
testing VTerminal. This covers most, if not all of the supported components.
testing VTerminal. This covers most, if not all the supported components.

## Supported Components

Expand Down
2 changes: 1 addition & 1 deletion jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
before_install:
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
- source install-jdk.sh --feature 15
- source install-jdk.sh --feature 18
- jshell --version
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

<groupId>com.github.Valkryst</groupId>
<artifactId>VTerminal</artifactId>
<version>2021.03.04</version>
<version>2022.12.22</version>
<packaging>jar</packaging>
<name>VTerminal</name>

<properties>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
<maven.compiler.release>15</maven.compiler.release>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
<maven.compiler.release>18</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
Expand Down Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>4.8.1</version>
<version>4.10.0</version>
<scope>test</scope>
</dependency>
<dependency> <!-- In-Memory File System -->
Expand Down
44 changes: 22 additions & 22 deletions src/example/gui/view/EditorPaneView.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ public EditorPaneView() {
component.setContentType("text/html");
component.setEditable(true);
component.setText("""
<html>
<head>
<style type="text/css">
i {
color: red;
<html>
<head>
<style type="text/css">
i {
color: red;
}
</style>
</head>
<body>
<p>This <i>VEditorPane</i> is editable and <b>enabled</b>.</p>
</body>
</html>
</style>
</head>
<body>
<p>This <i>VEditorPane</i> is editable and <b>enabled</b>.</p>
</body>
</html>
""");
this.add(component, BorderLayout.NORTH);

Expand All @@ -33,18 +33,18 @@ public EditorPaneView() {
component.setEditable(true);
component.setEnabled(false);
component.setText("""
<html>
<head>
<style type="text/css">
i {
color: red;
<html>
<head>
<style type="text/css">
i {
color: red;
}
</style>
</head>
<body>
<p>This <i>VEditorPane</i> is editable and <b>disabled</b>.</p>
</body>
</html>
</style>
</head>
<body>
<p>This <i>VEditorPane</i> is editable and <b>disabled</b>.</p>
</body>
</html>
""");
this.add(component, BorderLayout.SOUTH);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/valkryst/VTerminal/component/VPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void paintComponent(final Graphics graphics) {
* operations.
*
* The clip bounds, of the graphics object, represent a region of the
* panel that must be repainted. Rather than repainting all of the tiles
* panel that must be repainted. Rather than repainting all the tiles
* on every paint, it is performant to redraw only those tiles that
* will appear within the bounds.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/valkryst/VTerminal/font/VFont.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public Image generateImage(final int codePoint, final @NonNull Color color, fina
* most likely increase performance.
*
* Doing this will also cause graphical issues when dragging a J/VFrame
* between monitors. All of the tiles will render as black rectangles
* between monitors. All the tiles will render as black rectangles
* because the VolatileImages are generated to be displayed on the
* GraphicsDevice that the frame is initially displayed on.
*
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/com/valkryst/VTerminal/image/SequentialOp.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.awt.image.ColorModel;
import java.awt.image.ImagingOpException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
Expand All @@ -27,11 +28,7 @@ public class SequentialOp implements BufferedImageOp {
* @param ops One or more operations to add to the sequence.
*/
public SequentialOp(final @NonNull BufferedImageOp ... ops) {
for (final var op : ops) {
if (op != null) {
bufferedImageOps.add(op);
}
}
bufferedImageOps.addAll(Arrays.asList(ops));

filteredImageCache = Caffeine.newBuilder()
.initialCapacity(0)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/valkryst/VTerminal/palette/VColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ public VColor(final float red, final float green, final float blue, final float
* @param alpha The alpha component.
* @throws IllegalArgumentException
* If any of the {@code components}, including the {@code alpha}
* component, are outside of the range 0.0 to 1.0.
* component, are outside the range 0.0 to 1.0.
*/
public VColor(final @NonNull ColorSpace colorSpace, final @NonNull float[] components, final float alpha) {
public VColor(final @NonNull ColorSpace colorSpace, final float[] components, final float alpha) {
super(colorSpace, components, alpha);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void paint(final Graphics graphics) {
paintTriangle(graphics, (width - size) / 2, (height - size) / 2,
size, direction, super.isEnabled());

// Reset the Graphics back to it's original settings
// Reset the Graphics back to its original settings
if (isPressed) {
graphics.translate(-1, -1);
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/valkryst/VTerminal/plaf/VPanelUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ public Dimension getMinimumSize(final JComponent component) {

@Override
public Dimension getPreferredSize(final JComponent component) {
if (component instanceof VPanel) {
if (component instanceof final VPanel panel) {
final var laf = VTerminalLookAndFeel.getInstance();
final var panel = (VPanel) component;
final var height = laf.getTileHeight() * panel.getHeightInTiles();
final var width = laf.getTileWidth() * panel.getWidthInTiles();
return new Dimension(width, height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Objects;

public class VTerminalLookAndFeel extends BasicLookAndFeel {
/** The singleton instance. */
Expand Down Expand Up @@ -165,13 +166,15 @@ public static VTerminalLookAndFeel getInstance(final int pointSize) {
*/
public static VTerminalLookAndFeel getInstance(final @NonNull InputStream fontInputStream, int pointSize) throws IOException, FontFormatException {
if (instance != null) {
if (fontInputStream != null) {
System.err.println("The VTerminalLookAndFeel has already been initialized with a font. The specified font will not be applied.");
}
System.err.println("The VTerminalLookAndFeel has already been initialized with a font. The specified font will not be applied.");
return instance;
} else {
try {
Palette.loadAndRegisterProperties(VTerminalLookAndFeel.class.getResourceAsStream("/Palettes/Dracula.properties"));
Palette.loadAndRegisterProperties(
Objects.requireNonNull(
VTerminalLookAndFeel.class.getResourceAsStream("/Palettes/Dracula.properties")
)
);
} catch (final IOException ignored) {}
}

Expand Down Expand Up @@ -240,9 +243,7 @@ public static Graphics2D setRenderingHints(final @NonNull Graphics graphics) {
* @param component A component.
*/
public void setComponentFont(final @NonNull JComponent component) {
if (component != null) {
component.setFont(vFont.getFont());
}
component.setFont(vFont.getFont());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void canClampHeightToHigherMultipleWhenClampingDistancesAreEqual() {
* The dimension object will internally alter the width/height given to
* it by calling Math.ceil. As we want to test the case where the lower
* and higher multiples are at equal distances from the given height,
* we need to mock the the object.
* we need to mock the object.
*/
final double height = tileHeight + (tileHeight / 2.0);
var dimension = Mockito.mock(Dimension.class);
Expand Down Expand Up @@ -158,7 +158,7 @@ public void canClampWidthToHigherMultipleWhenClampingDistancesAreEqual() {
* The dimension object will internally alter the width/height given to
* it by calling Math.ceil. As we want to test the case where the lower
* and higher multiples are at equal distances from the given height,
* we need to mock the the object.
* we need to mock the object.
*/
final double width = tileWidth + (tileWidth / 2.0);
var dimension = Mockito.mock(Dimension.class);
Expand Down

0 comments on commit 629de98

Please sign in to comment.