From 791f5b0186ae292de095e140389668870327aa2d Mon Sep 17 00:00:00 2001 From: Cristina Fierbinteanu Date: Thu, 7 Aug 2014 18:33:45 +0300 Subject: [PATCH 1/6] added calculator implemented with lambdas --- Lesson18/.classpath | 1 + .../resources/images/calculatoryellow.png | Bin 0 -> 35142 bytes .../src/application/CalculatorEngine.java | 8 + Lesson18/src/application/CalculatorPane.java | 199 ++++++++++++ .../src/application/FancyCalculatorPane.java | 23 ++ Lesson18/src/application/Main.java | 300 ++++++++++++++++++ .../src/application/SimpleCalculatorPane.java | 122 +++++++ .../application/StandardCalculatorPane.java | 175 ++++++++++ Lesson18/src/application/application.css | 0 Lesson18/src/application/calculator.css | 120 +++++++ 10 files changed, 948 insertions(+) create mode 100644 Lesson18/resources/images/calculatoryellow.png create mode 100644 Lesson18/src/application/CalculatorEngine.java create mode 100644 Lesson18/src/application/CalculatorPane.java create mode 100644 Lesson18/src/application/FancyCalculatorPane.java create mode 100644 Lesson18/src/application/Main.java create mode 100644 Lesson18/src/application/SimpleCalculatorPane.java create mode 100644 Lesson18/src/application/StandardCalculatorPane.java create mode 100644 Lesson18/src/application/application.css create mode 100644 Lesson18/src/application/calculator.css diff --git a/Lesson18/.classpath b/Lesson18/.classpath index fb50116..11768b4 100644 --- a/Lesson18/.classpath +++ b/Lesson18/.classpath @@ -2,5 +2,6 @@ + diff --git a/Lesson18/resources/images/calculatoryellow.png b/Lesson18/resources/images/calculatoryellow.png new file mode 100644 index 0000000000000000000000000000000000000000..dbd791becc93348339a6aa695a6ca55c0293ed4b GIT binary patch literal 35142 zcmaHRYd6W7^it@YV!pA)62u0TvcPXGV_h?NxOv;Y9$Qxgcl!+H7`e=V^F0HTPM zizpJcyf%Xg@(OfbQ7FEm&`QuE&nObEKFlDakZ7;A_w$@&()LoC5)ZUCN*pFtsnMdoCXy(a$C!l)y|8G2hhvSdb2-E=F zoX$Si(#J?T2~xPMLVGd{AJ-bvlp}<;vK_+P!vm!2hc~nLCN|KuE4vJ2vGzuj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Q4|MJo(+CT&ni>NF1ze9l7p|I@z$0}l*fO|I6;a8(BRil02zDZAtwQ~m12LuVBY)B z#o=&tm&L%*fWrl7hJY3yfQJZ1&}0000 + engine.processEvent(e,this)); + button1.setOnAction((e) -> + engine.processEvent(e,this)); + button2.setOnAction((e) -> + engine.processEvent(e,this)); + button3.setOnAction((e) -> + engine.processEvent(e,this)); + button4.setOnAction((e) -> + engine.processEvent(e,this)); + button5.setOnAction((e) -> + engine.processEvent(e,this)); + button6.setOnAction((e) -> + engine.processEvent(e,this)); + button7.setOnAction((e) -> + engine.processEvent(e,this)); + button8.setOnAction((e) -> + engine.processEvent(e,this)); + button9.setOnAction((e) -> + engine.processEvent(e,this)); + + buttonPoint.setOnAction((e) -> + engine.processEvent(e,this)); + buttonEqual.setOnAction((e) -> + engine.processEvent(e,this)); + buttonPlus.setOnAction((e) -> + engine.processEvent(e,this)); + buttonMinus.setOnAction((e) -> + engine.processEvent(e,this)); + buttonMult.setOnAction((e) -> + engine.processEvent(e,this)); + buttonDiv.setOnAction((e) -> + engine.processEvent(e,this)); + + buttonSQRT.setOnAction((e) -> + engine.processEvent(e,this)); + buttonMOD.setOnAction((e) -> + engine.processEvent(e,this)); + buttonINV.setOnAction((e) -> + engine.processEvent(e,this)); + buttonOPP.setOnAction((e) -> + engine.processEvent(e,this)); + + buttonBackspace.setOnAction((e) -> + engine.processEvent(e,this)); + buttonCE.setOnAction((e) -> + engine.processEvent(e,this)); + buttonC.setOnAction((e) -> + engine.processEvent(e,this)); + + buttonMC.setOnAction((e) -> + engine.processEvent(e,this)); + buttonMR.setOnAction((e) -> + engine.processEvent(e,this)); + buttonMS.setOnAction((e) -> + engine.processEvent(e,this)); + buttonMPlus.setOnAction((e) -> + engine.processEvent(e,this)); + } + + // Declare all calculator's components. + protected TextField displayField; + + protected Button button0; + protected Button button1; + protected Button button2; + protected Button button3; + protected Button button4; + protected Button button5; + protected Button button6; + protected Button button7; + protected Button button8; + protected Button button9; + protected Button buttonPoint; + protected Button buttonEqual; + protected Button buttonPlus; + protected Button buttonMinus; + protected Button buttonMult; + protected Button buttonDiv; + + protected Button buttonSQRT; + protected Button buttonMOD; + protected Button buttonINV; + protected Button buttonOPP; + + protected Button buttonBackspace; + protected Button buttonCE; + protected Button buttonC; + + protected Button buttonMC; + protected Button buttonMR; + protected Button buttonMS; + protected Button buttonMPlus; + + // Constructor + public CalculatorPane(){ + super(); + } + + // Define getter and setters + + public String getDisplayValue() { + return displayField.getText(); + } + + public void setDisplayValue(String val){ + String textColor = " -fx-text-fill: black"; + displayField.setStyle(textColor); + displayField.setText(val); + } + + public void setDisplayValue(String val, String color){ + String textColor = " -fx-text-fill: " + color; + displayField.setStyle(textColor); + displayField.setText(val); + } + + public String getFirstNumber() { + return firstNumber; + } + + public void setFirstNumber(String firstNumber) { + this.firstNumber = firstNumber; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public double getResult() { + return result; + } + + public void setResult(double result) { + this.result = result; + } + + public String getPreviouslyPressedButton() { + return previouslyPressedButton; + } + + public void setPreviouslyPressedButton(String previouslyPressedButton) { + this.previouslyPressedButton = previouslyPressedButton; + } + + protected void setButtonStyles(String style){ + button0.setId(style); + button1.setId(style); + button2.setId(style); + button3.setId(style); + button4.setId(style); + button5.setId(style); + button6.setId(style); + button7.setId(style); + button8.setId(style); + button9.setId(style); + + buttonPoint.setId(style); + buttonEqual.setId(style); + buttonPlus.setId(style); + buttonMinus.setId(style); + buttonMult.setId(style); + buttonDiv.setId(style); + + buttonSQRT.setId(style); + buttonMOD.setId(style); + buttonINV.setId(style); + buttonOPP.setId(style); + + buttonBackspace.setId(style); + buttonCE.setId(style); + buttonC.setId(style); + + buttonMC.setId(style); + buttonMR.setId(style); + buttonMS.setId(style); + buttonMPlus.setId(style); + + } + +} diff --git a/Lesson18/src/application/FancyCalculatorPane.java b/Lesson18/src/application/FancyCalculatorPane.java new file mode 100644 index 0000000..5c6d1de --- /dev/null +++ b/Lesson18/src/application/FancyCalculatorPane.java @@ -0,0 +1,23 @@ +package application; + +public class FancyCalculatorPane extends StandardCalculatorPane { + + public FancyCalculatorPane(){ + super(); + + setStyle( " -fx-background-color: grey; " + + "-fx-text-fill: white;" + + "-fx-font-family: \"Times New Roman\";" + + "-fx-font-size: 18px;"); + + // Set button styles + + setButtonStyles("big-yellow"); + // setButtonStyles("iphone"); + // setButtonStyles("green"); + // setButtonStyles("shiny-orange"); + // setButtonStyles("round-red"); + + } + +} diff --git a/Lesson18/src/application/Main.java b/Lesson18/src/application/Main.java new file mode 100644 index 0000000..1c73a87 --- /dev/null +++ b/Lesson18/src/application/Main.java @@ -0,0 +1,300 @@ +package application; + +import javafx.application.Application; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Menu; +import javafx.scene.control.MenuBar; +import javafx.scene.control.RadioMenuItem; +import javafx.scene.image.Image; +import javafx.scene.layout.GridPane; +import javafx.scene.paint.Color; +import javafx.stage.Stage; +import javafx.stage.StageStyle; + +public class Main extends Application { + + private static SimpleCalculatorPane simpleCalculatorPane = new SimpleCalculatorPane(); + private static StandardCalculatorPane standardCalculatorPane = new StandardCalculatorPane(); + private static FancyCalculatorPane fancyCalculatorPane = new FancyCalculatorPane(); + + public static void main(String[] args) { + + // Define the calculator engine as a lambda expression and store it in a variable + CalculatorEngine calculatorEngine = (ActionEvent e, + CalculatorPane parent) -> { + + // Get the source of this action + Button clickedButton = (Button) e.getSource(); + + switch(clickedButton.getText()){ + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + case "0": + case ".": + parent.setPreviouslyPressedButton(clickedButton.getText()); + // displayDigit(clickedButton); + // Get the existing text from the Calculator's display field + String dispFieldText = parent.getDisplayValue(); + // Get the button's label + String clickedButtonLabel = clickedButton.getText(); + parent.setDisplayValue(dispFieldText + clickedButtonLabel); + break; + case "+": + case "-": + case "/": + case "*": + case "%": + // Store the first number and the operator in corresponding variables + parent.setFirstNumber(parent.getDisplayValue()); + parent.setOperator(clickedButton.getText()); + parent.setPreviouslyPressedButton(parent.getOperator()); + // Erase the number from the display + parent.setDisplayValue(""); + break; + case "=": + + // do nothing if previously pressed button was the equal sign, + // a unary operator or dot + if ("=".equals(parent.getPreviouslyPressedButton()) || + "sqrt".equals(parent.getPreviouslyPressedButton()) || + "+/-".equals(parent.getPreviouslyPressedButton()) || + "1/x".equals(parent.getPreviouslyPressedButton()) || + "C".equals(parent.getPreviouslyPressedButton()) || + "Backspace".equals(parent.getPreviouslyPressedButton()) || + ".".equals(parent.getPreviouslyPressedButton())) break; + + try{ + // Perform the selected action + if ("+".equals(parent.getOperator())) { + parent.setResult(Double.parseDouble(parent.getDisplayValue()) + Double.parseDouble(parent.getFirstNumber())); + } + if ("-".equals(parent.getOperator())) { + parent.setResult(Double.parseDouble(parent.getFirstNumber()) - Double.parseDouble(parent.getDisplayValue())); + } + if ("*".equals(parent.getOperator())) { + parent.setResult(Double.parseDouble(parent.getFirstNumber()) * Double.parseDouble(parent.getDisplayValue())); + } + if ("/".equals(parent.getOperator())) { + //validate input + if (Double.parseDouble(parent.getDisplayValue()) == 0){ + // Display error message in red if user attempts to divide by zero + parent.setDisplayValue("You cannot divide by zero!", "red"); + break; + } + else + parent.setResult(Double.parseDouble(parent.getFirstNumber()) / Double.parseDouble(parent.getDisplayValue())); + } + if ("%".equals(parent.getOperator())) { + parent.setResult(Double.parseDouble(parent.getFirstNumber()) % Double.parseDouble(parent.getDisplayValue())); + } + } + catch(NumberFormatException exception){ + parent.setDisplayValue("Operand is not a number!", "red"); + break; + } + + // Store the result in firstNumber + parent.setFirstNumber(String.valueOf(parent.getResult())); + // Display the result + parent.setDisplayValue(parent.getFirstNumber()); + parent.setPreviouslyPressedButton("="); + break; + + case "C": + // erase the number or message from the display + parent.setDisplayValue(""); + parent.setPreviouslyPressedButton(clickedButton.getText()); + break; + + case "sqrt": + //store result in firstNumber + parent.setFirstNumber(String.valueOf(Math.sqrt(Double.parseDouble(parent.getDisplayValue())))); + //display the result + parent.setDisplayValue(parent.getFirstNumber()); + parent.setPreviouslyPressedButton(clickedButton.getText()); + break; + + case "1/x": + if (Double.parseDouble(parent.getDisplayValue()) == 0){ + // Display error message in red if user attempts to divide by zero + parent.setDisplayValue("You cannot divide by zero!", "red"); + parent.setPreviouslyPressedButton(clickedButton.getText()); + break; + } + else{ + //store result in firstNumber + parent.setFirstNumber(String.valueOf(1/(Double.parseDouble(parent.getDisplayValue())))); + //display the result + parent.setDisplayValue(parent.getFirstNumber()); + } + parent.setPreviouslyPressedButton(clickedButton.getText()); + break; + + case "+/-": + //store result in firstNumber + parent.setFirstNumber(String.valueOf(0.0-(Double.parseDouble(parent.getDisplayValue())))); + //display the result + parent.setDisplayValue(parent.getFirstNumber()); + parent.setPreviouslyPressedButton(clickedButton.getText()); + break; + + case "Backspace": + if((parent.getDisplayValue().length()) != 0) { + parent.setDisplayValue(parent.getDisplayValue().substring(0,parent.getDisplayValue().length()-1)); + } + parent.setPreviouslyPressedButton(clickedButton.getText()); + break; + + default: + parent.setDisplayValue("Undefined action"); + + } + }; + + + // set handler code for calculator components + fancyCalculatorPane.handle(calculatorEngine); + simpleCalculatorPane.handle(calculatorEngine); + standardCalculatorPane.handle(calculatorEngine); + + launch(args); + } + + @Override + public void start(Stage primaryStage) throws Exception { + primaryStage.setTitle("Calculator"); + // Window is not maximizable + //primaryStage.setResizable(false); + primaryStage.initStyle(StageStyle.TRANSPARENT); + //primaryStage.initModality(Modality.NONE); + // Set the application icon + primaryStage.getIcons().add(new Image("file:resources/images/calculatoryellow.png")); + + // Create the menu bar + MenuBar menuBar = new MenuBar(); + Menu viewMenu = new Menu("View"); + RadioMenuItem simpleCalculatorMenuItem = new RadioMenuItem("Simple"); + RadioMenuItem standardCalculatorMenuItem = new RadioMenuItem("Standard"); + RadioMenuItem fancyCalculatorMenuItem = new RadioMenuItem("Fancy"); + // Set fancy calculator as default view + fancyCalculatorMenuItem.setSelected(true); + viewMenu.getItems().addAll(simpleCalculatorMenuItem, + standardCalculatorMenuItem, + fancyCalculatorMenuItem); + + menuBar.getMenus().add(viewMenu); + + // Create a GridPane as the root layout node + GridPane window = new GridPane(); + // Create the scene and set its style + Scene scene = new Scene(window, 500, 350, Color.GREY); + scene.getStylesheets() + .add(getClass().getResource("calculator.css") + .toExternalForm()); + + // Add the menu bar to the window + window.add(menuBar, 0, 0); + + // At the beginning add to the window a fancy calculator pane + + window.add(fancyCalculatorPane, 0, 1); + + // Set the scene and display the window + primaryStage.setScene(scene); + primaryStage.show(); + + // Handler code for menu items + standardCalculatorMenuItem.setOnAction(new EventHandler() { + @Override + public void handle(ActionEvent t) { + // if selected, add + if (standardCalculatorMenuItem.isSelected() && + (window.getChildren().contains(simpleCalculatorPane))){ + simpleCalculatorMenuItem.setSelected(false); + window.getChildren().remove(simpleCalculatorPane); + window.add(standardCalculatorPane, 0, 1); + } + if (standardCalculatorMenuItem.isSelected() && + (window.getChildren().contains(fancyCalculatorPane))){ + fancyCalculatorMenuItem.setSelected(false); + window.getChildren().remove(fancyCalculatorPane); + window.add(standardCalculatorPane, 0, 1); + } + // if unselected, remove + if (!standardCalculatorMenuItem.isSelected()){ + if (window.getChildren().contains(standardCalculatorPane)){ + window.getChildren().remove(standardCalculatorPane); + } + window.add(simpleCalculatorPane, 0, 1); + simpleCalculatorMenuItem.setSelected(true); + } + } + }); + + simpleCalculatorMenuItem.setOnAction(new EventHandler() { + @Override + public void handle(ActionEvent t) { + // if selected, add + if (simpleCalculatorMenuItem.isSelected() && + (window.getChildren().contains(standardCalculatorPane))){ + standardCalculatorMenuItem.setSelected(false); + window.getChildren().remove(standardCalculatorPane); + window.add(simpleCalculatorPane, 0, 1); + } + if (simpleCalculatorMenuItem.isSelected() && + (window.getChildren().contains(fancyCalculatorPane))){ + fancyCalculatorMenuItem.setSelected(false); + window.getChildren().remove(fancyCalculatorPane); + window.add(simpleCalculatorPane, 0, 1); + } + // if unselected, remove + if (!simpleCalculatorMenuItem.isSelected()){ + if (window.getChildren().contains(simpleCalculatorPane)){ + window.getChildren().remove(simpleCalculatorPane); + } + window.add(standardCalculatorPane, 0, 1); + standardCalculatorMenuItem.setSelected(true); + } + } + }); + + //Handler code for fancyCalculatorMenuItem, using lambda expression + + fancyCalculatorMenuItem.setOnAction(t -> { + // if selected, add + if (fancyCalculatorMenuItem.isSelected() && + (window.getChildren().contains(standardCalculatorPane))){ + standardCalculatorMenuItem.setSelected(false); + window.getChildren().remove(standardCalculatorPane); + window.add(fancyCalculatorPane, 0, 1); + } + if (fancyCalculatorMenuItem.isSelected() && + (window.getChildren().contains(simpleCalculatorPane))){ + simpleCalculatorMenuItem.setSelected(false); + window.getChildren().remove(simpleCalculatorPane); + window.add(fancyCalculatorPane, 0, 1); + } + // if unselected, remove + if (!fancyCalculatorMenuItem.isSelected()){ + if (window.getChildren().contains(fancyCalculatorPane)){ + window.getChildren().remove(fancyCalculatorPane); + } + window.add(standardCalculatorPane, 0, 1); + standardCalculatorMenuItem.setSelected(true); + } + }); + + } + +} + diff --git a/Lesson18/src/application/SimpleCalculatorPane.java b/Lesson18/src/application/SimpleCalculatorPane.java new file mode 100644 index 0000000..b7d1b2b --- /dev/null +++ b/Lesson18/src/application/SimpleCalculatorPane.java @@ -0,0 +1,122 @@ +package application; + +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.control.Button; +import javafx.scene.control.TextField; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; + +public class SimpleCalculatorPane extends CalculatorPane{ + + public SimpleCalculatorPane(){ + super(); + + // Create a GridPane as the root layout node + GridPane window = new GridPane(); + window.setPadding(new Insets(5)); + window.setHgap(5); + window.setVgap(5); + + // Create a BorderPane for the calculator + BorderPane windowContent = new BorderPane(); + + // Create the display field and place it at the Top area of the window + displayField = new TextField(); + displayField.setAlignment(Pos.BASELINE_RIGHT); + windowContent.setTop(displayField); + + // Create the components + button0 = new Button("0"); + button1 = new Button("1"); + button2 = new Button("2"); + button3 = new Button("3"); + button4 = new Button("4"); + button5 = new Button("5"); + button6 = new Button("6"); + button7 = new Button("7"); + button8 = new Button("8"); + button9 = new Button("9"); + buttonPoint = new Button("."); + buttonEqual = new Button("="); + + buttonPlus = new Button("+"); + buttonMinus = new Button("-"); + buttonMult = new Button("*"); + buttonDiv = new Button("/"); + + buttonSQRT = new Button("sqrt"); + buttonMOD = new Button("%"); + buttonINV = new Button("1/x"); + buttonOPP = new Button("+/-"); + + buttonBackspace = new Button("Backspace"); + buttonCE = new Button("CE"); + buttonC = new Button("C"); + + buttonMC = new Button("MC"); + buttonMR = new Button("MR"); + buttonMS = new Button("MS"); + buttonMPlus = new Button("M+"); + + // Set a large preferred size of the buttons, so that they fill the whole space + //in their container + button0.setPrefSize(800, 800); + button1.setPrefSize(800, 800); + button2.setPrefSize(800, 800); + button3.setPrefSize(800, 800); + button4.setPrefSize(800, 800); + button5.setPrefSize(800, 800); + button6.setPrefSize(800, 800); + button7.setPrefSize(800, 800); + button8.setPrefSize(800, 800); + button9.setPrefSize(800, 800); + buttonPoint.setPrefSize(800, 800); + buttonEqual.setPrefSize(800, 800); + + buttonPlus.setPrefSize(80, 800); + buttonMinus.setPrefSize(80, 800); + buttonMult.setPrefSize(80, 800); + buttonDiv.setPrefSize(80, 800); + + // Create a GridPane node to hold 12 buttons – + //10 numeric ones, period, and the equal sign + GridPane gridPane = new GridPane(); + + // Add buttons to the gridPane + gridPane.add(button0,0,0); + gridPane.add(button1,1,0); + gridPane.add(button2,2,0); + gridPane.add(button3,0,1); + gridPane.add(button4,1,1); + gridPane.add(button5,2,1); + gridPane.add(button6,0,2); + gridPane.add(button7,1,2); + gridPane.add(button8,2,2); + gridPane.add(button9,0,3); + gridPane.add(buttonPoint,1,3); + gridPane.add(buttonEqual,2,3); + + // Create a VBox and add Plus, Minus, Mult, Div buttons to it + VBox operations = new VBox(); + operations.getChildren().add(buttonPlus); + operations.getChildren().add(buttonMinus); + operations.getChildren().add(buttonMult); + operations.getChildren().add(buttonDiv); + + // Place the gridPane with buttons at the Center of the window(BorderPane) + windowContent.setCenter(gridPane); + + // Place the VBox with operation buttons (Plus, Minus, Div, Mult) + //at the Right area of the border pane + windowContent.setRight(operations); + + window.add(windowContent, 0, 1); + + getChildren().add(window); + + } + +} + diff --git a/Lesson18/src/application/StandardCalculatorPane.java b/Lesson18/src/application/StandardCalculatorPane.java new file mode 100644 index 0000000..d38c5ea --- /dev/null +++ b/Lesson18/src/application/StandardCalculatorPane.java @@ -0,0 +1,175 @@ +package application; + +import javafx.geometry.HPos; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.geometry.VPos; +import javafx.scene.control.Button; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Priority; + +public class StandardCalculatorPane extends CalculatorPane{ + + private final double BUTTON_PREF_WIDTH = 800; + private final double BUTTON_PREF_HEIGHT = 800; + + public StandardCalculatorPane(){ + super(); + + // Create a GridPane as the root layout node + GridPane windowContent = new GridPane(); + windowContent.setPadding(new Insets(5)); + windowContent.setHgap(5); + windowContent.setVgap(5); + + // Create the display field and set the corresponding constraints + displayField = new TextField(); + displayField.setAlignment(Pos.BASELINE_RIGHT);; + GridPane.setColumnSpan(displayField, 6); // this cell is as wide as 6 other ones + GridPane.setRowSpan(displayField, 1); // this cell has the same height as other cells + GridPane.setFillHeight(displayField, true); + GridPane.setFillWidth(displayField, true); // fill all space in the cell + GridPane.setHalignment(displayField, HPos.CENTER); + GridPane.setValignment(displayField, VPos.CENTER); // position within the cell + GridPane.setHgrow(displayField, Priority.ALWAYS); + GridPane.setVgrow(displayField, Priority.ALWAYS); // grow larger than the preferred size if there is space + + // Add the display field to the window + windowContent.add(displayField, 0, 1); + + // Create the buttons + button0 = new Button("0"); + button1 = new Button("1"); + button2 =new Button("2"); + button3 = new Button("3"); + button4 = new Button("4"); + button5 = new Button("5"); + button6 = new Button("6"); + button7 = new Button("7"); + button8 = new Button("8"); + button9 = new Button("9"); + buttonPoint = new Button("."); + buttonEqual = new Button("="); + + buttonPlus = new Button("+"); + buttonMinus = new Button("-"); + buttonMult = new Button("*"); + buttonDiv = new Button("/"); + + buttonSQRT = new Button("sqrt"); + buttonMOD = new Button("%"); + buttonINV = new Button("1/x"); + buttonOPP = new Button("+/-"); + + buttonBackspace = new Button("Backspace"); + buttonCE = new Button("CE"); + buttonC = new Button("C"); + + buttonMC = new Button("MC"); + buttonMR = new Button("MR"); + buttonMS = new Button("MS"); + buttonMPlus = new Button("M+"); + + // Set a large preferred size of the buttons, + // so that they fill the whole space + // in their container + button0.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + button1.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + button2.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + button3.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + button4.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + button5.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + button6.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + button7.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + button8.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + button9.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonPoint.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonEqual.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + + buttonPlus.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonMinus.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonMult.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonDiv.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + + buttonMC.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonMR.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonMS.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonMPlus.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + + buttonSQRT.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonMOD.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonINV.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + buttonOPP.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + + buttonBackspace.setPrefSize(200, 800); + buttonCE.setPrefSize(200, 800); + buttonC.setPrefSize(200, 800); + + // Add the buttons to the window + windowContent.add(button0,1,6); + windowContent.add(button1,1,5); + windowContent.add(button2,2,5); + windowContent.add(button3,3,5); + windowContent.add(button4,1,4); + windowContent.add(button5,2,4); + windowContent.add(button6,3,4); + windowContent.add(button7,1,3); + windowContent.add(button8,2,3); + windowContent.add(button9,3,3); + windowContent.add(buttonPoint,3,6); + windowContent.add(buttonSQRT,5,3); + windowContent.add(buttonMOD,5,4); + windowContent.add(buttonINV,5,5); + windowContent.add(buttonEqual,5,6); + windowContent.add(buttonOPP,2,6); + + GridPane.setRowIndex(buttonPlus, 6); + GridPane.setColumnIndex(buttonPlus, 4); + GridPane.setRowIndex(buttonMinus, 5); + GridPane.setColumnIndex(buttonMinus, 4); + GridPane.setRowIndex(buttonMult, 4); + GridPane.setColumnIndex(buttonMult, 4); + GridPane.setRowIndex(buttonDiv, 3); + GridPane.setColumnIndex(buttonDiv, 4); + windowContent.getChildren().addAll(buttonPlus, buttonMinus, buttonMult, buttonDiv); + + // First column + GridPane.setRowIndex(buttonMC, 3); + GridPane.setColumnIndex(buttonMC, 0); + buttonMC.setPrefSize(BUTTON_PREF_WIDTH, BUTTON_PREF_HEIGHT); + + GridPane.setRowIndex(buttonMR, 4); + GridPane.setColumnIndex(buttonMR, 0); + GridPane.setRowIndex(buttonMS, 5); + GridPane.setColumnIndex(buttonMS, 0); + GridPane.setRowIndex(buttonMPlus, 6); + GridPane.setColumnIndex(buttonMPlus, 0); + + windowContent.getChildren().addAll(buttonMC, buttonMR, buttonMS, buttonMPlus); + + // First row + GridPane.setHalignment(buttonBackspace, HPos.LEFT); + GridPane.setColumnSpan(buttonBackspace, 2); + GridPane.setFillHeight(buttonBackspace, true); + GridPane.setFillWidth(buttonBackspace, true); // fill all space in the cell + GridPane.setHgrow(buttonBackspace, Priority.ALWAYS); + GridPane.setVgrow(buttonBackspace, Priority.ALWAYS); + GridPane.setMargin(buttonBackspace, new Insets(2,40,2,2)); + windowContent.add(buttonBackspace, 1, 2); + + GridPane.setHalignment(buttonCE, HPos.CENTER); + GridPane.setColumnSpan(buttonCE, 3); + GridPane.setMargin(buttonCE, new Insets(2,40,2,40)); + windowContent.add(buttonCE, 2, 2); + + GridPane.setHalignment(buttonC, HPos.RIGHT); + GridPane.setColumnSpan(buttonC, 2); + GridPane.setMargin(buttonC, new Insets(2,2,2,40)); + windowContent.add(buttonC, 4, 2); + + getChildren().add(windowContent); + + } + +} diff --git a/Lesson18/src/application/application.css b/Lesson18/src/application/application.css new file mode 100644 index 0000000..e69de29 diff --git a/Lesson18/src/application/calculator.css b/Lesson18/src/application/calculator.css new file mode 100644 index 0000000..17e28cb --- /dev/null +++ b/Lesson18/src/application/calculator.css @@ -0,0 +1,120 @@ +@CHARSET "ISO-8859-1"; + +.menu { + -fx-background-color: grey; + -fx-font-family: Helvetica; + -fx-font-size: 18px; +} + +.menu-bar { + -fx-background-color: grey; + -fx-font-family: Helvetica; + -fx-font-size: 18px; +} + +.menu-bar .label{ + -fx-background-color: grey; + -fx-text-fill: yellow; + -fx-font-family: Helvetica; + -fx-font-size: 18px; +} + + +/* the popped up menu of the menuButton is ContextMenu */ + +.context-menu { + -fx-background-color: grey; + -fx-font-family: Helvetica; + -fx-font-size: 18px; +} + +.menu-item { + -fx-background-color: grey; + -fx-font-family: Helvetica; + -fx-font-size: 18px; +} + + +/* +Styles adapted from: +http://fxexperience.com/2011/12/styling-fx-buttons-with-css/ +*/ + +#fancy-button { + -fx-background-color: grey; + -fx-font-family: "Times New Roman"; + -fx-font-size: 18px; + -fx-font-weight: bold; + -fx-text-fill: white; +} + +#big-yellow { + -fx-background-color: + #ecebe9, + rgba(0,0,0,0.05), + linear-gradient(#dcca8a, #c7a740), + linear-gradient(#f9f2d6 0%, #f4e5bc 20%, #e6c75d 80%, #e2c045 100%), + linear-gradient(#f6ebbe, #e6c34d); + -fx-background-insets: 0,5 5 4 5,5,6,7; + -fx-background-radius: 30; + -fx-padding: 5 10 5 10; + -fx-font-family: "Helvetica"; + -fx-font-size: 20px; + -fx-text-fill: #311c09; + -fx-effect: innershadow( three-pass-box , rgba(0,0,0,0.1) , 2, 0.0 , 0 , 1); +} +#big-yellow Text { + -fx-effect: dropshadow( one-pass-box , rgba(255,255,255,0.5) , 0, 0.0 , 0 , 1); +} + +#iphone { + -fx-background-color: + #a6b5c9, + linear-gradient(#303842 0%, #3e5577 20%, #375074 100%), + linear-gradient(#768aa5 0%, #849cbb 5%, #5877a2 50%, #486a9a 51%, #4a6c9b 100%); + -fx-background-insets: 0,5 5 4 5,5,6,7; + -fx-background-radius: 5,5,4; + -fx-padding: 5 10 5 10; + -fx-text-fill: #242d35; + -fx-font-family: "Helvetica"; + -fx-font-size: 18px; + -fx-text-fill: white; +} +#iphone Text { + -fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.8) , 0, 0.0 , 0 , -1 ); +} + +#green { + -fx-background-color: + linear-gradient(#f0ff35, #a9ff00), + radial-gradient(center 50% -40%, radius 200%, #b8ee36 45%, #80c800 50%); + -fx-background-radius: 6, 5; + -fx-background-insets: 0, 1; + -fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.4) , 5, 0.0 , 0 , 1 ); + -fx-text-fill: #395306; +} + +#round-red { + -fx-background-color: linear-gradient(#ff5400, #be1d00); + -fx-background-radius: 30; + -fx-background-insets: 0; + -fx-text-fill: white; + -fx-font-family: "Helvetica"; + -fx-font-size: 18px; + -fx-font-weight: bold; +} + +#shiny-orange { + -fx-background-color: + linear-gradient(#ffd65b, #e68400), + linear-gradient(#ffef84, #f2ba44), + linear-gradient(#ffea6a, #efaa22), + linear-gradient(#ffe657 0%, #f8c202 50%, #eea10b 100%), + linear-gradient(from 0% 0% to 15% 50%, rgba(255,255,255,0.9), rgba(255,255,255,0)); + -fx-background-radius: 30; + -fx-background-insets: 0,1,2,3,0; + -fx-text-fill: #654b00; + -fx-font-weight: bold; + -fx-font-size: 18px; + -fx-padding: 5 10 5 10; +} \ No newline at end of file From b71c4a0372d7f23a99bb3cd4ae514a30a8466c0f Mon Sep 17 00:00:00 2001 From: Cristina Fierbinteanu Date: Tue, 7 Oct 2014 20:20:56 +0300 Subject: [PATCH 2/6] 07oct2014 --- Lesson18/src/application/application.css | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Lesson18/src/application/application.css diff --git a/Lesson18/src/application/application.css b/Lesson18/src/application/application.css deleted file mode 100644 index e69de29..0000000 From 3047497ce9b769f4b072a44770f5156871c6425f Mon Sep 17 00:00:00 2001 From: Cristina Fierbinteanu Date: Thu, 20 Nov 2014 13:00:05 +0200 Subject: [PATCH 3/6] Cristina's changes to DirectMessageSender --- Lesson18/src/application/.classpath | 19 ++++ Lesson18/src/application/.gitignore | 1 + Lesson18/src/application/.project | 36 +++++++ Lesson18/src/application/.settings/.jsdtscope | 12 +++ .../.settings/org.eclipse.jdt.core.prefs | 7 ++ .../org.eclipse.wst.common.component | 8 ++ ....eclipse.wst.common.project.facet.core.xml | 11 +++ ...rg.eclipse.wst.jsdt.ui.superType.container | 1 + .../org.eclipse.wst.jsdt.ui.superType.name | 1 + .../WebContent/META-INF/MANIFEST.MF | 3 + .../WebContent/WEB-INF/glassfish-web.xml | 6 ++ .../src/DirectMessageReceiver.java | 52 ++++++++++ .../application/src/DirectMessageSender.java | 29 ++++++ Lesson30/.classpath | 9 +- Lesson30/.settings/org.eclipse.jdt.core.prefs | 5 + Lesson30/src/Bid.java | 18 ++++ Lesson30/src/DirectMessageReceiver.java | 98 ++++++++++++++----- Lesson30/src/DirectMessageSender.java | 3 +- Lesson30/src/Product.java | 20 ++++ Lesson30/src/User.java | 13 +++ 20 files changed, 321 insertions(+), 31 deletions(-) create mode 100644 Lesson18/src/application/.classpath create mode 100644 Lesson18/src/application/.gitignore create mode 100644 Lesson18/src/application/.project create mode 100644 Lesson18/src/application/.settings/.jsdtscope create mode 100644 Lesson18/src/application/.settings/org.eclipse.jdt.core.prefs create mode 100644 Lesson18/src/application/.settings/org.eclipse.wst.common.component create mode 100644 Lesson18/src/application/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 Lesson18/src/application/.settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 Lesson18/src/application/.settings/org.eclipse.wst.jsdt.ui.superType.name create mode 100644 Lesson18/src/application/WebContent/META-INF/MANIFEST.MF create mode 100644 Lesson18/src/application/WebContent/WEB-INF/glassfish-web.xml create mode 100644 Lesson18/src/application/src/DirectMessageReceiver.java create mode 100644 Lesson18/src/application/src/DirectMessageSender.java create mode 100644 Lesson30/src/Bid.java create mode 100644 Lesson30/src/Product.java create mode 100644 Lesson30/src/User.java diff --git a/Lesson18/src/application/.classpath b/Lesson18/src/application/.classpath new file mode 100644 index 0000000..f8985c6 --- /dev/null +++ b/Lesson18/src/application/.classpath @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Lesson18/src/application/.gitignore b/Lesson18/src/application/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/Lesson18/src/application/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/Lesson18/src/application/.project b/Lesson18/src/application/.project new file mode 100644 index 0000000..8cbd6c3 --- /dev/null +++ b/Lesson18/src/application/.project @@ -0,0 +1,36 @@ + + + Lesson30 + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/Lesson18/src/application/.settings/.jsdtscope b/Lesson18/src/application/.settings/.jsdtscope new file mode 100644 index 0000000..3a28de0 --- /dev/null +++ b/Lesson18/src/application/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Lesson18/src/application/.settings/org.eclipse.jdt.core.prefs b/Lesson18/src/application/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/Lesson18/src/application/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Lesson18/src/application/.settings/org.eclipse.wst.common.component b/Lesson18/src/application/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..e0bd65a --- /dev/null +++ b/Lesson18/src/application/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Lesson18/src/application/.settings/org.eclipse.wst.common.project.facet.core.xml b/Lesson18/src/application/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..0dfc63c --- /dev/null +++ b/Lesson18/src/application/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Lesson18/src/application/.settings/org.eclipse.wst.jsdt.ui.superType.container b/Lesson18/src/application/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/Lesson18/src/application/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/Lesson18/src/application/.settings/org.eclipse.wst.jsdt.ui.superType.name b/Lesson18/src/application/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/Lesson18/src/application/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/Lesson18/src/application/WebContent/META-INF/MANIFEST.MF b/Lesson18/src/application/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/Lesson18/src/application/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/Lesson18/src/application/WebContent/WEB-INF/glassfish-web.xml b/Lesson18/src/application/WebContent/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..ed6200c --- /dev/null +++ b/Lesson18/src/application/WebContent/WEB-INF/glassfish-web.xml @@ -0,0 +1,6 @@ + + + + + /Lesson30 + \ No newline at end of file diff --git a/Lesson18/src/application/src/DirectMessageReceiver.java b/Lesson18/src/application/src/DirectMessageReceiver.java new file mode 100644 index 0000000..afe39da --- /dev/null +++ b/Lesson18/src/application/src/DirectMessageReceiver.java @@ -0,0 +1,52 @@ + +import javax.jms.*; + +import com.sun.messaging.ConnectionFactory; +import com.sun.messaging.ConnectionConfiguration; + + +public class DirectMessageReceiver implements MessageListener{ + + ConnectionFactory factory = new com.sun.messaging.ConnectionFactory(); + JMSConsumer consumer; + + DirectMessageReceiver(){ + try( JMSContext context = factory.createContext("admin","admin")){ + factory.setProperty(ConnectionConfiguration.imqAddressList, "mq://127.0.0.1:7676,mq://127.0.0.1:7676"); + + Destination ordersQueue = context.createQueue("TradingOrdersQueue"); + + consumer = context.createConsumer(ordersQueue); + + consumer.setMessageListener(this); + + System.out.println("Listening to the TradingOrdersQueue..."); + + // Keep the program running - wait for messages + Thread.sleep(100000); + + } catch (InterruptedException e){ + System.out.println("Error: " + e.getMessage()); + } + catch (JMSException e){ + System.out.println("Error: " + e.getMessage()); + } + } + + public void onMessage(Message msg){ + + try{ + System.out.println("Got the text message from the TradingOrdersQueue: " + + msg.getBody(String.class)); + + System.out.println("\n === Here's what toString() on the message prints \n" + msg); + + } catch (JMSException e){ + System.err.println("JMSException: " + e.toString()); + } + } + + public static void main(String[] args){ + new DirectMessageReceiver(); + } +} \ No newline at end of file diff --git a/Lesson18/src/application/src/DirectMessageSender.java b/Lesson18/src/application/src/DirectMessageSender.java new file mode 100644 index 0000000..acd8e9b --- /dev/null +++ b/Lesson18/src/application/src/DirectMessageSender.java @@ -0,0 +1,29 @@ + +import javax.jms.*; + +import com.sun.messaging.ConnectionFactory; +import com.sun.messaging.ConnectionConfiguration; + + +public class DirectMessageSender{ + public static void main(String[] args){ + + ConnectionFactory factory; + + factory = new com.sun.messaging.ConnectionFactory(); + + try( JMSContext context = factory.createContext("admin","admin")){ + + factory.setProperty(ConnectionConfiguration.imqAddressList, "mq://127.0.0.1:7676,mq://127.0.0.1:7676"); + Destination ordersQueue = context.createQueue("TradingOrdersQueue"); + JMSProducer producer = context.createProducer(); + + // Send msg to buy 200 shares of IBM at market price + producer.send(ordersQueue,"IBM 200 Mkt"); + + System.out.println("Sucsessfully placed to TradingOrdersQueue an order to purchase 200 shares of IBM"); + } catch (JMSException e){ + System.out.println("Error: " + e.getMessage()); + } + } +} diff --git a/Lesson30/.classpath b/Lesson30/.classpath index f8985c6..f1e477e 100644 --- a/Lesson30/.classpath +++ b/Lesson30/.classpath @@ -1,11 +1,6 @@ - - - - - @@ -13,7 +8,7 @@ - - + + diff --git a/Lesson30/.settings/org.eclipse.jdt.core.prefs b/Lesson30/.settings/org.eclipse.jdt.core.prefs index 0c68a61..a698e59 100644 --- a/Lesson30/.settings/org.eclipse.jdt.core.prefs +++ b/Lesson30/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,12 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Lesson30/src/Bid.java b/Lesson30/src/Bid.java new file mode 100644 index 0000000..c43bf0e --- /dev/null +++ b/Lesson30/src/Bid.java @@ -0,0 +1,18 @@ + + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * Created by yfain11 on 4/4/14. + */ +public class Bid implements Serializable { + public int id; + public Product product; + public BigDecimal amount; + public int desiredQuantity; // How many items the user wants + public User user; + public LocalDateTime bidTime; + public boolean isWinning; +} diff --git a/Lesson30/src/DirectMessageReceiver.java b/Lesson30/src/DirectMessageReceiver.java index afe39da..241ed05 100644 --- a/Lesson30/src/DirectMessageReceiver.java +++ b/Lesson30/src/DirectMessageReceiver.java @@ -1,46 +1,98 @@ +import java.util.Properties; + import javax.jms.*; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; -import com.sun.messaging.ConnectionFactory; -import com.sun.messaging.ConnectionConfiguration; +//import com.sun.messaging.ConnectionFactory; +//import com.sun.messaging.ConnectionConfiguration; public class DirectMessageReceiver implements MessageListener{ + + Context namingContext = null; - ConnectionFactory factory = new com.sun.messaging.ConnectionFactory(); +//ConnectionFactory factory = new com.sun.messaging.ConnectionFactory(); + JMSConsumer consumer; DirectMessageReceiver(){ - try( JMSContext context = factory.createContext("admin","admin")){ - factory.setProperty(ConnectionConfiguration.imqAddressList, "mq://127.0.0.1:7676,mq://127.0.0.1:7676"); - - Destination ordersQueue = context.createQueue("TradingOrdersQueue"); - - consumer = context.createConsumer(ordersQueue); - - consumer.setMessageListener(this); - - System.out.println("Listening to the TradingOrdersQueue..."); - - // Keep the program running - wait for messages - Thread.sleep(100000); - - } catch (InterruptedException e){ + try{ + // Set up the namingContext for the JNDI lookup + final Properties env = new Properties(); + env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); + env.put(Context.PROVIDER_URL, System.getProperty(Context.PROVIDER_URL, "http-remoting://127.0.0.1:9080")); + env.put(Context.SECURITY_PRINCIPAL, "quickstartUser"); + env.put(Context.SECURITY_CREDENTIALS, "quickstartPwd1!"); + namingContext = new InitialContext(env); + + ConnectionFactory factory = (ConnectionFactory) namingContext.lookup("jms/RemoteConnectionFactory"); + + try( JMSContext context = factory.createContext("quickstartUser","quickstartPwd1!")){ + //factory.setProperty(ConnectionConfiguration.imqAddressList, "mq://127.0.0.1:7676,mq://127.0.0.1:7676"); + + Destination ordersQueue = context.createQueue("testQueue"); + + consumer = context.createConsumer(ordersQueue); + + consumer.setMessageListener(this); + + System.out.println("Listening to the test queue..."); + + // Keep the program running - wait for messages + Thread.sleep(100000); + + } + + } + catch(NamingException e){ + + } + catch (InterruptedException e){ System.out.println("Error: " + e.getMessage()); } - catch (JMSException e){ - System.out.println("Error: " + e.getMessage()); - } +// catch (JMSException e){ +// System.out.println("Error: " + e.getMessage()); +// } + finally { + if (namingContext != null) { + try { + namingContext.close(); + } catch (NamingException e) { + System.out.println(e.getMessage()); + } + } + + + } + } public void onMessage(Message msg){ try{ - System.out.println("Got the text message from the TradingOrdersQueue: " + - msg.getBody(String.class)); + /* System.out.println("Got the text message from the TradingOrdersQueue: " + + msg.getBody(String.class)); */ + /* + if (msg instanceof ObjectMessage) { + Object object = ((ObjectMessage) msg).getObject(); + Bid myBid = (Bid) object; + + // Bid myBid = (Bid)((ObjectMessage) msg).getObject(); + // System.out.println("Received a bid from " + myBid.user.name); + + System.out.println("\n === Here's what toString() on the message prints \n" + myBid); + } + */ + + Bid myBid = msg.getBody(Bid.class); System.out.println("\n === Here's what toString() on the message prints \n" + msg); + + } catch (JMSException e){ System.err.println("JMSException: " + e.toString()); } diff --git a/Lesson30/src/DirectMessageSender.java b/Lesson30/src/DirectMessageSender.java index acd8e9b..2dc1de3 100644 --- a/Lesson30/src/DirectMessageSender.java +++ b/Lesson30/src/DirectMessageSender.java @@ -1,4 +1,4 @@ - +/* import javax.jms.*; import com.sun.messaging.ConnectionFactory; @@ -27,3 +27,4 @@ public static void main(String[] args){ } } } +*/ \ No newline at end of file diff --git a/Lesson30/src/Product.java b/Lesson30/src/Product.java new file mode 100644 index 0000000..b1eea60 --- /dev/null +++ b/Lesson30/src/Product.java @@ -0,0 +1,20 @@ + + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * Created by yfain11 on 4/4/14. + */ +public class Product implements Serializable { + public int id; + public String title; + public String thumb; + public String description; + public int quantity; // How many items the seller has + public LocalDateTime auctionEndTime; + public int watchers; + public BigDecimal minimalPrice; // Don't sell unless the bid is more than min price + public BigDecimal reservedPrice; // If a bidder offers reserved price, the auction is closed +} diff --git a/Lesson30/src/User.java b/Lesson30/src/User.java new file mode 100644 index 0000000..b6c4e3a --- /dev/null +++ b/Lesson30/src/User.java @@ -0,0 +1,13 @@ + + +import java.io.Serializable; + +/** + * Created by yfain11 on 4/4/14. + */ +public class User implements Serializable { + public int id; + public String name; + public String email; + public boolean getOverbidNotifications; +} From 890be9a5107b7978aea5a9abac4bf020b29516eb Mon Sep 17 00:00:00 2001 From: Cristina Fierbinteanu Date: Fri, 18 Dec 2015 22:12:30 +0200 Subject: [PATCH 4/6] added Lesson31 --- Lesson19/.classpath | 2 +- Lesson31.zip | Bin 0 -> 6471 bytes Lesson31/.classpath | 17 ++++++ Lesson31/.gitignore | 1 + Lesson31/.project | 36 ++++++++++++ Lesson31/.settings/.jsdtscope | 12 ++++ Lesson31/.settings/org.eclipse.jdt.core.prefs | 7 +++ .../org.eclipse.wst.common.component | 8 +++ ....eclipse.wst.common.project.facet.core.xml | 11 ++++ ...rg.eclipse.wst.jsdt.ui.superType.container | 1 + .../org.eclipse.wst.jsdt.ui.superType.name | 1 + Lesson31/Lesson31.war | Bin 0 -> 4507 bytes Lesson31/WebContent/META-INF/MANIFEST.MF | 3 + Lesson31/WebContent/WEB-INF/glassfish-web.xml | 6 ++ .../lesson31/client/HelloWorldServlet.java | 28 ++++++++++ Lesson31/src/lesson31/ejb/Authorizable.java | 8 +++ Lesson31/src/lesson31/ejb/Greeting.java | 8 +++ Lesson31/src/lesson31/ejb/HelloWorldBean.java | 24 ++++++++ .../src/lesson31/ejb/HelloWorldLocal.java | 15 +++++ .../lesson31/ejb/HelloWorldLocalRemote.java | 15 +++++ TicTacToe/.classpath | 2 +- TicTacToe/src/tictactoe/TicTacToe.fxml | 37 ++++++++----- .../src/tictactoe/TicTacToeController.java | 6 +- TicTacToe/src/tictactoe/TicTacToeTest.fxml | 52 ++++++++++++++++++ .../src/tictactoe/TicTacToe_Cristina.fxml | 38 +++++++++++++ TicTacToe/src/tictactoe/application.css | 4 +- 26 files changed, 323 insertions(+), 19 deletions(-) create mode 100644 Lesson31.zip create mode 100644 Lesson31/.classpath create mode 100644 Lesson31/.gitignore create mode 100644 Lesson31/.project create mode 100644 Lesson31/.settings/.jsdtscope create mode 100644 Lesson31/.settings/org.eclipse.jdt.core.prefs create mode 100644 Lesson31/.settings/org.eclipse.wst.common.component create mode 100644 Lesson31/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 Lesson31/.settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 Lesson31/.settings/org.eclipse.wst.jsdt.ui.superType.name create mode 100644 Lesson31/Lesson31.war create mode 100644 Lesson31/WebContent/META-INF/MANIFEST.MF create mode 100644 Lesson31/WebContent/WEB-INF/glassfish-web.xml create mode 100644 Lesson31/src/lesson31/client/HelloWorldServlet.java create mode 100644 Lesson31/src/lesson31/ejb/Authorizable.java create mode 100644 Lesson31/src/lesson31/ejb/Greeting.java create mode 100644 Lesson31/src/lesson31/ejb/HelloWorldBean.java create mode 100644 Lesson31/src/lesson31/ejb/HelloWorldLocal.java create mode 100644 Lesson31/src/lesson31/ejb/HelloWorldLocalRemote.java create mode 100644 TicTacToe/src/tictactoe/TicTacToeTest.fxml create mode 100644 TicTacToe/src/tictactoe/TicTacToe_Cristina.fxml diff --git a/Lesson19/.classpath b/Lesson19/.classpath index ec75874..7c10b7d 100644 --- a/Lesson19/.classpath +++ b/Lesson19/.classpath @@ -1,7 +1,7 @@ - + diff --git a/Lesson31.zip b/Lesson31.zip new file mode 100644 index 0000000000000000000000000000000000000000..7bddcbd4746d9a81f7f98fb77e38d1ed0a369c5f GIT binary patch literal 6471 zcmbVR2{@G78y{5>frXX)0p6~gd$Me0v_dUP!p7;FTGxpY8++rXQXeCG_$G}_? znz)sp0|dIx2?B`%|FuDrNCdo=hB_35MUqH?$RNMsleghbFae{kac9Jh7aYn$IOWJ_ z?ie}S7YV)n0gk#O#i7u}xGjo;^GXsAaWzNq#3=-G<$8`Tj3Cv$dP?XBv( zGd?==2Cf#b=x8qTAth7(%x7*t>QrAS?uuKov%HkLaO?cJxO-Go&b!U$HEWb3tGr;E zy9b&dOxJqU>DLx*`Dl0LrHknUwNo7)=@BPe0!8wjLL`xT$ECxkTo3}T1<96|j%mvo zR1uRs;pN!FocBiaQ(j@L(bJE!vbDHB?5-H-KiadQ`>fsZkyp?3ZnJ11%C1VrAi zeXLj;r5xL)7L54RD)WUi48LoKN=Nu%TeF1 z2?ox7ee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4~zPP3LJ~7G@`^xBJlkgP>yCoKWJke+^GNUDMMthk6r}y$h=|>Be^K6-gtr@}? zVhJ~A)H=GRm`l(cR0N#R9+h7>W0=|+!!6Ct91&1kb6X@Ha7m*L7w2813edLH_XzPtIoBSz@GD4FcrTgId5smc42$o8FS8FD(Ke49O1? ziuQs6IuD&_%uj|%Mo%rQ@x0k(HzT4Uk+voRku0Sf^;+|G)sXr8J6Ea5Y5iNZ!nMNZ zK6Z(Fl$9qstx6;(lM%UB*X>e%pG6o+J2Pf4A_Vp6~bY zxw*zZy83ftVob!Of3vn7^7LM$&EwRlcS<^Koz`+fIi9%OclxGoQ>xuDB%f%V(}#W2 zuBauAJe*rsrZSz(*SKRhczP(;2|k+??4lQOro!op&hXrIQG+@O8GCCEPBGB0uSoz- zKmaG-2P03ImnKYrpWhYGEa?E-fEN>hadW@~pf3gcodFXdm<8aw=4P7zm;N#Ps&_zJuvaX~n-A2bZYFEJSH z$PyHNN3b^}G${IxDEucVrgB)`p8Sp~nu?|mTC7fdY*aDkOV`w_fwHS=8V)_sq~GHF zps|?&(ivcvzf52Q{@(@2B8J&P*_A32bnLgFOimfPl^vR0+A*O;fK+73Jr+Wl&`hDn zj?J#1nAj_X{sZ + + + + + + + + + + + + + + + + diff --git a/Lesson31/.gitignore b/Lesson31/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/Lesson31/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/Lesson31/.project b/Lesson31/.project new file mode 100644 index 0000000..8d1bd13 --- /dev/null +++ b/Lesson31/.project @@ -0,0 +1,36 @@ + + + Lesson31 + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/Lesson31/.settings/.jsdtscope b/Lesson31/.settings/.jsdtscope new file mode 100644 index 0000000..3a28de0 --- /dev/null +++ b/Lesson31/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Lesson31/.settings/org.eclipse.jdt.core.prefs b/Lesson31/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/Lesson31/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Lesson31/.settings/org.eclipse.wst.common.component b/Lesson31/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..c806d69 --- /dev/null +++ b/Lesson31/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Lesson31/.settings/org.eclipse.wst.common.project.facet.core.xml b/Lesson31/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..351030d --- /dev/null +++ b/Lesson31/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Lesson31/.settings/org.eclipse.wst.jsdt.ui.superType.container b/Lesson31/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/Lesson31/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/Lesson31/.settings/org.eclipse.wst.jsdt.ui.superType.name b/Lesson31/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/Lesson31/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/Lesson31/Lesson31.war b/Lesson31/Lesson31.war new file mode 100644 index 0000000000000000000000000000000000000000..46839d3270e715e9862546b65ff4ce55632b86d7 GIT binary patch literal 4507 zcmb7H2{_d27am#eShI|+GPW#*$=)I{GJ}vIOWA5>8iO#GAyNJB9Xp|HMMNfC%TU%- zh@ljkkS2;QSxd5vvW5Rlx9$x0rrYuSp68p#ocH_9d%o|S_eGeqbASLqAP^uzaPa+6+-1V zRegNRrvJ?*0K)ti;C!rRw;~;7JN-fYy^nlWq6y130B+WO*uNw){=MnzcfOwpq<_N! zX7uI#ekM5qowgvKr$Nvp}jmXKK>ix9V%JN5NGRTB?1Ml2vn#h4^#a_t%bsE2%^)j+Cs(zZBxV6 zP^(v(1ld-vzH16oCbE{%7bYWHc>i;NtCuU+O~E_J3%vE{nzD8yi8*75 zMNj1Gf?ylv2@=m!THxpUSAAj)2}%{=paCl3>=0NFx!lt8;_e7(Ch-KYmXuiHAO=-F z|IuSYjX>pgX|3a_Eb{O9D3<_VHVLb0Oi~!wNj_R2MA(z>{41^tMt)?UQ?Va}k!*=k zdaXQs%Ax$?rS>C*kr+M)>J^E;D&>@}o7}|9!Y*v&>hzg5!TO+DO$H;6o@;8JN_&u(;fEVGHnXjQU&v``=Gq_yCx5qfNo z*a&31e?w7RWUA6p9sKaL4F6F24hzoW>#nECT{=sR*_>vgK!@ErZ^fQwNS9tAtWu-& z?o60K?P`+T>bcUnJSazfrB;1Mbw~Pogi>hP?!)HNtB9>dMlkgcXS z;uKUazYH3-FZH55?hSk}chVJjvsQI)jmYF%a^URwxaW5`_-3=S9PSC!1Gs{$kif>+ zEz#Bwho7Y8w~T@&@1#jr!@5(|&NbE^vB*S?WK`+J)zAP3w1$x?D#rYInBJKuKtonYXO}do6XocK#cO<>&o_fWcDoITIp6Y|;#3rCxeM zZq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F=LGL2k*I7 z=dA~3oze`Y#EfaK9{@8cX6mN(@T?<*G3uFdk$$*0 + + + + /Lesson31 + \ No newline at end of file diff --git a/Lesson31/src/lesson31/client/HelloWorldServlet.java b/Lesson31/src/lesson31/client/HelloWorldServlet.java new file mode 100644 index 0000000..7375eb7 --- /dev/null +++ b/Lesson31/src/lesson31/client/HelloWorldServlet.java @@ -0,0 +1,28 @@ +package lesson31.client; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.ejb.EJB; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import lesson31.ejb.HelloWorldBean; +import lesson31.ejb.HelloWorldLocal; + +@WebServlet(urlPatterns = { "/HelloWorldServlet" }) +public class HelloWorldServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + @EJB HelloWorldBean myBean; + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + PrintWriter out = response.getWriter(); + out.println(myBean.sayHello()); + + } + +} diff --git a/Lesson31/src/lesson31/ejb/Authorizable.java b/Lesson31/src/lesson31/ejb/Authorizable.java new file mode 100644 index 0000000..1649e5e --- /dev/null +++ b/Lesson31/src/lesson31/ejb/Authorizable.java @@ -0,0 +1,8 @@ +package lesson31.ejb; + +import javax.ejb.Local; + +@Local +public interface Authorizable { + public String authorize(); +} diff --git a/Lesson31/src/lesson31/ejb/Greeting.java b/Lesson31/src/lesson31/ejb/Greeting.java new file mode 100644 index 0000000..4e26e39 --- /dev/null +++ b/Lesson31/src/lesson31/ejb/Greeting.java @@ -0,0 +1,8 @@ +package lesson31.ejb; + +import javax.ejb.Remote; + +@Remote +public interface Greeting { + public String sayHello(); +} diff --git a/Lesson31/src/lesson31/ejb/HelloWorldBean.java b/Lesson31/src/lesson31/ejb/HelloWorldBean.java new file mode 100644 index 0000000..9a3f1bf --- /dev/null +++ b/Lesson31/src/lesson31/ejb/HelloWorldBean.java @@ -0,0 +1,24 @@ +package lesson31.ejb; + +import javax.ejb.LocalBean; +import javax.ejb.Stateless; + +/** + * Session Bean implementation class HelloWorldBean + */ +@Stateless +@LocalBean +public class HelloWorldBean { + + /** + * Default constructor. + */ + public HelloWorldBean() { + // TODO Auto-generated constructor stub + } + + public String sayHello(){ + return "Hello World!"; + } + +} diff --git a/Lesson31/src/lesson31/ejb/HelloWorldLocal.java b/Lesson31/src/lesson31/ejb/HelloWorldLocal.java new file mode 100644 index 0000000..dfc5339 --- /dev/null +++ b/Lesson31/src/lesson31/ejb/HelloWorldLocal.java @@ -0,0 +1,15 @@ +package lesson31.ejb; + +import javax.ejb.Stateless; + +@Stateless +public class HelloWorldLocal implements Authorizable { + + public String authorize(){ + return "The user is authorized!"; + } + + public String sayHello(){ + return "Hello World!"; + } +} diff --git a/Lesson31/src/lesson31/ejb/HelloWorldLocalRemote.java b/Lesson31/src/lesson31/ejb/HelloWorldLocalRemote.java new file mode 100644 index 0000000..b81770f --- /dev/null +++ b/Lesson31/src/lesson31/ejb/HelloWorldLocalRemote.java @@ -0,0 +1,15 @@ +package lesson31.ejb; + +import javax.ejb.Stateless; + +@Stateless +public class HelloWorldLocalRemote implements Authorizable, Greeting { + + public String authorize(){ + return "The user is authorized!"; + } + + public String sayHello(){ + return "Hello World!"; + } +} diff --git a/TicTacToe/.classpath b/TicTacToe/.classpath index ec75874..ac4a647 100644 --- a/TicTacToe/.classpath +++ b/TicTacToe/.classpath @@ -1,7 +1,7 @@ - + diff --git a/TicTacToe/src/tictactoe/TicTacToe.fxml b/TicTacToe/src/tictactoe/TicTacToe.fxml index 192f9a7..37894a5 100644 --- a/TicTacToe/src/tictactoe/TicTacToe.fxml +++ b/TicTacToe/src/tictactoe/TicTacToe.fxml @@ -5,16 +5,13 @@ - + - + @@ -28,18 +25,28 @@
- + -
diff --git a/TicTacToe/src/tictactoe/TicTacToeController.java b/TicTacToe/src/tictactoe/TicTacToeController.java index 0576dcb..9306c44 100644 --- a/TicTacToe/src/tictactoe/TicTacToeController.java +++ b/TicTacToe/src/tictactoe/TicTacToeController.java @@ -24,6 +24,7 @@ public class TicTacToeController { private boolean isFirstPlayer = true; + @FXML public void buttonClickHandler(ActionEvent evt){ Button clickedButton = (Button) evt.getTarget(); @@ -105,6 +106,7 @@ private void highlightWinningCombo(Button first, Button second, Button third){ } + @FXML public void menuClickHandler(ActionEvent evt){ MenuItem clickedMenu = (MenuItem) evt.getTarget(); String menuLabel = clickedMenu.getText(); @@ -115,7 +117,9 @@ public void menuClickHandler(ActionEvent evt){ buttons.forEach(btn -> { ((Button) btn).setText(""); - btn.getStyleClass().remove("winning-button"); + //System.out.println(btn.getStyleClass()); + //if ("button winning-button".equals(btn.getStyleClass().toString())) + btn.getStyleClass().remove("winning-button"); }); isFirstPlayer = true; diff --git a/TicTacToe/src/tictactoe/TicTacToeTest.fxml b/TicTacToe/src/tictactoe/TicTacToeTest.fxml new file mode 100644 index 0000000..9a0ca79 --- /dev/null +++ b/TicTacToe/src/tictactoe/TicTacToeTest.fxml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+
diff --git a/TicTacToe/src/tictactoe/TicTacToe_Cristina.fxml b/TicTacToe/src/tictactoe/TicTacToe_Cristina.fxml new file mode 100644 index 0000000..d1580c1 --- /dev/null +++ b/TicTacToe/src/tictactoe/TicTacToe_Cristina.fxml @@ -0,0 +1,38 @@ + + + + + + + + + +
+ + + + + + + + + + + + + +
+
diff --git a/TicTacToe/src/tictactoe/application.css b/TicTacToe/src/tictactoe/application.css index 63dba86..8c3366c 100644 --- a/TicTacToe/src/tictactoe/application.css +++ b/TicTacToe/src/tictactoe/application.css @@ -1,5 +1,7 @@ .button{ - -fx-focus-color: transparent; + /* -fx-focus-color: transparent; */ + /* -fx-focus-color: inherit; */ + /* -fx-focus-color: initial; */ -fx-background-insets: -1, 0, 1, 1; -fx-font-weight: bold; -fx-font-size: 36; From 0d8fd0e2778270b4037f492fabeef144db7ed697 Mon Sep 17 00:00:00 2001 From: Cristina Fierbinteanu Date: Sat, 19 Dec 2015 12:36:00 +0200 Subject: [PATCH 5/6] added StockServerBean to Lesson31 --- .../lesson31/client/HelloWorldServlet.java | 7 +++-- .../src/lesson31/ejb/StockServerBean.java | 29 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 Lesson31/src/lesson31/ejb/StockServerBean.java diff --git a/Lesson31/src/lesson31/client/HelloWorldServlet.java b/Lesson31/src/lesson31/client/HelloWorldServlet.java index 7375eb7..d8c97c3 100644 --- a/Lesson31/src/lesson31/client/HelloWorldServlet.java +++ b/Lesson31/src/lesson31/client/HelloWorldServlet.java @@ -12,16 +12,19 @@ import lesson31.ejb.HelloWorldBean; import lesson31.ejb.HelloWorldLocal; +import lesson31.ejb.StockServerBean; @WebServlet(urlPatterns = { "/HelloWorldServlet" }) public class HelloWorldServlet extends HttpServlet { private static final long serialVersionUID = 1L; - @EJB HelloWorldBean myBean; + //@EJB HelloWorldBean myBean; + @EJB StockServerBean myBean; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); - out.println(myBean.sayHello()); + //out.println(myBean.sayHello()); + out.println(myBean.getQuote("AMZN")); } diff --git a/Lesson31/src/lesson31/ejb/StockServerBean.java b/Lesson31/src/lesson31/ejb/StockServerBean.java new file mode 100644 index 0000000..6f1b981 --- /dev/null +++ b/Lesson31/src/lesson31/ejb/StockServerBean.java @@ -0,0 +1,29 @@ +package lesson31.ejb; + +import java.util.ArrayList; +import java.util.List; + +import javax.ejb.Stateless; + +@Stateless +public class StockServerBean { + private String price = null; + private List nasdaqSymbols = new ArrayList<>(); + + public StockServerBean(){ + nasdaqSymbols.add("AAPL"); + nasdaqSymbols.add("IBM"); + nasdaqSymbols.add("ORCL"); + nasdaqSymbols.add("AMZN"); + } + + public String getQuote(String symbol){ + + if ((nasdaqSymbols.indexOf(symbol.toUpperCase())) != -1){ + + price = (new Double(Math.random()*100)).toString(); + } + //System.out.println("The price of " + symbol + " is " + price); + return price; + } +} From ad1e344da67f55980441062c518d51e232d7dc8a Mon Sep 17 00:00:00 2001 From: Cristina Fierbinteanu Date: Tue, 26 Apr 2016 09:40:08 +0300 Subject: [PATCH 6/6] added first version of VoteMyHaiku on Azure --- Lesson26_Old/.classpath | 13 ++++ {Lesson26 => Lesson26_Old}/.gitignore | 0 Lesson26_Old/.project | 36 +++++++++++ .../.settings/.jsdtscope | 0 .../.settings/org.eclipse.jdt.core.prefs | 12 ++++ .../org.eclipse.wst.common.component | 8 +++ ....eclipse.wst.common.project.facet.core.xml | 1 + ...rg.eclipse.wst.jsdt.ui.superType.container | 0 .../org.eclipse.wst.jsdt.ui.superType.name | 0 .../org.jboss.ide.eclipse.as.core.prefs | 2 + .../WebContent/META-INF/MANIFEST.MF | 0 .../WebContent/WEB-INF/glassfish-web.xml | 6 ++ .../src/com/practicaljava/lesson26/Book.java | 0 .../lesson26/FindBooksAsyncServlet.java | 0 .../lesson26/FindBooksServlet.java | 2 +- .../lesson26/ShoppingCartServlet.java | 0 Lesson33.zip | Bin 0 -> 8167 bytes Lesson33/Lesson33/.classpath | 17 ++++++ Lesson33/Lesson33/.gitignore | 1 + {Lesson26 => Lesson33/Lesson33}/.project | 2 +- Lesson33/Lesson33/.settings/.jsdtscope | 12 ++++ .../.settings/org.eclipse.jdt.core.prefs | 0 .../org.eclipse.wst.common.component | 6 +- ....eclipse.wst.common.project.facet.core.xml | 11 ++++ ...rg.eclipse.wst.jsdt.ui.superType.container | 1 + .../org.eclipse.wst.jsdt.ui.superType.name | 1 + .../Lesson33/WebContent/META-INF/MANIFEST.MF | 3 + .../WebContent/WEB-INF/glassfish-web.xml | 6 ++ Lesson33/Lesson33/product_from_object.json | 1 + Lesson33/Lesson33/product_from_stream.json | 1 + .../Lesson33/src/json/JavaToJSONObject.java | 49 +++++++++++++++ .../src/json/JavaToJSONStreaming.java | 32 ++++++++++ Lesson33/Lesson33/src/json/Product.java | 12 ++++ .../src/lesson33/StockQuoteApplication.java | 8 +++ .../Lesson33/src/lesson33/service/Stock.java | 54 +++++++++++++++++ .../src/lesson33/service/StockService.java | 52 ++++++++++++++++ .../lesson33/service/StockServiceHelper.java | 29 +++++++++ {Lesson26 => VoteMyHaiku}/.classpath | 4 +- VoteMyHaiku/.gitignore | 1 + VoteMyHaiku/.project | 36 +++++++++++ VoteMyHaiku/.settings/.jsdtscope | 12 ++++ .../oracle.eclipse.tools.webtier.ui.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 7 +++ .../org.eclipse.wst.common.component | 8 +++ ....eclipse.wst.common.project.facet.core.xml | 11 ++++ ...rg.eclipse.wst.jsdt.ui.superType.container | 1 + .../org.eclipse.wst.jsdt.ui.superType.name | 1 + VoteMyHaiku/WebContent/META-INF/MANIFEST.MF | 3 + .../WebContent/WEB-INF/glassfish-web.xml | 6 ++ VoteMyHaiku/WebContent/WEB-INF/web.xml | 12 ++++ .../src/vote/engine/VoteServerServlet.java | 57 ++++++++++++++++++ 51 files changed, 532 insertions(+), 7 deletions(-) create mode 100644 Lesson26_Old/.classpath rename {Lesson26 => Lesson26_Old}/.gitignore (100%) create mode 100644 Lesson26_Old/.project rename {Lesson26 => Lesson26_Old}/.settings/.jsdtscope (100%) create mode 100644 Lesson26_Old/.settings/org.eclipse.jdt.core.prefs create mode 100644 Lesson26_Old/.settings/org.eclipse.wst.common.component rename {Lesson26 => Lesson26_Old}/.settings/org.eclipse.wst.common.project.facet.core.xml (86%) rename {Lesson26 => Lesson26_Old}/.settings/org.eclipse.wst.jsdt.ui.superType.container (100%) rename {Lesson26 => Lesson26_Old}/.settings/org.eclipse.wst.jsdt.ui.superType.name (100%) create mode 100644 Lesson26_Old/.settings/org.jboss.ide.eclipse.as.core.prefs rename {Lesson26 => Lesson26_Old}/WebContent/META-INF/MANIFEST.MF (100%) create mode 100644 Lesson26_Old/WebContent/WEB-INF/glassfish-web.xml rename {Lesson26 => Lesson26_Old}/src/com/practicaljava/lesson26/Book.java (100%) rename {Lesson26 => Lesson26_Old}/src/com/practicaljava/lesson26/FindBooksAsyncServlet.java (100%) rename {Lesson26 => Lesson26_Old}/src/com/practicaljava/lesson26/FindBooksServlet.java (96%) rename {Lesson26 => Lesson26_Old}/src/com/practicaljava/lesson26/ShoppingCartServlet.java (100%) create mode 100644 Lesson33.zip create mode 100644 Lesson33/Lesson33/.classpath create mode 100644 Lesson33/Lesson33/.gitignore rename {Lesson26 => Lesson33/Lesson33}/.project (97%) create mode 100644 Lesson33/Lesson33/.settings/.jsdtscope rename {Lesson26 => Lesson33/Lesson33}/.settings/org.eclipse.jdt.core.prefs (100%) rename {Lesson26 => Lesson33/Lesson33}/.settings/org.eclipse.wst.common.component (65%) create mode 100644 Lesson33/Lesson33/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 Lesson33/Lesson33/.settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 Lesson33/Lesson33/.settings/org.eclipse.wst.jsdt.ui.superType.name create mode 100644 Lesson33/Lesson33/WebContent/META-INF/MANIFEST.MF create mode 100644 Lesson33/Lesson33/WebContent/WEB-INF/glassfish-web.xml create mode 100644 Lesson33/Lesson33/product_from_object.json create mode 100644 Lesson33/Lesson33/product_from_stream.json create mode 100644 Lesson33/Lesson33/src/json/JavaToJSONObject.java create mode 100644 Lesson33/Lesson33/src/json/JavaToJSONStreaming.java create mode 100644 Lesson33/Lesson33/src/json/Product.java create mode 100644 Lesson33/Lesson33/src/lesson33/StockQuoteApplication.java create mode 100644 Lesson33/Lesson33/src/lesson33/service/Stock.java create mode 100644 Lesson33/Lesson33/src/lesson33/service/StockService.java create mode 100644 Lesson33/Lesson33/src/lesson33/service/StockServiceHelper.java rename {Lesson26 => VoteMyHaiku}/.classpath (81%) create mode 100644 VoteMyHaiku/.gitignore create mode 100644 VoteMyHaiku/.project create mode 100644 VoteMyHaiku/.settings/.jsdtscope create mode 100644 VoteMyHaiku/.settings/oracle.eclipse.tools.webtier.ui.prefs create mode 100644 VoteMyHaiku/.settings/org.eclipse.jdt.core.prefs create mode 100644 VoteMyHaiku/.settings/org.eclipse.wst.common.component create mode 100644 VoteMyHaiku/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 VoteMyHaiku/.settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 VoteMyHaiku/.settings/org.eclipse.wst.jsdt.ui.superType.name create mode 100644 VoteMyHaiku/WebContent/META-INF/MANIFEST.MF create mode 100644 VoteMyHaiku/WebContent/WEB-INF/glassfish-web.xml create mode 100644 VoteMyHaiku/WebContent/WEB-INF/web.xml create mode 100644 VoteMyHaiku/src/vote/engine/VoteServerServlet.java diff --git a/Lesson26_Old/.classpath b/Lesson26_Old/.classpath new file mode 100644 index 0000000..bb0832d --- /dev/null +++ b/Lesson26_Old/.classpath @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/Lesson26/.gitignore b/Lesson26_Old/.gitignore similarity index 100% rename from Lesson26/.gitignore rename to Lesson26_Old/.gitignore diff --git a/Lesson26_Old/.project b/Lesson26_Old/.project new file mode 100644 index 0000000..234584a --- /dev/null +++ b/Lesson26_Old/.project @@ -0,0 +1,36 @@ + + + Lesson26_Old + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/Lesson26/.settings/.jsdtscope b/Lesson26_Old/.settings/.jsdtscope similarity index 100% rename from Lesson26/.settings/.jsdtscope rename to Lesson26_Old/.settings/.jsdtscope diff --git a/Lesson26_Old/.settings/org.eclipse.jdt.core.prefs b/Lesson26_Old/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..a698e59 --- /dev/null +++ b/Lesson26_Old/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Lesson26_Old/.settings/org.eclipse.wst.common.component b/Lesson26_Old/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..363decd --- /dev/null +++ b/Lesson26_Old/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Lesson26/.settings/org.eclipse.wst.common.project.facet.core.xml b/Lesson26_Old/.settings/org.eclipse.wst.common.project.facet.core.xml similarity index 86% rename from Lesson26/.settings/org.eclipse.wst.common.project.facet.core.xml rename to Lesson26_Old/.settings/org.eclipse.wst.common.project.facet.core.xml index bec785d..5837e54 100644 --- a/Lesson26/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/Lesson26_Old/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -7,4 +7,5 @@ + diff --git a/Lesson26/.settings/org.eclipse.wst.jsdt.ui.superType.container b/Lesson26_Old/.settings/org.eclipse.wst.jsdt.ui.superType.container similarity index 100% rename from Lesson26/.settings/org.eclipse.wst.jsdt.ui.superType.container rename to Lesson26_Old/.settings/org.eclipse.wst.jsdt.ui.superType.container diff --git a/Lesson26/.settings/org.eclipse.wst.jsdt.ui.superType.name b/Lesson26_Old/.settings/org.eclipse.wst.jsdt.ui.superType.name similarity index 100% rename from Lesson26/.settings/org.eclipse.wst.jsdt.ui.superType.name rename to Lesson26_Old/.settings/org.eclipse.wst.jsdt.ui.superType.name diff --git a/Lesson26_Old/.settings/org.jboss.ide.eclipse.as.core.prefs b/Lesson26_Old/.settings/org.jboss.ide.eclipse.as.core.prefs new file mode 100644 index 0000000..cf3aa3a --- /dev/null +++ b/Lesson26_Old/.settings/org.jboss.ide.eclipse.as.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.jboss.ide.eclipse.as.core.singledeployable.deployableList= diff --git a/Lesson26/WebContent/META-INF/MANIFEST.MF b/Lesson26_Old/WebContent/META-INF/MANIFEST.MF similarity index 100% rename from Lesson26/WebContent/META-INF/MANIFEST.MF rename to Lesson26_Old/WebContent/META-INF/MANIFEST.MF diff --git a/Lesson26_Old/WebContent/WEB-INF/glassfish-web.xml b/Lesson26_Old/WebContent/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..427b823 --- /dev/null +++ b/Lesson26_Old/WebContent/WEB-INF/glassfish-web.xml @@ -0,0 +1,6 @@ + + + + + /Lesson26 + \ No newline at end of file diff --git a/Lesson26/src/com/practicaljava/lesson26/Book.java b/Lesson26_Old/src/com/practicaljava/lesson26/Book.java similarity index 100% rename from Lesson26/src/com/practicaljava/lesson26/Book.java rename to Lesson26_Old/src/com/practicaljava/lesson26/Book.java diff --git a/Lesson26/src/com/practicaljava/lesson26/FindBooksAsyncServlet.java b/Lesson26_Old/src/com/practicaljava/lesson26/FindBooksAsyncServlet.java similarity index 100% rename from Lesson26/src/com/practicaljava/lesson26/FindBooksAsyncServlet.java rename to Lesson26_Old/src/com/practicaljava/lesson26/FindBooksAsyncServlet.java diff --git a/Lesson26/src/com/practicaljava/lesson26/FindBooksServlet.java b/Lesson26_Old/src/com/practicaljava/lesson26/FindBooksServlet.java similarity index 96% rename from Lesson26/src/com/practicaljava/lesson26/FindBooksServlet.java rename to Lesson26_Old/src/com/practicaljava/lesson26/FindBooksServlet.java index 4448f6a..7ecc0b2 100644 --- a/Lesson26/src/com/practicaljava/lesson26/FindBooksServlet.java +++ b/Lesson26_Old/src/com/practicaljava/lesson26/FindBooksServlet.java @@ -30,7 +30,7 @@ public FindBooksServlet() { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub PrintWriter out = response.getWriter(); - out.println("Hello from FindBooks"); + out.println("Hello from me!"); } diff --git a/Lesson26/src/com/practicaljava/lesson26/ShoppingCartServlet.java b/Lesson26_Old/src/com/practicaljava/lesson26/ShoppingCartServlet.java similarity index 100% rename from Lesson26/src/com/practicaljava/lesson26/ShoppingCartServlet.java rename to Lesson26_Old/src/com/practicaljava/lesson26/ShoppingCartServlet.java diff --git a/Lesson33.zip b/Lesson33.zip new file mode 100644 index 0000000000000000000000000000000000000000..579186896bc69ff5dbcb1c84e239d4ffade2d203 GIT binary patch literal 8167 zcmbVR2{@GP_a19y-$KeVBs*hCMUgeTLS#3_U~I$8AZfAh`&yP1S+bL4FA)k65hhS{ogS$O#1qM|JU_ib6u`E_c_n~oaa2}+;diwgp>&c0__DcWXh?sibfuzBm#jR z5Q9LBz<;&iXf)DAQc_G5<^)BfU7;BJqS!{ACJ5E(t|=pf>i0x^G|qehL8QT8?e`Hq zFCF!J?u4aBt)3F-y~U`Q((U4AEiW%SIF=2tHj1f1x7;WofM(DFaSmxZ(TM{*V0hQJei3@$r{j+rz z4X5e~rGM%cd^Az+7mn|+NcN3wab?Ig^k9X`hI3q+F)^Sry&I!`$6pF8SBZ+T)Vb$$ zmH63sZrlVy6FxhXmM%&9<3dH>OP?3K-8WflHA5JiXxb@jbPYKMzlw0%w|^>`r=|5`vVOMHHE#Ep1HN&T{F)yKZ-wl?dey~N*?5` zZX3TN?8@e*0Iw-61=>I(9m9Bm=Kd!hBxxvs(_ zKQCCcMrrC`IW>bB=Xloj@m!4lLIK#lF!*5(l`f41n|7T0hd?(qnKfOdSEdnDoR2Jf zbCqj|Z03ss8!B31%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?kLFOd*JHsa z189}FvgqAv6^h4-wP|Rfy;XaLPl%jlmY=My!H>_Gz0%9k+^^GF; zUtsc@cTgFIAqOUBGy2Hi1tuJssrJni&Hz2lzM}m4qls&E~~{ zStg+(HM-B}s090ylWsRlk4xs5)AP|g3rR89c7IYE3UOZa6-pj`r&`o0G{>mX`P@nB z{(O{7LHs$kYa})NJ?zioFgX)^QC@fD9}SIkHy#_C>GSSlb#RkjZ__LzJK&vcjR0;RuN>k!Ijo~1i{lft$WMXehwSmIZ#4%qw`M0dnUz8c?Q9< za&Dnw;eBHkNBIZGrEq!H|8>QT=Qor9RSebK6)-i%xD*+=IFwAe=B)?ni5Q4T@XsZ|~h^XtRZZpNI zrwb7h1BU@8*muVzw4156f{wbXioSuUwyHMN1z`(EV?+$$C^SHx441elghC0cxQd(w zBv%|T_aG1bVOd5hiaTP&m2EmQN2)r&f(tlCJM^4wF>YGgVI#0bpzTFG;nt$S ztPYPV2F)z*x2)~b{l*~9lDOa3AckEga8jbNa#VG3&Xhf1_EdcxZ5?gK&n{+* z@_Uhn`y%~f{0y>-+0OI*lZG5fcuoes9LHg}_^~ReMx?O**nH#g_ZAA+yNedKwfoNo zRjodb4ECLNXqM82Ublj34J8E59XbB=xh9w<)6zM6?v%3Gj6ioV+BOI%>2`?)!ciYy zEwGjI&&E(ZK68O?b~M{iXFkf^MAr94g<-+*@r4JBat$n;XElk4nLvM*x&cl=04Kkm ztvtaC-*|xC^w{P3Ru%^F6pG|w*0V9-su=cnEX0)sQt|AbAJvdOpu^$gwNV!{3c+j0903j~n zyotvR2h^~wUBoYT+w_UY`kgrJ^oM(}#HrH|U^(Gu!Af*sOfK>eN;M*Es zLKlSX9o_{Ea82&+;?K<<9{uGECR{?ZSieG*w&Zf zlWDik3=4%z0J* + + + + + + + + + + + + + + + + diff --git a/Lesson33/Lesson33/.gitignore b/Lesson33/Lesson33/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/Lesson33/Lesson33/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/Lesson26/.project b/Lesson33/Lesson33/.project similarity index 97% rename from Lesson26/.project rename to Lesson33/Lesson33/.project index 7043bf7..eaf15fe 100644 --- a/Lesson26/.project +++ b/Lesson33/Lesson33/.project @@ -1,6 +1,6 @@ - Lesson26 + Lesson33 diff --git a/Lesson33/Lesson33/.settings/.jsdtscope b/Lesson33/Lesson33/.settings/.jsdtscope new file mode 100644 index 0000000..3a28de0 --- /dev/null +++ b/Lesson33/Lesson33/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Lesson26/.settings/org.eclipse.jdt.core.prefs b/Lesson33/Lesson33/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from Lesson26/.settings/org.eclipse.jdt.core.prefs rename to Lesson33/Lesson33/.settings/org.eclipse.jdt.core.prefs diff --git a/Lesson26/.settings/org.eclipse.wst.common.component b/Lesson33/Lesson33/.settings/org.eclipse.wst.common.component similarity index 65% rename from Lesson26/.settings/org.eclipse.wst.common.component rename to Lesson33/Lesson33/.settings/org.eclipse.wst.common.component index 084c5f3..424e587 100644 --- a/Lesson26/.settings/org.eclipse.wst.common.component +++ b/Lesson33/Lesson33/.settings/org.eclipse.wst.common.component @@ -1,8 +1,8 @@ - + - - + + diff --git a/Lesson33/Lesson33/.settings/org.eclipse.wst.common.project.facet.core.xml b/Lesson33/Lesson33/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..9e3a61b --- /dev/null +++ b/Lesson33/Lesson33/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Lesson33/Lesson33/.settings/org.eclipse.wst.jsdt.ui.superType.container b/Lesson33/Lesson33/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/Lesson33/Lesson33/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/Lesson33/Lesson33/.settings/org.eclipse.wst.jsdt.ui.superType.name b/Lesson33/Lesson33/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/Lesson33/Lesson33/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/Lesson33/Lesson33/WebContent/META-INF/MANIFEST.MF b/Lesson33/Lesson33/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/Lesson33/Lesson33/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/Lesson33/Lesson33/WebContent/WEB-INF/glassfish-web.xml b/Lesson33/Lesson33/WebContent/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..bd888ee --- /dev/null +++ b/Lesson33/Lesson33/WebContent/WEB-INF/glassfish-web.xml @@ -0,0 +1,6 @@ + + + + + /Lesson33 + \ No newline at end of file diff --git a/Lesson33/Lesson33/product_from_object.json b/Lesson33/Lesson33/product_from_object.json new file mode 100644 index 0000000..47cf2ee --- /dev/null +++ b/Lesson33/Lesson33/product_from_object.json @@ -0,0 +1 @@ +{"id":777,"description":"Chanel Handbag","price":1000.0} \ No newline at end of file diff --git a/Lesson33/Lesson33/product_from_stream.json b/Lesson33/Lesson33/product_from_stream.json new file mode 100644 index 0000000..e2606e5 --- /dev/null +++ b/Lesson33/Lesson33/product_from_stream.json @@ -0,0 +1 @@ +{"id":777,"description":"Gucci Handbag","price":1000.0} \ No newline at end of file diff --git a/Lesson33/Lesson33/src/json/JavaToJSONObject.java b/Lesson33/Lesson33/src/json/JavaToJSONObject.java new file mode 100644 index 0000000..f5db64a --- /dev/null +++ b/Lesson33/Lesson33/src/json/JavaToJSONObject.java @@ -0,0 +1,49 @@ +package json; /** + * Created by yfain11 on 4/12/14. + */ + +import javax.json.JsonObject; +import javax.json.Json; +import javax.json.JsonReader; +import javax.json.JsonWriter; +import javax.json.JsonObjectBuilder; + +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.OutputStream; + + +public class JavaToJSONObject { + + public static void main(String[] args) { + + Product prd1 = new Product(777, "Chanel Handbag", 1000.00); + + try (OutputStream fos = new FileOutputStream("product_from_object.json"); + JsonWriter jsonWriter = Json.createWriter(fos);) { + + JsonObjectBuilder prdBuilder = Json.createObjectBuilder(); + + prdBuilder.add("id", prd1.id) + .add("description", prd1.description) + .add("price", prd1.price); + + JsonObject prdJsonObject = prdBuilder.build(); + + System.out.println("prdJsonObject: " + prdJsonObject); + + + jsonWriter.writeObject(prdJsonObject); + + // Read and parse the newly created file back + JsonReader jsonReader = + Json.createReader(new FileReader("product_from_object.json")); + JsonObject jsonObject = jsonReader.readObject(); + System.out.println(jsonObject); + + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/Lesson33/Lesson33/src/json/JavaToJSONStreaming.java b/Lesson33/Lesson33/src/json/JavaToJSONStreaming.java new file mode 100644 index 0000000..65b65a0 --- /dev/null +++ b/Lesson33/Lesson33/src/json/JavaToJSONStreaming.java @@ -0,0 +1,32 @@ +package json; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +import javax.json.Json; +import javax.json.stream.JsonGenerator; + + +public class JavaToJSONStreaming { + + public static void main(String[] args) { + + Product prd1 = new Product(777, "Gucci Handbag", 1000.00); + + try (OutputStream fos = new FileOutputStream("product_from_stream.json"); + JsonGenerator jsonGenerator = Json.createGenerator(fos);) { + + jsonGenerator.writeStartObject(); // { + jsonGenerator.write("id", prd1.id); + jsonGenerator.write("description", prd1.description); + jsonGenerator.write("price", prd1.price); + + // If you have nested JSON objects, enclose each of them + // into a pair of writeStartObject() and writeEnd() + + jsonGenerator.writeEnd(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/Lesson33/Lesson33/src/json/Product.java b/Lesson33/Lesson33/src/json/Product.java new file mode 100644 index 0000000..2ffc5ca --- /dev/null +++ b/Lesson33/Lesson33/src/json/Product.java @@ -0,0 +1,12 @@ +package json; + +public class Product { + public int id; + public String description; + public double price; + public Product(int id, String description, double price){ + this.id=id; + this.description=description; + this.price=price; + } +} diff --git a/Lesson33/Lesson33/src/lesson33/StockQuoteApplication.java b/Lesson33/Lesson33/src/lesson33/StockQuoteApplication.java new file mode 100644 index 0000000..738be7b --- /dev/null +++ b/Lesson33/Lesson33/src/lesson33/StockQuoteApplication.java @@ -0,0 +1,8 @@ +package lesson33; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("resources") +public class StockQuoteApplication extends Application { +} diff --git a/Lesson33/Lesson33/src/lesson33/service/Stock.java b/Lesson33/Lesson33/src/lesson33/service/Stock.java new file mode 100644 index 0000000..14154b0 --- /dev/null +++ b/Lesson33/Lesson33/src/lesson33/service/Stock.java @@ -0,0 +1,54 @@ +package lesson33.service; + +import javax.xml.bind.annotation.XmlRootElement; + + +@XmlRootElement +public class Stock { + private String symbol; + private Double price; + private String currency; + private String country; + + public Stock() { + } + + public Stock(String symbol, Double price, String currency, String country) { + this.symbol = symbol; + this.price = price; + this.currency = currency; + this.country = country; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } +} diff --git a/Lesson33/Lesson33/src/lesson33/service/StockService.java b/Lesson33/Lesson33/src/lesson33/service/StockService.java new file mode 100644 index 0000000..a6e81e5 --- /dev/null +++ b/Lesson33/Lesson33/src/lesson33/service/StockService.java @@ -0,0 +1,52 @@ +package lesson33.service; + +import javax.ws.rs.Consumes; +import javax.ws.rs.FormParam; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Response; + +@Path("/stock") +public class StockService { + + @Produces({"application/xml","application/json"}) + @Path("{symbol}") + @GET + public Stock getStock(@PathParam("symbol") String symbol) { + + Stock stock = StockServiceHelper.getStock(symbol); + + if (stock == null) { + return new Stock("NOT FOUND", 0.0, "--", "--"); + } + + return stock; + } + + @POST + @Consumes("application/x-www-form-urlencoded") + public Response addStock(@FormParam("symbol") String symbol, + @FormParam("currency") String currency, + @FormParam("price") String price, + @FormParam("country") String country) { + + if (StockServiceHelper.getStock(symbol) != null) + return Response.status(Response.Status.BAD_REQUEST). + entity("Stock " + symbol + " already exists").type("text/plain").build(); + + double priceToUse; + try { + priceToUse = new Double(price); + } + catch (NumberFormatException e) { + priceToUse = 0.0; + } + + StockServiceHelper.addStock(new Stock(symbol, priceToUse, currency, country)); + + return Response.ok().build(); + } +} diff --git a/Lesson33/Lesson33/src/lesson33/service/StockServiceHelper.java b/Lesson33/Lesson33/src/lesson33/service/StockServiceHelper.java new file mode 100644 index 0000000..969f0b2 --- /dev/null +++ b/Lesson33/Lesson33/src/lesson33/service/StockServiceHelper.java @@ -0,0 +1,29 @@ +package lesson33.service; + +import java.util.HashMap; +import java.util.Map; + +public class StockServiceHelper { + public static void addStock(Stock stock) { + stocks.put(stock.getSymbol(), stock); + } + + public static void removeStock(String symbol) { + stocks.remove(symbol); + } + + public static Stock getStock(String symbol) { + return stocks.get(symbol); + } + + private static Map stocks = new HashMap<>(); + + static { + generateStocks(); + } + + private static void generateStocks() { + addStock(new Stock("IBM", 43.12, "USD", "USA")); + addStock(new Stock("AAPL", 120.0, "USD", "USA")); + } +} diff --git a/Lesson26/.classpath b/VoteMyHaiku/.classpath similarity index 81% rename from Lesson26/.classpath rename to VoteMyHaiku/.classpath index 6f7fb2f..c51ee43 100644 --- a/Lesson26/.classpath +++ b/VoteMyHaiku/.classpath @@ -1,12 +1,12 @@ - + - + diff --git a/VoteMyHaiku/.gitignore b/VoteMyHaiku/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/VoteMyHaiku/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/VoteMyHaiku/.project b/VoteMyHaiku/.project new file mode 100644 index 0000000..d39de72 --- /dev/null +++ b/VoteMyHaiku/.project @@ -0,0 +1,36 @@ + + + VoteMyHaiku + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/VoteMyHaiku/.settings/.jsdtscope b/VoteMyHaiku/.settings/.jsdtscope new file mode 100644 index 0000000..3a28de0 --- /dev/null +++ b/VoteMyHaiku/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/VoteMyHaiku/.settings/oracle.eclipse.tools.webtier.ui.prefs b/VoteMyHaiku/.settings/oracle.eclipse.tools.webtier.ui.prefs new file mode 100644 index 0000000..e3869fb --- /dev/null +++ b/VoteMyHaiku/.settings/oracle.eclipse.tools.webtier.ui.prefs @@ -0,0 +1,2 @@ +_hiddenCategory_\:HTML=false +eclipse.preferences.version=1 diff --git a/VoteMyHaiku/.settings/org.eclipse.jdt.core.prefs b/VoteMyHaiku/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/VoteMyHaiku/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/VoteMyHaiku/.settings/org.eclipse.wst.common.component b/VoteMyHaiku/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..0090522 --- /dev/null +++ b/VoteMyHaiku/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/VoteMyHaiku/.settings/org.eclipse.wst.common.project.facet.core.xml b/VoteMyHaiku/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..e7b9e36 --- /dev/null +++ b/VoteMyHaiku/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/VoteMyHaiku/.settings/org.eclipse.wst.jsdt.ui.superType.container b/VoteMyHaiku/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/VoteMyHaiku/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/VoteMyHaiku/.settings/org.eclipse.wst.jsdt.ui.superType.name b/VoteMyHaiku/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/VoteMyHaiku/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/VoteMyHaiku/WebContent/META-INF/MANIFEST.MF b/VoteMyHaiku/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/VoteMyHaiku/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/VoteMyHaiku/WebContent/WEB-INF/glassfish-web.xml b/VoteMyHaiku/WebContent/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..8afc6f6 --- /dev/null +++ b/VoteMyHaiku/WebContent/WEB-INF/glassfish-web.xml @@ -0,0 +1,6 @@ + + + + + /VoteMyHaiku + \ No newline at end of file diff --git a/VoteMyHaiku/WebContent/WEB-INF/web.xml b/VoteMyHaiku/WebContent/WEB-INF/web.xml new file mode 100644 index 0000000..4ced97a --- /dev/null +++ b/VoteMyHaiku/WebContent/WEB-INF/web.xml @@ -0,0 +1,12 @@ + + + VoteMyHaiku + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + \ No newline at end of file diff --git a/VoteMyHaiku/src/vote/engine/VoteServerServlet.java b/VoteMyHaiku/src/vote/engine/VoteServerServlet.java new file mode 100644 index 0000000..b4177ee --- /dev/null +++ b/VoteMyHaiku/src/vote/engine/VoteServerServlet.java @@ -0,0 +1,57 @@ +package vote.engine; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class VoteServerServlet + */ +@WebServlet("/vote") +public class VoteServerServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public VoteServerServlet() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + PrintWriter out = response.getWriter(); + String button1 = request.getParameter("smile"); + String button2 = request.getParameter("wait"); + + if (button1 != null) { + out.println(""); + out.println("

Smile!!!

"); + out.println(""); + } + else if (button2 != null){ + out.println(""); + out.println("

Wait!

"); + out.println(""); + } + + } + + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + } + +}