Merge pull request #340 from ThexXTURBOXx/updates

Updates
This commit is contained in:
Konloch 2021-08-07 00:29:30 -07:00 committed by GitHub
commit bc19b3b716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 31 additions and 51 deletions

View file

@ -1 +0,0 @@
41d368cd63ae76bba69ccb6e967866fe

View file

@ -1 +0,0 @@
96f9c3d3bee336c4653abf42444c025b6dfd1836

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.weisj</groupId>
<artifactId>darklaf-bcv</artifactId>
<version>2.6.2bcv</version>
</project>

View file

@ -1 +0,0 @@
74478ea2fe1166fa888c71a79567301d

View file

@ -1 +0,0 @@
d30064114889fe65ffd7c6c27f295351dec57586

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>com.github.weisj</groupId>
<artifactId>darklaf-bcv</artifactId>
<versioning>
<release>2.6.2bcv</release>
<versions>
<version>2.6.2bcv</version>
</versions>
<lastUpdated>20210724002216</lastUpdated>
</versioning>
</metadata>

View file

@ -1 +0,0 @@
75dd4d459bc5baedf71904887dc0b60e

View file

@ -1 +0,0 @@
cc64fe02e94fab19ada3c4e39a6d984d5bf541b1

12
pom.xml
View file

@ -17,10 +17,6 @@
<id>local-maven-repo</id> <id>local-maven-repo</id>
<url>file:///${project.basedir}/libs</url> <url>file:///${project.basedir}/libs</url>
</repository> </repository>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository> <!-- TODO Remove when DarkLaf is properly updated -->
<repository> <repository>
<id>jitpack.io</id> <id>jitpack.io</id>
<url>https://jitpack.io</url> <url>https://jitpack.io</url>
@ -86,7 +82,7 @@
<dependency> <dependency>
<groupId>org.codehaus.janino</groupId> <groupId>org.codehaus.janino</groupId>
<artifactId>commons-compiler</artifactId> <artifactId>commons-compiler</artifactId>
<version>3.1.4</version> <version>3.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
@ -131,7 +127,7 @@
<dependency> <dependency>
<groupId>org.codehaus.janino</groupId> <groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId> <artifactId>janino</artifactId>
<version>3.1.4</version> <version>3.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.jd</groupId> <groupId>com.jd</groupId>
@ -225,8 +221,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.weisj</groupId> <groupId>com.github.weisj</groupId>
<artifactId>darklaf-bcv</artifactId> <artifactId>darklaf-core</artifactId>
<version>2.6.2bcv</version> <version>2.7.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.weisj</groupId> <groupId>com.github.weisj</groupId>

View file

@ -1,5 +1,7 @@
package the.bytecode.club.bytecodeviewer.gui.hexviewer; package the.bytecode.club.bytecodeviewer.gui.hexviewer;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -160,8 +162,11 @@ public class JHexEditor extends JPanel implements FocusListener, AdjustmentListe
fn.getHeight() + 1); fn.getHeight() + 1);
} }
protected void printString(Graphics g, String s, int x, int y) { protected void printString(Graphics graphics, String s, int x, int y) {
Graphics2D g = (Graphics2D) graphics;
FontMetrics fn = getFontMetrics(font); FontMetrics fn = getFontMetrics(font);
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.drawString(s, ((fn.stringWidth(" ") + 1) * x) + border, g.drawString(s, ((fn.stringWidth(" ") + 1) * x) + border,
((fn.getHeight() * (y + 1)) - fn.getMaxDescent()) + border); ((fn.getHeight() * (y + 1)) - fn.getMaxDescent()) + border);
} }

View file

@ -43,17 +43,20 @@ public class ResourceTree extends JTree
StringMetricsUtil m = null; StringMetricsUtil m = null;
@Override @Override
public void paint(final Graphics g) public void paint(final Graphics graphics)
{ {
try try
{ {
Graphics2D g = (Graphics2D) graphics;
super.paint(g); super.paint(g);
if (m == null) if (m == null)
{ {
m = new StringMetricsUtil((Graphics2D) g); m = new StringMetricsUtil(g);
} }
if (treeRoot.getChildCount() < 1) if (treeRoot.getChildCount() < 1)
{ {
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setColor(new Color(0, 0, 0, 100)); g.setColor(new Color(0, 0, 0, 100));
g.fillRect(0, 0, getWidth(), getHeight()); g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.white); g.setColor(Color.white);
@ -63,7 +66,7 @@ public class ResourceTree extends JTree
getHeight() / 2); getHeight() / 2);
} }
} }
catch (InternalError | NullPointerException ignored) catch (InternalError | NullPointerException | ClassCastException ignored)
{ {
} }
} }

View file

@ -73,16 +73,18 @@ public class ResourceContainerImporter
try try
{ {
//attempt to import using Java ZipInputStream //attempt to import using Java ZipInputStream
importZipInputStream(false); return importZipInputStream(false);
} }
catch (IOException e) catch (Throwable t)
{ {
e.printStackTrace(); try {
//fallback to apache commons ZipFile //fallback to apache commons ZipFile
importApacheZipFile(false); return importApacheZipFile(false);
} catch (Throwable t1) {
t1.addSuppressed(t);
throw t1;
}
} }
return this;
} }
/** /**
@ -93,9 +95,9 @@ public class ResourceContainerImporter
{ {
//TODO remove this .class check and just look for cafebabe //TODO remove this .class check and just look for cafebabe
if (name.endsWith(".class")) if (name.endsWith(".class"))
addClassResource(name, stream); return addClassResource(name, stream);
else if(!classesOnly) else if (!classesOnly)
addResource(name, stream); return addResource(name, stream);
return this; return this;
} }

View file

@ -444,10 +444,10 @@ public class FileDrop {
boolean support; boolean support;
try { try {
final Class arbitraryDndClass = Class final Class arbitraryDndClass = Class
.forName("DnDConstants"); .forName("java.awt.dnd.DnDConstants");
support = true; support = true;
} // end try } // end try
catch (final Exception e) { catch (final Throwable t) {
support = false; support = false;
} // end catch } // end catch
supportsDnD = support; supportsDnD = support;