Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
smmhatami committed Jul 24, 2020
2 parents ed098eb + e7610b1 commit 37580e7
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 16 deletions.
5 changes: 3 additions & 2 deletions src/main/java/client/network/ClientSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
public class ClientSocket extends Thread {

// server info
// public static final int PORT = 11457;
// public static final String IP = "2.tcp.ngrok.io";
// public static final int PORT = 15154;
// public static final String IP = "0.tcp.ngrok.io";

// in pc
public static final int PORT = 6666;
public static final String IP = "127.0.0.1";
private int messageCounter;
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/client/newViewBagheri/AuctionMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ private void addProposedPrice() {

private void addMassagesToChat() {
ArrayList<String> allMassages = auctionController.getActiveAuctionAllMassages();
int size = allMassages.size();
for (String massage : allMassages.subList(massageNumber, size)) {
allMassagesBox.getChildren().add(new Text(massage));
if (allMassages != null && allMassages.size() != 0) {
int size = allMassages.size();
for (String massage : allMassages.subList(massageNumber, size)) {
allMassagesBox.getChildren().add(new Text(massage));
}
massageNumber = size;
}
massageNumber = size;
}

public void goToParticipateAuctionPanel() {
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/client/newViewBagheri/ProductMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ private void addFeaturesList() {
}

private void addCommentsList() {
for (HashMap<String, String> commentFields : productController.getActiveProductCommentsList()) {
ArrayList list = productController.getActiveProductCommentsList();
for (Object commentFields : list) {
BorderPane commentPane = new BorderPane();
Text titleText = new Text(commentFields.get("title"));
Text titleText = new Text(new HashMap<String, String>((LinkedTreeMap)commentFields).get("title"));
commentPane.setTop(titleText);
Text contentText = new Text(commentFields.get("content"));
Text contentText = new Text(new HashMap<String, String>((LinkedTreeMap)commentFields).get("content"));
commentPane.setCenter(contentText);
commentsList.getChildren().add(commentPane);
}
Expand All @@ -156,8 +157,9 @@ public void addNewComment() {

private void addSimilarProductsList() {
int i = 0;
for (HashMap<String, String> similarProductInfo : productController.getActiveProductSimilarProducts()) {
SimilarProductsListPain.add(createProductInfoVBox(similarProductInfo), i % 5, i / 5);
ArrayList similarProducts = productController.getActiveProductSimilarProducts();
for (Object similarProductInfo : similarProducts) {
SimilarProductsListPain.add(createProductInfoVBox(new HashMap<String, String>((LinkedTreeMap)similarProductInfo)), i % 5, i / 5);
i++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class SupporterChatsMenu {
private HashMap<String, Tab> allTabsList;
private HashMap<String, VBox> allVBoxMassagesList;

private SupporterChatsMenu() {
public SupporterChatsMenu() {
}

public static String getFxmlFilePath() {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/client/newViewNedaei/background/TopPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import client.newViewBagheri.AuctionsMenu;
import client.newViewBagheri.OffMenu;
import client.newViewBagheri.ProductsMenu;
import client.newViewBagheri.SupporterMenu;
import client.newViewHatami.AdminMenu;
import client.newViewHatami.LoginRegisterMenu;
import client.newViewNedaei.MainMenu;
Expand Down Expand Up @@ -77,6 +78,9 @@ public void goToUserPage() {
case "buyer":
MenuController.getInstance().goToMenu(BuyerMenu.getFxmlFilePath());
break;
case "supporter":
MenuController.getInstance().goToMenu(SupporterMenu.getFxmlFilePath());
break;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static SupporterController getInstance() {
return instance;
}

public HashMap<String, ArrayList<String>> getActiveUserAllActiveChats() {
public HashMap<String, ArrayList<String>> getActiveSupporterAllActiveChats() {
HashMap<String, ArrayList<String>> activeUserAllActiveChats = new HashMap<>();
for (DoubleChatRoom activeChat : ((Supporter) UserController.getActiveUser()).getActiveChats()) {
activeUserAllActiveChats.put(activeChat.getBuyer().getUsername(), activeChat.getAllMassagesText());
Expand Down
1 change: 1 addition & 0 deletions src/main/java/server/newModel/bagheri/Auction.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public HashMap<String, String> getAuctionInfo() {
HashMap<String, String> auctionInfo = new HashMap<>();
auctionInfo.put("auctionId", this.id);
auctionInfo.put("basePrice", "" + this.basePrice);
auctionInfo.put("endDate", "" + endTime);
HashMap<String, String> productInfo = productSellInfo.getProduct().getProductInfoForProductsList();
auctionInfo.put("productId", productInfo.get("id"));
auctionInfo.put("name", productInfo.get("name"));
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/AuctionsMenu.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<BorderPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
fx:controller="client.newViewBagheri.AuctionsMenu" prefHeight="600.0" prefWidth="1000.0">
<center>
<ScrollPane prefHeight="600.0" prefWidth="1000.0">
<GridPane fx:id="productsListPain" prefWidth="980.0"/>
</ScrollPane>
<ScrollPane prefHeight="600.0" prefWidth="1000.0">
<GridPane fx:id="productsListPain" prefWidth="980.0"/>
</ScrollPane>
</center>
</BorderPane>

0 comments on commit 37580e7

Please sign in to comment.