Refactoring Style Test

This commit is contained in:
Konloch 2024-08-21 10:40:16 -06:00
parent b5c87e4eef
commit 8875f96b97

AI 샘플 코드 생성 중입니다

Loading...

View File

@ -1,19 +1,5 @@
package the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Point;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.HierarchyEvent;
import java.awt.event.HierarchyListener;
import java.util.Arrays;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JSplitPane;
import javax.swing.JViewport;
import javax.swing.SwingUtilities;
import javax.swing.text.BadLocationException;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.Configuration;
@ -25,6 +11,16 @@ import the.bytecode.club.bytecodeviewer.resources.Resource;
import the.bytecode.club.bytecodeviewer.resources.ResourceContainer;
import the.bytecode.club.bytecodeviewer.util.MethodParser;
import javax.swing.*;
import javax.swing.text.BadLocationException;
import java.awt.*;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.HierarchyEvent;
import java.awt.event.HierarchyListener;
import java.util.Arrays;
import java.util.List;
import static the.bytecode.club.bytecodeviewer.util.MethodParser.Method;
/***************************************************************************
@ -73,9 +69,11 @@ public class ClassViewer extends ResourceViewer
this.sp2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sp, bytecodeViewPanel3);
this.add(sp2, BorderLayout.CENTER);
this.addComponentListener(new ComponentAdapter() {
this.addComponentListener(new ComponentAdapter()
{
@Override
public void componentResized(ComponentEvent e) {
public void componentResized(ComponentEvent e)
{
resetDivider();
}
});
@ -118,9 +116,12 @@ public class ClassViewer extends ResourceViewer
while (Configuration.currentlyDumping)
{
//wait until it's not dumping
try {
try
{
Thread.sleep(100);
} catch (InterruptedException e) {
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
@ -142,12 +143,9 @@ public class ClassViewer extends ResourceViewer
return;
Configuration.warnForEditing = true;
if (!BytecodeViewer.viewer.autoCompileOnRefresh.isSelected()
&& !BytecodeViewer.viewer.compileOnSave.isSelected())
if (!BytecodeViewer.viewer.autoCompileOnRefresh.isSelected() && !BytecodeViewer.viewer.compileOnSave.isSelected())
{
BytecodeViewer.showMessage("Make sure to compile (File>Compile or Ctrl + T) whenever you want to "
+ "test or export your changes.\nYou can set compile automatically on refresh or on save "
+ "in the settings menu.");
BytecodeViewer.showMessage("Make sure to compile (File>Compile or Ctrl + T) whenever you want to " + "test or export your changes.\nYou can set compile automatically on refresh or on save " + "in the settings menu.");
SettingsSerializer.saveSettingsAsync();
}
@ -261,9 +259,13 @@ public class ClassViewer extends ResourceViewer
public static void setCaretLine(RSyntaxTextArea area, int line)
{
try {
try
{
area.setCaretPosition(area.getLineStartOffset(line));
} catch (BadLocationException ignored) { }
}
catch (BadLocationException ignored)
{
}
}
public void resetDivider()
@ -288,8 +290,8 @@ public class ClassViewer extends ResourceViewer
{
sp2.setResizeWeight(0.7);
setDividerLocation(sp2, 0.7);
if ((bytecodeViewPanel2.decompiler == Decompiler.NONE && bytecodeViewPanel1.decompiler != Decompiler.NONE)
|| (bytecodeViewPanel1.decompiler == Decompiler.NONE && bytecodeViewPanel2.decompiler != Decompiler.NONE)) {
if ((bytecodeViewPanel2.decompiler == Decompiler.NONE && bytecodeViewPanel1.decompiler != Decompiler.NONE) || (bytecodeViewPanel1.decompiler == Decompiler.NONE && bytecodeViewPanel2.decompiler != Decompiler.NONE))
{
setDividerLocation(sp2, 0.5);
}
else if (bytecodeViewPanel1.decompiler == Decompiler.NONE)