Skip to content

Commit

Permalink
Update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvir10029 committed May 12, 2021
1 parent ff686ba commit a66f668
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 18 deletions.
80 changes: 62 additions & 18 deletions Expedia/src/application/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ public class Main extends Application
double total=0;
TextArea clock;
int numOfItems=0;
String paymentChosen = " ";

@Override
public void start(Stage primaryStage)
{
try {
primaryStage.setTitle("Expedia");
primaryStage.setWidth(1100);
primaryStage.setWidth(1070);
primaryStage.setHeight(600);

TextArea ta = new TextArea();
Expand Down Expand Up @@ -85,21 +86,25 @@ public void start(Stage primaryStage)
"Miami",
"New York City",
"Los Angeles",
"Nairobi",
"Tokyo",
"Atlantis",
"London"
"London",
"Paris"
);

startLocTF.setEditable(true);

ComboBox<String> endLocTF = new ComboBox<String>();
endLocTF.getItems().addAll(
"Miami",
"Miami",
"New York City",
"Los Angeles",
"Nairobi",
"Tokyo",
"Atlantis",
"London"
"London",
"Paris"
);

endLocTF.setEditable(true);
Expand Down Expand Up @@ -130,7 +135,7 @@ public void start(Stage primaryStage)
TextField emailF = new TextField();
Label emailERR = new Label("");
Label blank = new Label ("");
Label pay = new Label ("\t Payment Method : ");
Label pay = new Label ("\t Payment Method : Select ");
Label Card = new Label ("\t Card Number : ");
TextField CardF = new TextField();
Label help = new Label("");
Expand All @@ -141,7 +146,22 @@ public void start(Stage primaryStage)
RB1.setToggleGroup(Payment);
RB2.setToggleGroup(Payment);


Payment.selectedToggleProperty().addListener(new ChangeListener<Toggle>()
{
public void changed(ObservableValue<? extends Toggle> ob,
Toggle o, Toggle n)
{

RadioButton rb = (RadioButton)Payment.getSelectedToggle();

if (rb != null) {
String s = rb.getText();
paymentChosen = s;
// change the label
pay.setText("\t Payment Method : " + s);
}
}
});


//Image Buttons (Just going to be lying around for now)
Expand Down Expand Up @@ -187,6 +207,18 @@ public void start(Stage primaryStage)
times.setText("2:15 PM\n6:00 PM");
}
});
Image nairobiPic = new Image("https://cdn.audleytravel.com/4082/2913/79/8003731-nairobi.jpg");
ImageView imageNairobi = new ImageView(nairobiPic);
Button buttonNairobi = new Button (" Nairobi ", imageNairobi);
imageNairobi.setFitWidth(160);
imageNairobi.setFitHeight(160);
buttonI3.setOnAction(new EventHandler<ActionEvent>()
{
@Override public void handle(ActionEvent e)
{
times.setText("2:15 PM\n6:00 PM");
}
});

Image tokyoPic = new Image("https://rimage.gnst.jp/livejapan.com/public/article/detail/a/00/02/a0002533/img/basic/a0002533_main.jpg");
ImageView imageTokyo = new ImageView(tokyoPic);
Expand All @@ -212,7 +244,7 @@ public void start(Stage primaryStage)
times.setText("9:30 AM\n12:40 PM\n4:55 PM");
}
});
Image londonPic = new Image("https://www.visitbritain.com/sites/default/files/styles/consumer_hero_image_mobile/public/consumer_components_enhanced/header_image/london-skyline-vb34141642.jpg");
Image londonPic = new Image("https://www.history.com/.image/ar_1:1%2Cc_fill%2Ccs_srgb%2Cfl_progressive%2Cq_auto:good%2Cw_1200/MTYyNDg1MjE3MTI1Mjc5Mzk4/topic-london-gettyimages-760251843-promo.jpg");
ImageView imageLondon = new ImageView(londonPic);
Button buttonLondon = new Button (" London ", imageLondon);
imageLondon.setFitWidth(160);
Expand All @@ -224,6 +256,18 @@ public void start(Stage primaryStage)
times.setText("11:50 AM");
}
});
Image parisPic = new Image("https://images.adsttc.com/media/images/5d44/14fa/284d/d1fd/3a00/003d/large_jpg/eiffel-tower-in-paris-151-medium.jpg");
ImageView imageParis = new ImageView(parisPic);
Button buttonParis = new Button (" Paris ", imageParis);
imageParis.setFitWidth(160);
imageParis.setFitHeight(160);
buttonLondon.setOnAction(new EventHandler<ActionEvent>()
{
@Override public void handle(ActionEvent e)
{
times.setText("11:50 AM");
}
});
//End of City Images

