Skip to content

Commit

Permalink
Move debug gui package
Browse files Browse the repository at this point in the history
Accept network.rs485.debug.gui
  • Loading branch information
bziemons committed May 4, 2021
1 parent 6398ab0 commit 7db9c4b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class DebugGuiController {
static {
Launch.classLoader.addTransformerExclusion("com.trolltech.qt.");
Launch.classLoader.addTransformerExclusion("network.rs485.debuggui.");
Launch.classLoader.addTransformerExclusion("network.rs485.debug.");
}

transient private static DebugGuiController instance;
Expand All @@ -53,11 +54,11 @@ public void execServer() {
serverDebugger.values().forEach(IDebugGuiEntry::exec);
}

private HashMap<EntityPlayer, IDebugGuiEntry> serverDebugger = new HashMap<>();
private List<IDataConnection> serverList = new LinkedList<>();
private final HashMap<EntityPlayer, IDebugGuiEntry> serverDebugger = new HashMap<>();
private final List<IDataConnection> serverList = new LinkedList<>();

private IDebugGuiEntry clientController = null;
private List<Future<IDataConnection>> clientList = new LinkedList<>();
private final List<Future<IDataConnection>> clientList = new LinkedList<>();

public void startWatchingOf(Object object, EntityPlayer player) {
if (object == null) {
Expand All @@ -70,7 +71,6 @@ public void startWatchingOf(Object object, EntityPlayer player) {
serverDebugger.put(player, entry);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
e.printStackTrace();
return;
}
}
if (entry == null) {
Expand Down
15 changes: 10 additions & 5 deletions src/api/java/network/rs485/debug/api/IDebugGuiEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,19 @@

public abstract class IDebugGuiEntry {

public abstract IDataConnection startServerDebugging(Object object, IDataConnection outgoingData, IObjectIdentification objectIdent);
public static IDebugGuiEntry create()
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
try {
return (IDebugGuiEntry) Class.forName("network.rs485.debug.gui.DebugGuiEntry").newInstance();
} catch (ReflectiveOperationException ignored) {}
return (IDebugGuiEntry) Class.forName("network.rs485.debuggui.DebugGuiEntry").newInstance();
}

public abstract IDataConnection startServerDebugging(Object object, IDataConnection outgoingData,
IObjectIdentification objectIdent);

public abstract Future<IDataConnection> startClientDebugging(String name, IDataConnection outgoingData);

public abstract void exec();

public static IDebugGuiEntry create() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
return (IDebugGuiEntry) Class.forName("network.rs485.debuggui.DebugGuiEntry").newInstance();
}

}

0 comments on commit 7db9c4b

Please sign in to comment.