aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/pokemon/Client.java24
-rw-r--r--src/main/java/pokemon/Server.java3
-rw-r--r--src/main/java/ui/ChooseOpponentPanel.java25
-rw-r--r--src/main/java/ui/GamePanel.java91
-rw-r--r--src/main/java/ui/LoginPanel.java70
-rw-r--r--src/main/java/ui/MainFrame.java45
6 files changed, 255 insertions, 3 deletions
diff --git a/src/main/java/pokemon/Client.java b/src/main/java/pokemon/Client.java
new file mode 100644
index 0000000..b141530
--- /dev/null
+++ b/src/main/java/pokemon/Client.java
@@ -0,0 +1,24 @@
+package pokemon;
+
+import java.awt.BorderLayout;
+
+import javax.swing.SwingUtilities;
+
+import ui.MainFrame;
+import ui.ChooseOpponentPanel;
+import ui.GamePanel;
+import ui.LoginPanel;
+
+public class Client {
+
+ public static void main(String[] args) {
+
+ MainFrame frame=new MainFrame();
+ LoginPanel p=new LoginPanel();
+ frame.add(p,BorderLayout.CENTER);
+ frame.setVisible(true);
+ //SwingUtilities.updateComponentTreeUI(frame);
+
+ }
+
+}
diff --git a/src/main/java/pokemon/Server.java b/src/main/java/pokemon/Server.java
index 695fafb..ea47998 100644
--- a/src/main/java/pokemon/Server.java
+++ b/src/main/java/pokemon/Server.java
@@ -1,10 +1,7 @@
package pokemon;
-import java.net.MalformedURLException;
import java.rmi.Naming;
-import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
-
import models.CONSTS;
public class Server {
diff --git a/src/main/java/ui/ChooseOpponentPanel.java b/src/main/java/ui/ChooseOpponentPanel.java
new file mode 100644
index 0000000..e508f6e
--- /dev/null
+++ b/src/main/java/ui/ChooseOpponentPanel.java
@@ -0,0 +1,25 @@
+package ui;
+
+import javax.swing.JPanel;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+
+public class ChooseOpponentPanel extends JPanel {
+
+ /**
+ * Create the panel.
+ */
+ public ChooseOpponentPanel() {
+ setLayout(null);
+
+ JButton btnSendGameRequest = new JButton("Send Game Request");
+ btnSendGameRequest.setBounds(134, 153, 166, 23);
+ add(btnSendGameRequest);
+
+ JComboBox comboBox = new JComboBox();
+ comboBox.setBounds(134, 101, 166, 22);
+ add(comboBox);
+
+ }
+
+}
diff --git a/src/main/java/ui/GamePanel.java b/src/main/java/ui/GamePanel.java
new file mode 100644
index 0000000..0071849
--- /dev/null
+++ b/src/main/java/ui/GamePanel.java
@@ -0,0 +1,91 @@
+package ui;
+
+import javax.swing.JPanel;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JProgressBar;
+import javax.swing.JTextField;
+import javax.swing.JScrollPane;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.JTextArea;
+
+public class GamePanel extends JPanel {
+ private JTextField textFieldChat;
+
+ /**
+ * Create the panel.
+ */
+ public GamePanel() {
+ setLayout(null);
+
+ JButton btnAttack = new JButton("Attack");
+ btnAttack.setBounds(0, 239, 89, 30);
+ add(btnAttack);
+
+ JButton btnSpecial = new JButton("Special");
+ btnSpecial.setBounds(87, 239, 89, 30);
+ add(btnSpecial);
+
+ JButton btnHeal = new JButton("Heal");
+ btnHeal.setBounds(0, 272, 89, 30);
+ add(btnHeal);
+
+ JButton btnShield = new JButton("Shield");
+ btnShield.setBounds(87, 272, 89, 30);
+ add(btnShield);
+
+ JLabel lblImageEnemy = new JLabel("imageEnemy");
+ lblImageEnemy.setBounds(333, 35, 50, 50);
+ add(lblImageEnemy);
+
+ JLabel lblImageMe = new JLabel("imageMe");
+ lblImageMe.setBounds(21, 177, 50, 50);
+ add(lblImageMe);
+
+ JLabel lblPokemonNameEnemy = new JLabel("PokemonNameEnemy");
+ lblPokemonNameEnemy.setBounds(25, 11, 139, 14);
+ add(lblPokemonNameEnemy);
+
+ JProgressBar progressBarHpEnemy = new JProgressBar();
+ progressBarHpEnemy.setBounds(21, 33, 146, 14);
+ add(progressBarHpEnemy);
+
+ JLabel lblHpEnemy = new JLabel("HpEnemy");
+ lblHpEnemy.setBounds(104, 53, 72, 14);
+ add(lblHpEnemy);
+
+ JLabel lblPokemonNameMe = new JLabel("PokemonNameMe");
+ lblPokemonNameMe.setBounds(232, 171, 139, 14);
+ add(lblPokemonNameMe);
+
+ JProgressBar progressBarHpMe = new JProgressBar();
+ progressBarHpMe.setBounds(228, 193, 146, 14);
+ add(progressBarHpMe);
+
+ JLabel lblHpMe = new JLabel("HpMe");
+ lblHpMe.setBounds(311, 213, 72, 14);
+ add(lblHpMe);
+
+ textFieldChat = new JTextField();
+ textFieldChat.setBounds(486, 240, 188, 20);
+ add(textFieldChat);
+ textFieldChat.setColumns(10);
+
+ JButton btnSendText = new JButton("Send");
+ btnSendText.setBounds(585, 266, 89, 23);
+ add(btnSendText);
+
+ JScrollPane scrollPane = new JScrollPane();
+ scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ scrollPane.setBounds(486, 22, 188, 205);
+ add(scrollPane);
+
+ JTextArea txtrLoremIpsumDolor = new JTextArea();
+ txtrLoremIpsumDolor.setEditable(false);
+ txtrLoremIpsumDolor.setLineWrap(true);
+ txtrLoremIpsumDolor.setText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Est ultricies integer quis auctor elit sed. Urna nunc id cursus metus aliquam eleifend mi. Amet consectetur adipiscing elit pellentesque habitant morbi tristique senectus. Consequat interdum varius sit amet mattis vulputate enim nulla aliquet. Tristique magna sit amet purus gravida quis blandit. Eget gravida cum sociis natoque penatibus. Nec tincidunt praesent semper feugiat nibh. Maecenas sed enim ut sem. Pulvinar neque laoreet suspendisse interdum consectetur. Diam maecenas ultricies mi eget mauris pharetra. Sollicitudin aliquam ultrices sagittis orci. Nulla facilisi etiam dignissim diam quis.");
+ scrollPane.setViewportView(txtrLoremIpsumDolor);
+
+ }
+}
diff --git a/src/main/java/ui/LoginPanel.java b/src/main/java/ui/LoginPanel.java
new file mode 100644
index 0000000..b190cc5
--- /dev/null
+++ b/src/main/java/ui/LoginPanel.java
@@ -0,0 +1,70 @@
+package ui;
+
+import javax.swing.JPanel;
+import javax.swing.JLabel;
+import javax.swing.JTextField;
+import javax.swing.SwingUtilities;
+import javax.swing.JTextArea;
+import java.awt.SystemColor;
+import java.awt.Font;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+public class LoginPanel extends JPanel {
+ public JTextField textFieldUsername;
+ public JTextField textFieldPassword;
+
+ /**
+ * Create the panel.
+ */
+ public LoginPanel() {
+ setLayout(null);
+
+ JLabel lblNewLabel = new JLabel("Username");
+ lblNewLabel.setBounds(132, 78, 59, 14);
+ add(lblNewLabel);
+
+ textFieldUsername = new JTextField();
+ textFieldUsername.setColumns(10);
+ textFieldUsername.setBounds(205, 75, 100, 20);
+ add(textFieldUsername);
+
+ JLabel lblPassword = new JLabel("Password");
+ lblPassword.setBounds(132, 109, 59, 14);
+ add(lblPassword);
+
+ textFieldPassword = new JTextField();
+ textFieldPassword.setColumns(10);
+ textFieldPassword.setBounds(205, 106, 100, 20);
+ add(textFieldPassword);
+
+ JTextArea warningTextArea = new JTextArea();
+ warningTextArea.setToolTipText("");
+ warningTextArea.setText("fsdfsdfd fdsfsdfsd");
+ warningTextArea.setForeground(Color.RED);
+ warningTextArea.setFont(new Font("Monospaced", Font.PLAIN, 10));
+ warningTextArea.setEditable(false);
+ warningTextArea.setBackground(SystemColor.menu);
+ warningTextArea.setBounds(132, 134, 158, 36);
+ add(warningTextArea);
+ JButton btnLogIn = new JButton("Log In");
+ btnLogIn.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ MainFrame topFrame=(MainFrame) SwingUtilities.getAncestorOfClass(MainFrame.class, LoginPanel.this);
+ topFrame.getContentPane().removeAll();
+ topFrame.add(new GamePanel(),BorderLayout.CENTER);
+ SwingUtilities.updateComponentTreeUI(topFrame);
+ topFrame.testOut();
+ }
+ });
+ btnLogIn.setBounds(174, 181, 81, 23);
+ add(btnLogIn);
+
+ }
+
+}
diff --git a/src/main/java/ui/MainFrame.java b/src/main/java/ui/MainFrame.java
new file mode 100644
index 0000000..53e0a3f
--- /dev/null
+++ b/src/main/java/ui/MainFrame.java
@@ -0,0 +1,45 @@
+package ui;
+
+import java.awt.EventQueue;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.border.EmptyBorder;
+import javax.swing.JTextField;
+import javax.swing.JLabel;
+import java.awt.Color;
+import javax.swing.JButton;
+import javax.swing.JTextArea;
+import java.awt.Font;
+import java.awt.BorderLayout;
+
+public class MainFrame extends JFrame {
+
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ try {
+ MainFrame frame = new MainFrame();
+ frame.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+
+ /**
+ * Create the frame.
+ */
+ public MainFrame() {
+ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ setBounds(100, 100, 727, 429);
+ getContentPane().setLayout(new BorderLayout(0, 0));
+ }
+ public void testOut() {
+ System.out.println("RADI");
+ }
+}