Image EBG = new Image("https://i.pinimg.com/originals/dd/91/4c/dd914c6cca076f8cebb463a81e73e7e5.jpg");
Expand All @@ -241,9 +285,11 @@ public void start(Stage primaryStage)
gridPane.add(buttonI1, 0, 1, 1, 1);
gridPane.add(buttonI2, 1, 1, 1, 1);
gridPane.add(buttonI3, 2, 1, 1, 1);
gridPane.add(buttonNairobi, 3, 1, 1, 1);
gridPane.add(buttonTokyo, 0, 2, 1, 1);
gridPane.add(buttonAtlantis, 1, 2, 1, 1);
gridPane.add(buttonLondon, 2, 2, 1, 1);
gridPane.add(buttonParis, 3, 2, 1, 1);
gridPane.setStyle("-fx-background-color:#Ffe48b; -fx-opacity:1;");
scr.setContent(gridPane);
scr.setPrefViewportWidth(10);
Expand All @@ -262,9 +308,12 @@ public void start(Stage primaryStage)
contact.add(emailERR, 2, 2, 1, 1);
contact.add(blank, 0, 3, 1, 1);
contact.add(help, 1, 3, 1, 1);
contact.add(pay, 2, 3, 1, 1);
contact.add(Card, 0, 4, 1, 1);
contact.add(CardF, 1, 4, 1, 1);
contact.add(pay, 0, 3, 1, 1);
contact.add(Card, 0, 6, 1, 1);
contact.add(CardF, 1, 6, 1, 1);
contact.add(RB1, 1, 4, 1, 1);
contact.add(RB2, 1, 5, 1, 1);


Button submitButton = new Button("SUBMIT");
submitButton.setOnAction(new EventHandler<ActionEvent>()
Expand Down Expand Up @@ -333,6 +382,8 @@ else if(CardF.getText().isEmpty()) {
su.sendMessage(msg1);
msg1 = "Email: " + emailF.getText();
su.sendMessage(msg1);
msg1 = "Payment Method: "+ paymentChosen;
su.sendMessage(msg1);
msg1 = "Card #: "+ CardF.getText();
su.sendMessage(msg1);

Expand Down Expand Up @@ -418,13 +469,7 @@ else if(CardF.getText().isEmpty()) {
});

//Gridpane for payment
GridPane payGrid = new GridPane();
gridPane.add(payGrid, 3, 3, 1, 1);
payGrid.add(RB1, 0, 1);
payGrid.add(RB2, 0, 2);
payGrid.add(submitButton, 0, 3);

payGrid.setVgap(10);
contact.add(submitButton, 1, 7, 1, 1);
contact.setVgap(5);

//Gridpane for Body
Expand All @@ -438,7 +483,6 @@ else if(CardF.getText().isEmpty()) {
body.add(findTimes, 5, 0);
//body.add(imageE, 6, 12, 1, 1);
body.add(contact, 1, 1);
body.add(payGrid, 1, 2);



Expand Down
28 changes: 28 additions & 0 deletions Expedia/transactionLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,31 @@
05-12-2021 15.27.02 : SERVER : Email: [email protected]
05-12-2021 15.27.03 : SERVER : Card #: 33333
05-12-2021 15.27.03 : SERVER : quit
05-12-2021 17.40.56 : SERVER : Transaction>kiosk#001,0,0.00
05-12-2021 17.40.57 : SERVER : Name: Jake
05-12-2021 17.40.57 : SERVER : Starting Location: Miami
05-12-2021 17.40.58 : SERVER : Ending Location: New York City
05-12-2021 17.40.58 : CLIENT : Transaction>kiosk#001,0,0.00
05-12-2021 17.40.58 : SERVER : Email: [email protected]
05-12-2021 17.40.59 : SERVER : Payment Method: Debit
05-12-2021 17.40.59 : SERVER : Card #: 12345
05-12-2021 17.41.00 : SERVER : quit
05-12-2021 18.03.45 : CLIENT NETWORK ERROR : Transaction>kiosk#001,0,0.00
05-12-2021 18.05.00 : SERVER : Transaction>kiosk#001,0,0.00
05-12-2021 18.05.00 : SERVER : Name: Ruby
05-12-2021 18.05.01 : SERVER : Starting Location: London
05-12-2021 18.05.01 : SERVER : Ending Location: Tokyo
05-12-2021 18.05.02 : CLIENT : Transaction>kiosk#001,0,0.00
05-12-2021 18.05.02 : SERVER : Email: [email protected]
05-12-2021 18.05.02 : SERVER : Payment Method: Credit
05-12-2021 18.05.03 : SERVER : Card #: 1234
05-12-2021 18.05.03 : SERVER : quit
05-12-2021 18.05.40 : SERVER : Transaction>kiosk#001,0,0.00
05-12-2021 18.05.41 : SERVER : Name: Ruby
05-12-2021 18.05.41 : SERVER : Starting Location: London
05-12-2021 18.05.41 : CLIENT : Transaction>kiosk#001,0,0.00
05-12-2021 18.05.42 : SERVER : Ending Location: Tokyo
05-12-2021 18.05.42 : SERVER : Email: [email protected]
05-12-2021 18.05.43 : SERVER : Payment Method: Credit
05-12-2021 18.05.43 : SERVER : Card #: 1234
05-12-2021 18.05.44 : SERVER : quit

0 comments on commit a66f668

Please sign in to comment.