mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 02:44:50 +00:00
Centered game selector window, small fixes.
This commit is contained in:
@@ -9,7 +9,9 @@ import org.toop.server.backend.ServerManager;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.toop.server.backend.tictactoe.TicTacToeServer;
|
||||
import org.toop.server.frontend.ConnectionManager;
|
||||
import org.toop.server.frontend.TcpClient;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
@@ -19,7 +21,10 @@ public class Main {
|
||||
|
||||
public static void main(String[] args) throws ExecutionException, InterruptedException {
|
||||
Logging.disableAllLogs();
|
||||
Logging.enableLogsForClass(ServerManager.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(ServerManager.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(TicTacToeServer.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(TcpClient.class, Level.ALL);
|
||||
// Logging.enableLogsForClass(ConnectionManager.class, Level.ALL);
|
||||
initSystems();
|
||||
registerEvents();
|
||||
|
||||
@@ -39,9 +44,6 @@ public class Main {
|
||||
Window.start("");
|
||||
*/
|
||||
|
||||
new Thread(() -> {
|
||||
GameSelectorWindow gameSelectorWindow = new GameSelectorWindow();
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.toop.UI.GameSelectorWindow">
|
||||
<grid id="27dc6" binding="mainMenu" layout-manager="GridLayoutManager" row-count="9" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="mainMenu" layout-manager="GridLayoutManager" row-count="10" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="10" bottom="10" right="10"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="500" height="400"/>
|
||||
<xy x="20" y="20" width="482" height="404"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<opaque value="true"/>
|
||||
@@ -13,7 +13,7 @@
|
||||
<children>
|
||||
<component id="ed019" class="javax.swing.JTextField" binding="nameTextField">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -23,12 +23,12 @@
|
||||
</component>
|
||||
<vspacer id="4e05c">
|
||||
<constraints>
|
||||
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="9" column="2" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="1d2f1" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Name:"/>
|
||||
@@ -36,7 +36,7 @@
|
||||
</component>
|
||||
<component id="70d8c" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Welcome to ISY games selector!"/>
|
||||
@@ -44,7 +44,7 @@
|
||||
</component>
|
||||
<component id="5cc82" class="javax.swing.JTextField" binding="name2TextField">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -54,12 +54,12 @@
|
||||
</component>
|
||||
<hspacer id="27f2a">
|
||||
<constraints>
|
||||
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="3" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<component id="3874e" class="javax.swing.JLabel" binding="fillAllFields">
|
||||
<constraints>
|
||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="8" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="true"/>
|
||||
@@ -70,7 +70,7 @@
|
||||
</component>
|
||||
<component id="a2f0" class="javax.swing.JButton" binding="connectButton" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="7" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Connect"/>
|
||||
@@ -78,7 +78,7 @@
|
||||
</component>
|
||||
<component id="6a4c6" class="javax.swing.JTextField" binding="ipTextField">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -86,7 +86,7 @@
|
||||
</component>
|
||||
<component id="4214e" class="javax.swing.JComboBox" binding="gameSelectorBox">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="6" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<model/>
|
||||
@@ -94,7 +94,7 @@
|
||||
</component>
|
||||
<component id="4225c" class="javax.swing.JTextField" binding="portTextField">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="5" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -102,7 +102,7 @@
|
||||
</component>
|
||||
<component id="43a89" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Select game:"/>
|
||||
@@ -110,7 +110,7 @@
|
||||
</component>
|
||||
<component id="3abc3" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Port:"/>
|
||||
@@ -118,7 +118,7 @@
|
||||
</component>
|
||||
<component id="514db" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="IP:"/>
|
||||
@@ -126,12 +126,22 @@
|
||||
</component>
|
||||
<component id="5723c" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Name 2:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<hspacer id="2e34c">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<vspacer id="93fc6">
|
||||
<constraints>
|
||||
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -118,9 +118,11 @@ public class TicTacToeServer extends TcpServer {
|
||||
this.endGame((String) command.arguments.getFirst());
|
||||
this.sendQueue.offer("svr game ended successfully");
|
||||
} else if (command.command == TicTacToeServerCommand.LOGIN) {
|
||||
this.endGame((String) command.arguments.getFirst());
|
||||
this.sendQueue.offer("svr login successful");
|
||||
} else if (command.command == TicTacToeServerCommand.SUBSCRIBE) {
|
||||
this.sendQueue.offer("svr added to ");
|
||||
this.endGame((String) command.arguments.getFirst());
|
||||
this.sendQueue.offer("svr added {} to the queue");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user