Commit 1deea4c7 authored by Junita Sinambela's avatar Junita Sinambela
Browse files

~~~~~~~~

parents ff9555b3 a4878d14
......@@ -9,6 +9,6 @@ user.properties.file=C:\\Users\\Rikysamuel\\AppData\\Roaming\\NetBeans\\8.0\\bui
<<<<<<< HEAD
user.properties.file=C:\\Users\\Afik\\AppData\\Roaming\\NetBeans\\8.0\\build.properties
=======
user.properties.file=C:\\Users\\Rikysamuel\\AppData\\Roaming\\NetBeans\\8.0\\build.properties
user.properties.file=C:\\Users\\Afik\\AppData\\Roaming\\NetBeans\\8.0\\build.properties
>>>>>>> cb28cefddee92aa050308dcc190d631d01432729
>>>>>>> 6bf27d8a740b7265bd18ce16d4d6422130ece583
......@@ -3,6 +3,7 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<<<<<<< HEAD
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/GUI/TradePanel.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/grandquest/GrandQuest.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/GUI/FindPanel.java</file>
......@@ -11,11 +12,20 @@
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/Request/Request.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/GUI/MapPanel.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/GUI/MainFrame.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/GUI/AcceptPanel.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/GUI/InventoryPanel.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/HelperClasses/Server.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/HelperClasses/ButtonColumn.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/GUI/OfferingPanel.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/HelperClasses/KeyValuePair.java</file>
<file>file:/E:/OneDrive/Data%20Semester%206/Sistem%20Terdistribusi/GrandQuest/src/client/src/GUI/MixedItem.java</file>
=======
<file>file:/D:/AFIK/Project/GrandQuest%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/src/GUI/AcceptPanel.java</file>
<file>file:/D:/AFIK/Project/GrandQuest%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/src/GUI/MainFrame.java</file>
<file>file:/D:/AFIK/Project/GrandQuest%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/src/GUI/MixItemPanel.java</file>
<file>file:/D:/AFIK/Project/GrandQuest%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/src/grandquest/GrandQuest.java</file>
<file>file:/D:/AFIK/Project/GrandQuest%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/src/GUI/FindPanel.java</file>
<file>file:/D:/AFIK/Project/GrandQuest%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/src/GUI/LoginPanel.java</file>
<file>file:/D:/AFIK/Project/GrandQuest%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/src/GUI/InventoryPanel.java</file>
>>>>>>> 86d3b7e8f0f0920102862df169fb0ad151a60dc4
</group>
</open-files>
</project-private>
......@@ -30,13 +30,15 @@ dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.json-simple-1.1.1.jar=C:\\Users\\Rikysamuel\\Downloads\\json-simple-1.1.1.jar
file.reference.json-simple-1.1.1.jar-1=D:\\AFIK\\Project\\GrandQuest Sister\\json-simple-1.1.1.jar
file.reference.org.json-20120521.jar=..\\server\\lib\\org.json-20120521.jar
includes=**
jar.compress=false
javac.classpath=\
${file.reference.org.json-20120521.jar}:\
${file.reference.json-simple-1.1.1.jar}:\
${libs.absolutelayout.classpath}
${libs.absolutelayout.classpath}:\
${file.reference.json-simple-1.1.1.jar-1}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
......
......@@ -25,66 +25,72 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="223" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="loginButton" min="-2" max="-2" attributes="0"/>
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="usernameLabel" min="-2" max="-2" attributes="0"/>
<Component id="passwordLabel" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="48" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="usernameForm" pref="194" max="32767" attributes="0"/>
<Component id="passwordForm" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Component id="ipLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="ipaddressForm" min="-2" pref="123" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="portLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="portForm" min="-2" pref="57" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="223" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="loginButton" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="usernameLabel" min="-2" max="-2" attributes="0"/>
<Component id="passwordLabel" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="48" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="usernameForm" pref="194" max="32767" attributes="0"/>
<Component id="passwordForm" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace min="-2" pref="111" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="277" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" pref="273" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="286" max="32767" attributes="0"/>
<Component id="jLabel3" min="-2" pref="187" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="247" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Component id="ipLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="ipaddressForm" min="-2" pref="155" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jLabel4" min="-2" pref="17" max="-2" attributes="0"/>
<EmptySpace pref="96" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ipaddressForm" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="ipLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jLabel4" alignment="0" min="-2" pref="17" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ipaddressForm" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="ipLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="portLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="portForm" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="63" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" pref="47" max="-2" attributes="0"/>
<EmptySpace pref="35" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="40" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="usernameForm" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="usernameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
......@@ -134,7 +140,7 @@
</Component>
<Component class="javax.swing.JLabel" name="ipLabel">
<Properties>
<Property name="text" type="java.lang.String" value="IP Address:port"/>
<Property name="text" type="java.lang.String" value="IP Address"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="loginButton">
......@@ -162,18 +168,18 @@
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="&lt;html&gt; &lt;h1&gt; HIDDEN CITY &lt;/h1&gt; &lt;/html&gt;"/>
<Property name="text" type="java.lang.String" value="&lt;html&gt; &lt;h1&gt; JARD ADVENTURE &lt;/h1&gt; &lt;/html&gt;"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Component class="javax.swing.JLabel" name="portLabel">
<Properties>
<Property name="text" type="java.lang.String" value="&lt;html&gt; &lt;h2&gt; X &lt;/h2&gt; &lt;/html&gt;"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
<BevelBorder/>
</Border>
</Property>
<Property name="text" type="java.lang.String" value="Port"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="portForm">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="portFormActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
......@@ -23,10 +23,12 @@ public class LoginPanel extends javax.swing.JPanel {
public LoginPanel() {
// GrandQuest.host = "192.168.43.249";
// GrandQuest.port = 6789;
GrandQuest.host = "localhost";
GrandQuest.port = 8080;
// GrandQuest.host = "167.205.32.46";
// GrandQuest.port = 8026;
// GrandQuest.host = "localhost";
// GrandQuest.port = 8080;
GrandQuest.host = "167.205.32.46";
GrandQuest.port = 8025;
// GrandQuest.host = "localhost";
// GrandQuest.port = 8080;
// GrandQuest.host = "167.205.88.51";
// GrandQuest.port = 6789;
gq = new GrandQuest();
......@@ -53,7 +55,8 @@ public class LoginPanel extends javax.swing.JPanel {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
portLabel = new javax.swing.JLabel();
portForm = new javax.swing.JTextField();
setBackground(new java.awt.Color(255, 255, 51));
setPreferredSize(new java.awt.Dimension(720, 460));
......@@ -71,7 +74,7 @@ public class LoginPanel extends javax.swing.JPanel {
passwordLabel.setText("Password");
ipLabel.setText("IP Address:port");
ipLabel.setText("IP Address");
loginButton.setText("Login");
loginButton.addActionListener(new java.awt.event.ActionListener() {
......@@ -89,62 +92,72 @@ public class LoginPanel extends javax.swing.JPanel {
jLabel1.setText("Not a member?");
jLabel3.setText("<html> <h1> HIDDEN CITY </h1> </html>");
jLabel3.setText("<html> <h1> JARD ADVENTURE </h1> </html>");
jLabel4.setText("<html> <h2> X </h2> </html>");
jLabel4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
portLabel.setText("Port");
portForm.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
portFormActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(223, 223, 223)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(loginButton)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(usernameLabel)
.addComponent(passwordLabel))
.addGap(48, 48, 48)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(usernameForm, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
.addComponent(passwordForm)))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jButton1)))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 286, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(247, 247, 247))
.addGroup(layout.createSequentialGroup()
.addGap(24, 24, 24)
.addComponent(ipLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(ipaddressForm, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(ipaddressForm, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(portLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(portForm, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(223, 223, 223)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(loginButton)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(usernameLabel)
.addComponent(passwordLabel))
.addGap(48, 48, 48)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(usernameForm, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
.addComponent(passwordForm)))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addComponent(jLabel2))))
.addGap(111, 111, 111))))
.addGroup(layout.createSequentialGroup()
.addGap(277, 277, 277)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(96, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(8, 8, 8)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ipaddressForm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(ipLabel)))
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(8, 8, 8)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ipaddressForm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(ipLabel)
.addComponent(portLabel)
.addComponent(portForm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(63, 63, 63)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(usernameForm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(usernameLabel))
......@@ -207,6 +220,10 @@ public class LoginPanel extends javax.swing.JPanel {
}
}//GEN-LAST:event_jButton1ActionPerformed
private void portFormActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_portFormActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_portFormActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel ipLabel;
......@@ -215,10 +232,11 @@ public class LoginPanel extends javax.swing.JPanel {
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JButton loginButton;
private javax.swing.JPasswordField passwordForm;
private javax.swing.JLabel passwordLabel;
private javax.swing.JTextField portForm;
private javax.swing.JLabel portLabel;
private javax.swing.JTextField usernameForm;
private javax.swing.JLabel usernameLabel;
// End of variables declaration//GEN-END:variables
......
......@@ -28,43 +28,42 @@
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="69" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="Position" min="-2" max="-2" attributes="0"/>
<Component id="Time" min="-2" max="-2" attributes="0"/>
<Component id="MapName" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jButton5" alignment="1" min="-2" pref="96" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="Status" min="-2" max="-2" attributes="0"/>
<Component id="Current" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="Position" min="-2" max="-2" attributes="0"/>
<Component id="Time" min="-2" max="-2" attributes="0"/>
<Component id="MapName" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jButton5" alignment="1" min="-2" pref="96" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="Status" min="-2" max="-2" attributes="0"/>
<Component id="Current" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jButton2" alignment="1" min="-2" pref="96" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="130" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="141" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jButton3" alignment="1" min="-2" pref="96" max="-2" attributes="0"/>
<Component id="jButton4" alignment="1" min="-2" pref="96" max="-2" attributes="0"/>
<Component id="jButton1" alignment="1" min="-2" pref="96" max="-2" attributes="0"/>
<Component id="jButton6" alignment="1" min="-2" pref="96" max="-2" attributes="0"/>
<Component id="jButton2" alignment="1" min="-2" pref="96" max="-2" attributes="0"/>
<Component id="getItemButton" alignment="1" min="-2" pref="96" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
......@@ -102,11 +101,13 @@
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="Status" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="getItemButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="34" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Component id="jButton3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton4" min="-2" max="-2" attributes="0"/>
......@@ -290,5 +291,13 @@
<Property name="text" type="java.lang.String" value="Status"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="getItemButton">
<Properties>
<Property name="text" type="java.lang.String" value="Get Item"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="getItemButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
......@@ -6,6 +6,7 @@
package GUI;
import HelperClasses.Item;
import Request.Request;
import grandquest.GrandQuest;
import java.awt.Component;
......@@ -45,6 +46,8 @@ public class MapPanel extends javax.swing.JPanel {
static long moveTime;
static int countStatus;
static String item;
/**
* Creates new form MapPanel
* @throws java.lang.InterruptedException
......@@ -109,25 +112,54 @@ public class MapPanel extends javax.swing.JPanel {
String sentence = Request.move(GrandQuest.token,x,y).toString();
Request.responseHandler(Request.send(sentence));
}
String res = Request.findInResponses("status");
switch(res){
case "ok" :
desiredX = x;
desiredY = y;
moveTime = Long.valueOf(Request.findInResponses("time"))*1000;
Time.setText(epochToTime(moveTime));
Status.setText("Moving");
break;
case "fail" :
JOptionPane.showMessageDialog(null, "Move Failed! \n"+Request.findInResponses("description"), "Information", JOptionPane.ERROR_MESSAGE);
break;
default :
JOptionPane.showMessageDialog(null, "Error!", "Error", JOptionPane.ERROR_MESSAGE);
break;
if (Request.serverResponse != null){
String res = Request.findInResponses("status");
switch(res){
case "ok" :
desiredX = x;
desiredY = y;
moveTime = Long.valueOf(Request.findInResponses("time"))*1000;
Time.setText(epochToTime(moveTime));
Status.setText("Moving");
break;
case "fail" :
JOptionPane.showMessageDialog(null, "Move Failed! \n"+Request.findInResponses("description"), "Information", JOptionPane.ERROR_MESSAGE);
break;
default :
JOptionPane.showMessageDialog(null, "Error!", "Error", JOptionPane.ERROR_MESSAGE);
break;
}
}
}
/**
* collect item in player's current position
*/
public void collectItem(){
if (Request.connectToServer(GrandQuest.host, GrandQuest.port)) {
String sentence = Request.field(GrandQuest.token).toString();
Request.responseHandler(Request.send(sentence));
}
if (Request.serverResponse != null){
String res = Request.findInResponses("status");
switch(res){
case "ok" :
item = Item.getItem(Integer.parseInt(Request.findInResponses("item")));
JOptionPane.showMessageDialog(null, "Congratulation, you've earned "+ item,"Information", JOptionPane.PLAIN_MESSAGE);
//PANEL MIXEDITEM
break;
case "fail" :
JOptionPane.showMessageDialog(null, "Failed! \n"+Request.findInResponses("description"), "Information", JOptionPane.ERROR_MESSAGE);
break;
default :
JOptionPane.showMessageDialog(null, "Error!", "Error", JOptionPane.ERROR_MESSAGE);
break;
}
}
}
/**
* Map's mouse click listener
*/
......@@ -198,7 +230,7 @@ public class MapPanel extends javax.swing.JPanel {
map.setValueAt(getScaledImage(img, 400/nWidth, 400/nHeight), desiredX, desiredY);
posX = desiredX; posY = desiredY;
Position.setText(posX + "," + posY);