Skip to content

Commit

Permalink
Resource handling change
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Aug 4, 2017
1 parent f345e85 commit 948fdad
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/me/coley/recaf/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ public static void main(String[] args) {
Program program = new Program();
program.showGui();
// Quick testing
/*
try {
Thread.sleep(200);
program.openFile(new java.io.File("test.jar"));
program.selectClass(program.jarData.classes.get("me/coley/Program"));
} catch (Exception e) {
e.printStackTrace();
}
}*/
}
}
8 changes: 4 additions & 4 deletions src/me/coley/recaf/ui/Icons.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package me.coley.recaf.ui;

import java.awt.Toolkit;

import javax.swing.Icon;
import javax.swing.ImageIcon;

public class Icons {
private static final Toolkit kit = Toolkit.getDefaultToolkit();
// Class access
public static final Icon CL_CLASS;
public static final Icon CL_INTERFACE;
Expand All @@ -29,6 +26,7 @@ public class Icons {
public static final Icon MOD_SYNTHETIC;
public static final Icon MOD_NATIVE;
public static final Icon MOD_ABSTRACT;
public static final Icon MOD_FINAL;
// Misc
public static final Icon MISC_PACKAGE;
public static final Icon MISC_RESULT;
Expand Down Expand Up @@ -56,6 +54,7 @@ public class Icons {
MOD_SYNTHETIC = load("synthetic.png");
MOD_NATIVE = load("native.png");
MOD_ABSTRACT = load("abstract.png");
MOD_FINAL = load("final.png");
//
MISC_PACKAGE = load("package.png");
MISC_RESULT = load("result.png");
Expand All @@ -65,6 +64,7 @@ private static Icon load(String url) {
// TODO: Why does File.separator force non-relative path names but this
// works fine?
String prefix = "/resources/";
return new ImageIcon(kit.getImage(Icons.class.getResource(prefix + url)));
String file = prefix + url;
return new ImageIcon(Icons.class.getResource(file));
}
}
3 changes: 3 additions & 0 deletions src/me/coley/recaf/ui/component/list/MemberNodeRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ private void addAccess(JPanel content, int access, boolean method, boolean selec
if (Access.isAbstract(access)) {
add(content, selected, MOD_ABSTRACT);
}
if (Access.isFinal(access)) {
add(content, selected, MOD_FINAL);
}
if (Access.isNative(access)) {
add(content, selected, MOD_NATIVE);
}
Expand Down
Binary file modified src/resources/abstract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/resources/field_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/resources/final.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file modified src/resources/native.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/resources/static.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/resources/synthetic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/resources/transient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/resources/volatile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 948fdad

Please # to comment.