Skip to content

Commit ecafc23

Browse files
committed
Move around GUI classes
1 parent c96d5ce commit ecafc23

18 files changed

+181
-148
lines changed

src/main/java/the/bytecode/club/jda/JDA.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import the.bytecode.club.jda.api.ExceptionUI;
99
import the.bytecode.club.jda.api.Plugin;
1010
import the.bytecode.club.jda.api.PluginLoader;
11-
import the.bytecode.club.jda.gui.FileNavigationPane;
1211
import the.bytecode.club.jda.gui.MainViewerGUI;
12+
import the.bytecode.club.jda.gui.navigation.FileNavigationPane;
1313
import the.bytecode.club.jda.settings.Settings;
1414

1515
import javax.swing.*;
@@ -152,7 +152,7 @@ private static void onExit() {
152152
* @return the currently opened ClassNode
153153
*/
154154
public static ClassNode getCurrentlyOpenedClassNode() {
155-
return viewer.workPane.getCurrentViewer().cn;
155+
return viewer.FileViewerPane.getCurrentViewer().cn;
156156
}
157157

158158
public static FileContainer findContainer(String containerName, String fileName) {
@@ -702,8 +702,8 @@ public void run() {
702702
};
703703
t.start();
704704
} else if ((e.getKeyCode() == KeyEvent.VK_W) && isCtrlDown(e)) {
705-
if (viewer.workPane.getCurrentViewer() != null)
706-
viewer.workPane.tabs.remove(viewer.workPane.getCurrentViewer());
705+
if (viewer.FileViewerPane.getCurrentViewer() != null)
706+
viewer.FileViewerPane.tabs.remove(viewer.FileViewerPane.getCurrentViewer());
707707
}
708708
}
709709
}

src/main/java/the/bytecode/club/jda/gui/MainViewerGUI.java

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
import the.bytecode.club.jda.api.ExceptionUI;
66
import the.bytecode.club.jda.decompilers.Decompiler;
77
import the.bytecode.club.jda.decompilers.Decompilers;
8+
import the.bytecode.club.jda.gui.dialogs.AboutWindow;
9+
import the.bytecode.club.jda.gui.dialogs.FontOptionsDialog;
10+
import the.bytecode.club.jda.gui.dialogs.IntroWindow;
11+
import the.bytecode.club.jda.gui.dialogs.TabbedPane;
12+
import the.bytecode.club.jda.gui.fileviewer.FileViewerPane;
13+
import the.bytecode.club.jda.gui.fileviewer.Viewer;
14+
import the.bytecode.club.jda.gui.navigation.FileNavigationPane;
815
import the.bytecode.club.jda.settings.DecompilerSettings;
916
import the.bytecode.club.jda.settings.IPersistentWindow;
1017
import the.bytecode.club.jda.settings.Settings;
@@ -44,15 +51,15 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier, IPersis
4451

