Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #340

Merged
merged 8 commits into from
Aug 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions libs/com/github/weisj/darklaf-bcv/maven-metadata.xml

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/github/weisj/darklaf-bcv/maven-metadata.xml.md5

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/github/weisj/darklaf-bcv/maven-metadata.xml.sha1

This file was deleted.

12 changes: 4 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
<id>local-maven-repo</id>
<url>file:///${project.basedir}/libs</url>
</repository>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository> <!-- TODO Remove when DarkLaf is properly updated -->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
Expand Down Expand Up @@ -86,7 +82,7 @@
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>commons-compiler</artifactId>
<version>3.1.4</version>
<version>3.1.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -131,7 +127,7 @@
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
<version>3.1.4</version>
<version>3.1.6</version>
</dependency>
<dependency>
<groupId>com.jd</groupId>
Expand Down Expand Up @@ -225,8 +221,8 @@
</dependency>
<dependency>
<groupId>com.github.weisj</groupId>
<artifactId>darklaf-bcv</artifactId>
<version>2.6.2bcv</version>
<artifactId>darklaf-core</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>com.github.weisj</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package the.bytecode.club.bytecodeviewer.gui.hexviewer;

import java.awt.Graphics2D;
import java.awt.RenderingHints;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;

import java.awt.BorderLayout;
Expand Down Expand Up @@ -160,8 +162,11 @@ protected void border(Graphics g, int x, int y, int s) {
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);
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.drawString(s, ((fn.stringWidth(" ") + 1) * x) + border,
((fn.getHeight() * (y + 1)) - fn.getMaxDescent()) + border);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,20 @@ public ResourceTree(final DefaultMutableTreeNode treeRoot)
StringMetricsUtil m = null;

@Override
public void paint(final Graphics g)
public void paint(final Graphics graphics)
{
try
{
Graphics2D g = (Graphics2D) graphics;
super.paint(g);
if (m == null)
{
m = new StringMetricsUtil((Graphics2D) g);
m = new StringMetricsUtil(g);
}
if (treeRoot.getChildCount() < 1)
{
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setColor(new Color(0, 0, 0, 100));
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.white);
Expand All @@ -63,7 +66,7 @@ public void paint(final Graphics g)
getHeight() / 2);
}
}
catch (InternalError | NullPointerException ignored)
catch (InternalError | NullPointerException | ClassCastException ignored)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,18 @@ public ResourceContainerImporter importAsZip() throws IOException
try
{
//attempt to import using Java ZipInputStream
importZipInputStream(false);
return importZipInputStream(false);
}
catch (IOException e)
catch (Throwable t)
{
e.printStackTrace();

//fallback to apache commons ZipFile
importApacheZipFile(false);
try {
//fallback to apache commons ZipFile
return importApacheZipFile(false);
} catch (Throwable t1) {
t1.addSuppressed(t);
throw t1;
}
}
return this;
}

/**
Expand All @@ -93,10 +95,10 @@ public ResourceContainerImporter addUnknownFile(String name, InputStream stream,
{
//TODO remove this .class check and just look for cafebabe
if (name.endsWith(".class"))
addClassResource(name, stream);
else if(!classesOnly)
addResource(name, stream);
return addClassResource(name, stream);
else if (!classesOnly)
return addResource(name, stream);

return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,10 @@ private static boolean supportsDnD() { // Static Boolean
boolean support;
try {
final Class arbitraryDndClass = Class
.forName("DnDConstants");
.forName("java.awt.dnd.DnDConstants");
support = true;
} // end try
catch (final Exception e) {
catch (final Throwable t) {
support = false;
} // end catch
supportsDnD = support;
Expand Down