Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
soldier.mh.2001
project-team-28
Commits
6b3026db
Commit
6b3026db
authored
Jul 21, 2021
by
mohammadmahdihn
Browse files
Woo
parent
1da6d4a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
.idea/shelf/Uncommitted_changes_before_Update_at_7_21_2021_8_44_PM__Default_Changelist_.xml
0 → 100644
View file @
6b3026db
<changelist
name=
"Uncommitted_changes_before_Update_at_7_21_2021_8_44_PM_[Default_Changelist]"
date=
"1626884095509"
recycled=
"true"
deleted=
"true"
>
<option
name=
"PATH"
value=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_7_21_2021_8_44_PM_[Default_Changelist]/shelved.patch"
/>
<option
name=
"DESCRIPTION"
value=
"Uncommitted changes before Update at 7/21/2021 8:44 PM [Default Changelist]"
/>
</changelist>
\ No newline at end of file
client/src/main/java/org/controller/ChatBoxController.java
View file @
6b3026db
...
...
@@ -36,11 +36,6 @@ public class ChatBoxController {
try
{
socket
=
new
Socket
(
"localhost"
,
8888
);
objectInputStream
=
new
ObjectInputStream
(
socket
.
getInputStream
());
// try {
// objectInputStream.reset();
// } catch (IOException e) {
// e.printStackTrace();
// }
newThread
(
objectInputStream
);
}
catch
(
IOException
x
)
{
...
...
@@ -62,26 +57,19 @@ public class ChatBoxController {
}
public
void
newThread
(
ObjectInputStream
objectInputStream
){
// try {
// objectInputStream.reset();
// } catch (IOException e) {
// e.printStackTrace();
// }
new
Thread
(()
->
{
while
(
true
)
{
try
{
ArrayList
<
String
>
messages
=
(
ArrayList
<
String
>)
objectInputStream
.
readObject
();
if
(
messages
!=
null
)
{
for
(
String
message
:
messages
)
{
System
.
out
.
println
(
message
);
}
view
.
showChat
(
messages
);
}
//objectInputStream.reset();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
NegativeArraySizeException
e
)
{
System
.
out
.
println
(
""
);
}
}
...
...
client/src/main/java/org/view/ShopView.java
View file @
6b3026db
...
...
@@ -138,6 +138,7 @@ public class ShopView extends Application {
amountForAdmin
.
setText
(
details
);
adminButtonBar
.
getButtons
().
clear
();
Button
changeAmountButton
=
new
Button
(
"Change amount"
);
changeAmountButton
.
setPrefWidth
(
600
);
changeAmountButton
.
setOnMouseClicked
(
mouseEvent1
->
{
String
result
=
JOptionPane
.
showInputDialog
(
"Enter amount: "
);
try
{
...
...
@@ -159,6 +160,7 @@ public class ShopView extends Application {
adminButtonBar
.
getButtons
().
add
(
changeAmountButton
);
if
(
details
.
endsWith
(
"Available"
))
{
Button
makeUnavailable
=
new
Button
(
"Make unavailable"
);
makeUnavailable
.
setPrefWidth
(
400
);
makeUnavailable
.
setOnMouseClicked
(
mouseEvent1
->
{
try
{
LoginMenuController
.
sendAndReceive
(
"set card unavailable --token "
+
MainClient
.
getToken
()
+
" --card "
+
cardName
);
...
...
@@ -170,6 +172,7 @@ public class ShopView extends Application {
adminButtonBar
.
getButtons
().
add
(
makeUnavailable
);
}
else
if
(
details
.
endsWith
(
"Unavailable"
))
{
Button
makeAvailable
=
new
Button
(
"Make available"
);
makeAvailable
.
setPrefWidth
(
400
);
makeAvailable
.
setOnMouseClicked
(
mouseEvent1
->
{
try
{
LoginMenuController
.
sendAndReceive
(
"set card available --token "
+
MainClient
.
getToken
()
+
" --card "
+
cardName
);
...
...
client/src/main/resources/mainclass/FXML/shopMenu.fxml
View file @
6b3026db
...
...
@@ -72,6 +72,6 @@
<Font
name=
"thewitcher"
size=
"19.0"
/>
</font>
</Text>
<ButtonBar
fx:id=
"adminButtonBar"
layoutX=
"
669
.0"
layoutY=
"263.0"
prefHeight=
"
40
.0"
prefWidth=
"
200
.0"
/>
<ButtonBar
fx:id=
"adminButtonBar"
layoutX=
"
565
.0"
layoutY=
"263.0"
prefHeight=
"
91
.0"
prefWidth=
"
305
.0"
/>
</children>
</AnchorPane>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment