logo

Information Technology - Solved Assignment

11 Pages2112 Words36 Views
   

Added on  2021-04-16

Information Technology - Solved Assignment

   Added on 2021-04-16

ShareRelated Documents
Information Technology[Student University][Student Name]
Information Technology  -  Solved Assignment_1
Testing IdentifiersIdentifierName of testExpected resultgetScreenYinvalidIdentifier1getChildren()validSyntax1rectanglevalidIdentifier1Testing OutputBefore completionAfter completion
Information Technology  -  Solved Assignment_2
Code snippetThe below codes are the codes of each class that was created Nodeview.arrowClicked(event -> { if (shapeList.size() >= 2){ view.setEffect("arrowOn"); view.changeWorkspaceBackgroud("rgba(212, 232, 251, 0.51)"); view.setHelptext("Click on the first shape for starting point..."); final Delta startEnd = new Delta(); shapeList.forEach(shape -> { shape.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { //point A, primary click on mouse: if (!event.isShiftDown()) { startEnd.startX = shape.getTranslateX() + (shape.getLayoutBounds().getWidth() / 2); startEnd.startY = shape.getTranslateY() + (shape.getLayoutBounds().getHeight() / 2); shapeArray[0] = shape; view.setHelptext("Hold shift and click on the second shape for end point."); } //point B, SHIFT + primary click on mouse: if (event.isShiftDown()) { startEnd.endX = shape.getTranslateX() + (shape.getLayoutBounds().getWidth() / 2); startEnd.endY = shape.getTranslateY() + (shape.getLayoutBounds().getHeight() / 2); shapeArray[1] = shape; } //create line: if (shapeArray[0] != null && shapeArray[1] != null) { FlowLine createLine2 = new FlowLine(shapeArray[0], shapeArray[1]);
Information Technology  -  Solved Assignment_3
view.addToWorkspace(createLine2); arrowList.add(createLine2); createLine2.toBack(); shapeArray[0] = null; shapeArray[1] = null; view.setEffect("arrowOff"); view.changeWorkspaceBackgroud("null"); view.setHelptext(""); //clear listeners from all shapes when done(adds the original rightclick listener): rightClickListener(); } } }); }); } else{ //helptext shows for 2seconds. view.setHelptext("Requires at least two shapes."); Timeline timeline = new Timeline(new KeyFrame( Duration.millis(2000), ae -> view.setHelptext(""))); timeline.play(); } });public double getDisplayX() { String text = ""; TextInputDialog dialog = new TextInputDialog(); dialog.setTitle(""); dialog.setHeaderText("Create text"); dialog.setContentText("Please enter your text:"); Optional<String> result = dialog.showAndWait(); if (result.isPresent()){ text = result.get(); } else { text = "cancel";
Information Technology  -  Solved Assignment_4

End of preview

Want to access all the pages? Upload your documents or become a member.