reformat code, resolve compiler warnings
This commit is contained in:
@@ -47,6 +47,7 @@ import org.fife.ui.rtextarea.RTextScrollPane;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class MainWindow extends JFrame {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MainWindow.class);
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import jadx.gui.utils.Utils;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
|
||||
public class JClass extends DefaultMutableTreeNode implements JNode {
|
||||
public class JClass extends JNode {
|
||||
private static final long serialVersionUID = -1239986875244097177L;
|
||||
|
||||
private static final ImageIcon ICON_CLASS = Utils.openIcon("class_obj");
|
||||
private static final ImageIcon ICON_CLASS_DEFAULT = Utils.openIcon("class_default_obj");
|
||||
@@ -49,7 +49,7 @@ public class JClass extends DefaultMutableTreeNode implements JNode {
|
||||
}
|
||||
}
|
||||
|
||||
public String getCode(){
|
||||
public String getCode() {
|
||||
return cls.getCode();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,10 @@ import jadx.gui.utils.Utils;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
|
||||
public class JField extends DefaultMutableTreeNode implements JNode {
|
||||
public class JField extends JNode {
|
||||
private static final long serialVersionUID = 1712572192106793359L;
|
||||
|
||||
private static final ImageIcon ICON_FLD_DEF = Utils.openIcon("field_default_obj");
|
||||
private static final ImageIcon ICON_FLD_PRI = Utils.openIcon("field_private_obj");
|
||||
private static final ImageIcon ICON_FLD_PRO = Utils.openIcon("field_protected_obj");
|
||||
|
||||
@@ -8,10 +8,11 @@ import jadx.gui.utils.Utils;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class JMethod extends DefaultMutableTreeNode implements JNode {
|
||||
public class JMethod extends JNode {
|
||||
private static final long serialVersionUID = 3834526867464663751L;
|
||||
|
||||
private static final ImageIcon ICON_MTH_DEF = Utils.openIcon("methdef_obj");
|
||||
private static final ImageIcon ICON_MTH_PRI = Utils.openIcon("methpri_obj");
|
||||
private static final ImageIcon ICON_MTH_PRO = Utils.openIcon("methpro_obj");
|
||||
@@ -46,7 +47,7 @@ public class JMethod extends DefaultMutableTreeNode implements JNode {
|
||||
public Icon getIcon() {
|
||||
AccessInfo accessFlags = mth.getAccessFlags();
|
||||
OverlayIcon icon = Utils.makeIcon(accessFlags, ICON_MTH_PUB, ICON_MTH_PRI, ICON_MTH_PRO, ICON_MTH_DEF);
|
||||
if(accessFlags.isConstructor()) icon.add(ICON_CONSTRUCTOR);
|
||||
if (accessFlags.isConstructor()) icon.add(ICON_CONSTRUCTOR);
|
||||
if (accessFlags.isSynchronized()) icon.add(ICON_SYNC);
|
||||
return icon;
|
||||
}
|
||||
@@ -62,7 +63,7 @@ public class JMethod extends DefaultMutableTreeNode implements JNode {
|
||||
base.append('(');
|
||||
for (Iterator<ArgType> it = mth.getArguments().iterator(); it.hasNext(); ) {
|
||||
base.append(Utils.typeStr(it.next()));
|
||||
if(it.hasNext())
|
||||
if (it.hasNext())
|
||||
base.append(", ");
|
||||
}
|
||||
base.append(')');
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package jadx.gui.treemodel;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
|
||||
public interface JNode {
|
||||
public abstract class JNode extends DefaultMutableTreeNode {
|
||||
|
||||
JClass getJParent();
|
||||
public abstract JClass getJParent();
|
||||
|
||||
int getLine();
|
||||
public abstract int getLine();
|
||||
|
||||
void updateChilds();
|
||||
public abstract void updateChilds();
|
||||
|
||||
Icon getIcon();
|
||||
public abstract Icon getIcon();
|
||||
}
|
||||
|
||||
@@ -6,11 +6,12 @@ import jadx.gui.utils.Utils;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class JPackage extends DefaultMutableTreeNode implements JNode, Comparable<JPackage> {
|
||||
public class JPackage extends JNode implements Comparable<JPackage> {
|
||||
private static final long serialVersionUID = -4120718634156839804L;
|
||||
|
||||
private static final ImageIcon PACKAGE_ICON = Utils.openIcon("package_obj");
|
||||
|
||||
private String name;
|
||||
@@ -81,6 +82,20 @@ public class JPackage extends DefaultMutableTreeNode implements JNode, Comparabl
|
||||
return name.compareTo(o.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
JPackage jPackage = (JPackage) o;
|
||||
if (!name.equals(jPackage.name)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return name.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
|
||||
@@ -6,7 +6,6 @@ import jadx.gui.utils.Utils;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -17,7 +16,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class JRoot extends DefaultMutableTreeNode implements JNode {
|
||||
public class JRoot extends JNode {
|
||||
private static final long serialVersionUID = 8888495789773527342L;
|
||||
|
||||
private static final ImageIcon ROOT_ICON = Utils.openIcon("java_model_obj");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user