4552
public JDesktopPane desktop;
4653
public FileNavigationPane navigator;
47-
public WorkPane workPane;
54+
public FileViewerPane FileViewerPane;
4855
public static ArrayList<JDAWindow> windows = new ArrayList<>();
4956
private final ActionListener listener = new ActionListener() {
5057
@Override
5158
public void actionPerformed(ActionEvent arg0) {
5259
if (Settings.REFRESH_ON_VIEW_CHANGE.getBool()) {
53-
if (workPane.getCurrentViewer() == null)
60+
if (FileViewerPane.getCurrentViewer() == null)
5461
return;
55-
workPane.refreshClass.doClick();
62+
FileViewerPane.refreshClass.doClick();
5663
}
5764
}
5865
};
@@ -281,15 +288,15 @@ private void initializeMenubar() {
281288

282289
mnShowContainer.setSelected(Settings.SHOW_CONTAINER_NAME.getBool());
283290
mnShowContainer.addItemListener(e -> {
284-
JTabbedPane tabs = workPane.tabs;
291+
JTabbedPane tabs = FileViewerPane.tabs;
285292
Component[] components = tabs.getComponents();
286293
for (int i = 0; i < components.length; i++) {
287294
Component c = components[i];
288295
if (c instanceof Viewer) {
289296
((Viewer) c).updateName();
290297
int idx = tabs.indexOfComponent(c);
291298
tabs.setTabComponentAt(idx, new TabbedPane(c.getName(), tabs));
292-
workPane.tabs.setTitleAt(idx, c.getName());
299+
FileViewerPane.tabs.setTitleAt(idx, c.getName());
293300
}
294301
}
295302
Settings.SHOW_CONTAINER_NAME.set(mnShowContainer.isSelected());
@@ -310,17 +317,17 @@ public static <T> T getComponent(final Class<T> clazz) {
310317

311318
private void initializeWindows() {
312319
navigator = new FileNavigationPane(this);
313-
workPane = new WorkPane(this);
320+
FileViewerPane = new FileViewerPane(this);
314321

315322
desktop = new JDesktopPane();
316323
setContentPane(desktop);
317324
desktop.add(navigator);
318-
desktop.add(workPane);
325+
desktop.add(FileViewerPane);
319326
desktop.setDesktopManager(new WorkspaceDesktopManager());
320327
desktop.setBackground(COLOR_DESKTOP_BACKGROUND);
321328

322329
windows.add(navigator);
323-
windows.add(workPane);
330+
windows.add(FileViewerPane);
324331
}
325332

326333
public void resetWindows() {
@@ -400,7 +407,7 @@ private JMenu generatePane(int id) {
400407

401408
public void closeResources() {
402409
navigator.resetWorkspace();
403-
workPane.resetWorkspace();
410+
FileViewerPane.resetWorkspace();
404411
}
405412

406413
public void setIcon(final boolean busy) {
@@ -435,7 +442,7 @@ public void openFile(final String name, String container, byte[] content) {
435442
}
436443

437444
public void refreshView() {
438-
workPane.refreshClass.doClick();
445+
FileViewerPane.refreshClass.doClick();
439446
}
440447

441448
public void reloadResources() {
@@ -525,7 +532,7 @@ private void saveAsRunnableJar() {
525532
}
526533

527534
private void decompileSaveOpenedClasses() {
528-
if (workPane.getCurrentViewer() == null) {
535+
if (FileViewerPane.getCurrentViewer() == null) {
529536
JDA.showMessage("First open a class, jar, or zip file.");
530537
return;
531538
}

src/main/java/the/bytecode/club/jda/gui/PaneUpdaterThread.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import the.bytecode.club.jda.JDA;
77
import the.bytecode.club.jda.api.ExceptionUI;
88
import the.bytecode.club.jda.decompilers.Decompiler;
9+
import the.bytecode.club.jda.gui.fileviewer.ClassViewer;
910
import the.bytecode.club.jda.settings.Settings;
1011

1112
import javax.swing.*;

src/main/java/the/bytecode/club/jda/gui/AboutWindow.java renamed to src/main/java/the/bytecode/club/jda/gui/dialogs/AboutWindow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package the.bytecode.club.jda.gui;
1+
package the.bytecode.club.jda.gui.dialogs;
22

33
import org.apache.commons.io.IOUtils;
44
import the.bytecode.club.jda.JDA;

src/main/java/the/bytecode/club/jda/gui/ExportJar.java renamed to src/main/java/the/bytecode/club/jda/gui/dialogs/ExportJar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package the.bytecode.club.jda.gui;
1+
package the.bytecode.club.jda.gui.dialogs;
22

33
import the.bytecode.club.jda.JDA;
44
import the.bytecode.club.jda.JarUtils;

src/main/java/the/bytecode/club/jda/gui/FileChooser.java renamed to src/main/java/the/bytecode/club/jda/gui/dialogs/FileChooser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package the.bytecode.club.jda.gui;
1+
package the.bytecode.club.jda.gui.dialogs;
22

33
import the.bytecode.club.jda.JDA;
44
import the.bytecode.club.jda.api.ExceptionUI;

src/main/java/the/bytecode/club/jda/gui/FontOptionsDialog.java renamed to src/main/java/the/bytecode/club/jda/gui/dialogs/FontOptionsDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package the.bytecode.club.jda.gui;
1+
package the.bytecode.club.jda.gui.dialogs;
22

33
import net.miginfocom.swing.MigLayout;
44
import the.bytecode.club.jda.settings.Settings;

src/main/java/the/bytecode/club/jda/gui/IntroWindow.java renamed to src/main/java/the/bytecode/club/jda/gui/dialogs/IntroWindow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package the.bytecode.club.jda.gui;
1+
package the.bytecode.club.jda.gui.dialogs;
22

33
import org.apache.commons.io.IOUtils;
44
import the.bytecode.club.jda.Resources;

src/main/java/the/bytecode/club/jda/gui/SystemErrConsole.java renamed to src/main/java/the/bytecode/club/jda/gui/dialogs/SystemErrConsole.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
package the.bytecode.club.jda.gui;
1+
package the.bytecode.club.jda.gui.dialogs;
22

33
import the.bytecode.club.jda.JDA;
44
import the.bytecode.club.jda.Resources;
5+
import the.bytecode.club.jda.gui.fileviewer.SearchPanel;
56

67
import javax.swing.*;
78
import java.awt.*;

src/main/java/the/bytecode/club/jda/gui/TabbedPane.java renamed to src/main/java/the/bytecode/club/jda/gui/dialogs/TabbedPane.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package the.bytecode.club.jda.gui;
1+
package the.bytecode.club.jda.gui.dialogs;
22

33
import javax.swing.*;
44
import javax.swing.plaf.basic.BasicButtonUI;

0 commit comments

Comments
 (0)