Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 22.28 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package src.Coordinator;
  7.  
  8.  
  9. import java.io.*;
  10. import java.lang.reflect.Type;
  11. import java.net.ServerSocket;
  12. import java.net.Socket;
  13. import java.net.URL;
  14. import java.util.ArrayList;
  15. import java.util.HashMap;
  16. import java.util.List;
  17. import java.util.ResourceBundle;
  18.  
  19. import java.util.Optional;
  20. import java.util.Scanner;
  21. import javafx.fxml.FXML;
  22. import javafx.fxml.Initializable;
  23. import javafx.scene.control.*;
  24. import javafx.scene.image.ImageView;
  25. import javafx.scene.control.Alert.AlertType;
  26. import javafx.scene.input.MouseEvent;
  27. import javafx.scene.paint.Color;
  28. import javafx.scene.shape.Line;
  29.  
  30. import javafx.util.Pair;
  31. import src.Utils.Coord2PeerControlMeasurement;
  32. import src.Utils.Coord2PeerControlSpecial;
  33. import src.Coordinator.CoordinatorDataHandler;
  34. import src.Utils.TypeID;
  35.  
  36. /**
  37.  * FXML Controller class
  38.  *
  39.  * @author
  40.  */
  41. public class MainPaneController implements Initializable, Serializable {
  42.     private List speedValues;
  43.     private List layer4Values;
  44.     private boolean startBasic;
  45.     private boolean startAdvanced;
  46.     private boolean connected;
  47.     private boolean fastScan;
  48.  
  49.     //--------- BASIC PANEL ---------
  50.     @FXML
  51.     private Button peer_1;
  52.    
  53.     @FXML
  54.     private Line line_1_2;
  55.    
  56.     @FXML
  57.     private ImageView peer_loading;
  58.  
  59.     @FXML
  60.     private ComboBox layer4;
  61.  
  62.     @FXML
  63.     private TextField packetNumber;
  64.  
  65.     @FXML
  66.     private TextField packetSize;
  67.  
  68.     @FXML
  69.     private TextField simulationTime;
  70.  
  71.     @FXML
  72.     private TextField portNumber;
  73.  
  74.     @FXML
  75.     private TextField startDelay;
  76.  
  77.     @FXML
  78.     private TextArea advancedResult;
  79.  
  80.     @FXML
  81.     private ChoiceBox probingChoiceBox;
  82.  
  83.     @FXML
  84.     private ChoiceBox measurementChoiceBox;
  85.  
  86.     @FXML
  87.     private TextArea probingTextArea;
  88.  
  89.     @FXML
  90.     private TextArea alarmTextArea;
  91.  
  92.     @FXML
  93.     private TabPane tabPane;
  94.  
  95.     @FXML
  96.     private Tab resultsTab;
  97.  
  98.     private int refreshRate = 5000;
  99.  
  100.     private static HashMap<TypeID, Pair<String, String>> resultsMap = new HashMap<>();
  101.  
  102.     public MainPaneController() {
  103.     }
  104.  
  105.     /**
  106.      * Initializes the controller class.
  107.      */
  108.     @Override
  109.     public void initialize(URL url, ResourceBundle rb) {
  110.         peer_loading.setVisible(false);
  111.     }
  112.  
  113.  
  114.  
  115.  
  116.  
  117.     //--------- BASIC PANEL ---------
  118.  
  119.     private String destPeer(){
  120.         TextInputDialog dialog = new TextInputDialog("10.0.0.2");
  121.         dialog.setTitle("Select a peer IP from the topology");
  122.         dialog.setHeaderText("Destination src.Peer Selection");
  123.         dialog.setContentText("Please enter the destination peer ip:");
  124.         Optional<String> result = dialog.showAndWait();
  125.         if (result.isPresent()){
  126.             System.out.println("Dest peer: " + result.get());
  127.         }
  128.         return result.get();
  129.         //result.ifPresent(name -> System.out.println("Your name: " + name));
  130.     }
  131.    
  132.     private int probeID(){
  133.         TextInputDialog dialog = new TextInputDialog("1");
  134.         dialog.setTitle("Choose a probe id from the current probings");
  135.         dialog.setHeaderText("Probe ID Selection");
  136.         dialog.setContentText("Please enter the probe id:");
  137.  
  138.         Optional<String> result = dialog.showAndWait();
  139.         if (result.isPresent()){
  140.             System.out.println("Probe id: " + result.get());
  141.         }
  142.         return Integer.parseInt(result.get());
  143.         //result.ifPresent(name -> System.out.println("Your name: " + name));
  144.     }
  145.    
  146.     private char probeTYPE(){
  147.         TextInputDialog dialog = new TextInputDialog("R");
  148.         dialog.setTitle("Choose a probe type from the current probings");
  149.         dialog.setHeaderText("Probe Type Selection");
  150.         dialog.setContentText("Please enter the probe type (R, r, J or P):");
  151.  
  152.         Optional<String> result = dialog.showAndWait();
  153.         if (result.isPresent()){
  154.             System.out.println("Probe type: " + result.get());
  155.         }
  156.         return result.get().charAt(0);
  157.         //result.ifPresent(name -> System.out.println("Your name: " + name));
  158.     }
  159.    
  160.     private String numPackets(){
  161.         TextInputDialog dialog = new TextInputDialog("5");
  162.         dialog.setTitle("Choose the number of packets you wish to send");
  163.         dialog.setHeaderText("Number of Packets Selection");
  164.         dialog.setContentText("Please enter the number of packets to send:");
  165.  
  166.         Optional<String> result = dialog.showAndWait();
  167.         if (result.isPresent()){
  168.             System.out.println("Nr of packets: " + result.get());
  169.         }
  170.         return result.get();
  171.         //result.ifPresent(name -> System.out.println("Your name: " + name));
  172.     }
  173.    
  174.     private String packetSize(){
  175.         TextInputDialog dialog = new TextInputDialog("56");
  176.         dialog.setTitle("Choose the size of the packets you wish to send");
  177.         dialog.setHeaderText("Size of Packets Selection");
  178.         dialog.setContentText("Please enter the size of the packets:");
  179.  
  180.         Optional<String> result = dialog.showAndWait();
  181.         if (result.isPresent()){
  182.             System.out.println("Size of packets: " + result.get());
  183.         }
  184.         return result.get();
  185.         //result.ifPresent(name -> System.out.println("Your name: " + name));
  186.     }
  187.    
  188.     private String feedbackTime(){
  189.         TextInputDialog dialog = new TextInputDialog("20");
  190.         dialog.setTitle("Choose the feedback time of the probing");
  191.         dialog.setHeaderText("Feedback Time Selection");
  192.         dialog.setContentText("Please enter the feedback time you want:");
  193.  
  194.         Optional<String> result = dialog.showAndWait();
  195.         if (result.isPresent()){
  196.             System.out.println("Feedback Time: " + result.get());
  197.         }
  198.         return result.get();
  199.         //result.ifPresent(name -> System.out.println("Your name: " + name));
  200.     }
  201.    
  202.     private char alarmDef(){
  203.         List<String> choices = new ArrayList<>();
  204.        
  205.         choices.add("With Alarm");
  206.         choices.add("No Alarm");
  207.  
  208.         ChoiceDialog<String> dialog2 = new ChoiceDialog<>("With Alarm", choices);
  209.         dialog2.setTitle("Choice Dialog");
  210.         dialog2.setHeaderText("Alarm definition");
  211.         dialog2.setContentText("Alarm: ");
  212.  
  213.         // Traditional way to get the response value.
  214.         Optional<String> result2 = dialog2.showAndWait();
  215.         if (result2.isPresent()){
  216.             System.out.println("Alarm: " + result2.get());
  217.         }
  218.         char choice = '0';
  219.        
  220.         switch (result2.get()) {
  221.             case "With Alarm": {
  222.                 choice = '1';
  223.                 break;
  224.             }
  225.             case "No Alarm": {
  226.                 choice = '0';
  227.                 break;
  228.             }
  229.             default: {
  230.                 System.out.println("ERROR! Invalid Alarm!");
  231.                 break;
  232.             }
  233.         }
  234.         return choice;
  235.     }
  236.    
  237.     private char selectProtocol(){
  238.         List<String> choices = new ArrayList<>();
  239.        
  240.         choices.add("ICMP");
  241.         choices.add("NO ICMP");
  242.  
  243.         ChoiceDialog<String> dialog2 = new ChoiceDialog<>("ICMP", choices);
  244.         dialog2.setTitle("Choice Dialog");
  245.         dialog2.setHeaderText("Measurement definition");
  246.         dialog2.setContentText("Protocol: ");
  247.  
  248.         // Traditional way to get the response value.
  249.         Optional<String> result2 = dialog2.showAndWait();
  250.         if (result2.isPresent()){
  251.             System.out.println("Protocol selected: " + result2.get());
  252.         }
  253.         char choice = '0';
  254.        
  255.         switch (result2.get()) {
  256.             case "ICMP": {
  257.                 choice = '1';
  258.                 break;
  259.             }
  260.             case "NO ICMP": {
  261.                 choice = '0';
  262.                 break;
  263.             }
  264.             default: {
  265.                 System.out.println("ERROR! Invalid Protocol!");
  266.                 break;
  267.             }
  268.         }
  269.         return choice;
  270.     }
  271.    
  272.     private char measurementMode(){  
  273.         List<String> choices2 = new ArrayList<>();
  274.  
  275.         choices2.add("Atomic");
  276.         choices2.add("Normal Loop");
  277.         choices2.add("Statistical Loop");
  278.  
  279.         ChoiceDialog<String> dialog3 = new ChoiceDialog<>("Atomic", choices2);
  280.         dialog3.setTitle("Choice Dialog");
  281.         dialog3.setHeaderText("Measurement definition");
  282.         dialog3.setContentText("Measurement Mode: ");
  283. //        dialog3.getDialogPane().getStylesheets().add(getClass().getResource("../style/myDialogs.css").toExternalForm());
  284. //        dialog3.getDialogPane().getStyleClass().add("myDialog");
  285.         Optional<String> result3 = dialog3.showAndWait();
  286.         if (result3.isPresent()){
  287.             System.out.println("Your choice: " + result3.get());
  288.         }
  289.        
  290.         char choice = '0';
  291.        
  292.         switch (result3.get()) {
  293.             case "Atomic": {
  294.                 choice = '0';
  295.                 break;
  296.             }
  297.             case "Normal Loop": {
  298.                 choice = '1';
  299.                 break;
  300.             }
  301.             case "Statistical Loop": {
  302.                 choice = '2';
  303.                 break;
  304.             }
  305.             default: {
  306.                 System.out.println("ERROR! Invalid Measurement Mode!");
  307.                 break;
  308.             }
  309.         }
  310.         return choice;
  311.     }
  312.    
  313.     private char measurementType(){  
  314.         List<String> choices2 = new ArrayList<>();
  315.  
  316.         choices2.add("RTT");
  317.         choices2.add("Packet Loss");
  318.         choices2.add("Jitter");
  319.         choices2.add("Route Path");
  320.  
  321.         ChoiceDialog<String> dialog4 = new ChoiceDialog<>("RTT", choices2);
  322.         dialog4.setTitle("Choice Dialog");
  323.         dialog4.setHeaderText("Measurement definition");
  324.         dialog4.setContentText("Measurement Type: ");
  325. //        dialog3.getDialogPane().getStylesheets().add(getClass().getResource("../style/myDialogs.css").toExternalForm());
  326. //        dialog3.getDialogPane().getStyleClass().add("myDialog");
  327.         Optional<String> result3 = dialog4.showAndWait();
  328.         if (result3.isPresent()){
  329.             System.out.println("Your choice: " + result3.get());
  330.         }
  331.         char choice = 'R';
  332.        
  333.         switch (result3.get()) {
  334.             case "RTT": {
  335.                 choice = 'R';
  336.                 break;
  337.             }
  338.             case "Packet Loss": {
  339.                 choice = 'P';
  340.                 break;
  341.             }
  342.             case "Jitter": {
  343.                 choice = 'J';
  344.                 break;
  345.             }
  346.             case "Route Path": {
  347.                 choice = 'r';
  348.                 break;
  349.             }
  350.             default: {
  351.                 System.out.println("ERROR! Invalid Measurement Type!");
  352.                 break;
  353.             }
  354.         }
  355.                
  356.         return choice;
  357.     }
  358.    
  359.     private String alarmConditions(){
  360.         TextInputDialog dialog = new TextInputDialog(">0.5");
  361.         dialog.setTitle("Select the alarm contidions you want");
  362.         dialog.setHeaderText("Alarm Condition Selection");
  363.         dialog.setContentText("Please enter the alarm condition (>, <, <=, >=, = or !=)");
  364.  
  365.         Optional<String> result = dialog.showAndWait();
  366.         if (result.isPresent()){
  367.             System.out.println("Alarm condition: " + result.get());
  368.         }
  369.         return result.get();
  370.         //result.ifPresent(name -> System.out.println("Your name: " + name));
  371.     }
  372.    
  373.     @FXML
  374.     private void peer_1Handler(MouseEvent event) throws IOException, ClassNotFoundException {
  375.         ServerSocket dataServerSocket = null;
  376.         Socket sv_peer_control_socket = null;
  377.         int opt=-1, opt2=-1, opt3=-1;
  378.         ObjectInputStream in = null;
  379.  
  380.         ObjectOutputStream out = null;
  381.         Scanner s = new Scanner(System.in);
  382.         Object request = null;
  383.         String peerOrigem = null;
  384.         Socket socket = null;
  385.         HashMap<Character,Integer> probeMap = new HashMap<>();
  386.        
  387.         //socket = new Socket(event.getPickResult().getIntersectedNode().getId(), 8081);
  388.         socket = new Socket("localhost", 8081);
  389.         out = new ObjectOutputStream(socket.getOutputStream());
  390.         in = new ObjectInputStream(socket.getInputStream());
  391.         /* Enviar o endereco do host para o peer saber onde enviar os dados*/
  392.         //out.writeObject(getHostAddress(peerOrigem));
  393.         out.writeObject("localhost");
  394.         out.flush();
  395.        
  396.         //MUDAR O NOME DELES PARA OS IPS
  397.         //System.out.println(System.out.println(event.getClass().getName().toString()));
  398.         System.out.println(event.getPickResult().getIntersectedNode());
  399.         System.out.println(event.getPickResult().getIntersectedNode().getId());
  400.  
  401.         Alert alert = new Alert(AlertType.CONFIRMATION);
  402.         alert.setTitle("src/Peer");
  403.         alert.setHeaderText("Create a new probing or cancel a probing.");
  404.         alert.setContentText("Choose your option.");
  405.  
  406.         ButtonType buttonTypeOne = new ButtonType("New Probing");
  407.         ButtonType buttonTypeTwo = new ButtonType("Cancel a Probing");
  408.    
  409.  
  410.         alert.getButtonTypes().setAll(buttonTypeOne, buttonTypeTwo);
  411.  
  412.         Optional<ButtonType> result = alert.showAndWait();
  413.         if (result.get() == buttonTypeOne){
  414.             String peerDest = destPeer();
  415.            
  416.             char measurementType = measurementType();
  417.            
  418.             char ICMP = selectProtocol();
  419.            
  420.             char loop = measurementMode();
  421.             int probeID = 1;
  422.             int nrpackets = 1;
  423.             int packetsize = 56;
  424.  
  425.             if(loop == '0' || (measurementType == 'P' && loop == '1')){
  426.                 nrpackets = Integer.parseInt(numPackets());
  427.                 packetsize = Integer.parseInt(packetSize());
  428.             }
  429.             else{
  430.                 packetsize = Integer.parseInt(packetSize());
  431.             }
  432.             char ALARM = alarmDef();
  433.             String feedbackTime;
  434.             if(measurementType == 'r'){
  435.                 probeID = incrementProbe_ID(probeMap, 'r');
  436.                 if(loop == '0') {
  437.                     request = new Coord2PeerControlMeasurement(probeID, 1, 'r', peerOrigem, peerDest, loop);
  438.                 }
  439.                 if(loop == '1'){
  440.                     feedbackTime = feedbackTime();
  441.                     request = new Coord2PeerControlMeasurement(probeID,1,'r', peerOrigem, peerDest, loop, feedbackTime, ALARM, "!!");
  442.                 }
  443.                 if(loop == '2') {
  444.                     request = new Coord2PeerControlMeasurement(probeID, 1, 'r', peerOrigem, peerDest, loop, ALARM, "!!");
  445.                 }
  446.             }
  447.  
  448.             if(ALARM == '0' && loop == '0') {
  449.                 probeID = incrementProbe_ID(probeMap, measurementType);
  450.                 request = new Coord2PeerControlMeasurement(probeID, 1, measurementType, peerOrigem, peerDest, nrpackets, packetsize, loop, ICMP);
  451.             }
  452.             if(ALARM == '1' && loop == '0'){
  453.                 probeID = incrementProbe_ID(probeMap, measurementType);
  454.                 String alarmCondition = alarmConditions();
  455.                 request = new Coord2PeerControlMeasurement(probeID,1,measurementType,peerOrigem, peerDest, nrpackets, packetsize, loop, ICMP,  ALARM, alarmCondition);
  456.             }
  457.             if(ALARM == '0' && loop == '1'){
  458.                 probeID = incrementProbe_ID(probeMap, measurementType);
  459.                 feedbackTime = feedbackTime();
  460.                 request = new Coord2PeerControlMeasurement(probeID,1,measurementType,peerOrigem, peerDest, nrpackets, packetsize, loop, ICMP, feedbackTime);
  461.             }
  462.             if(ALARM == '1' && loop == '1'){
  463.                 probeID = incrementProbe_ID(probeMap, measurementType);
  464.                 feedbackTime = feedbackTime();
  465.                 String alarmCondition = alarmConditions();
  466.                 request = new Coord2PeerControlMeasurement(probeID,1,measurementType, peerOrigem, peerDest, nrpackets, packetsize, loop, ICMP, feedbackTime, ALARM, alarmCondition);
  467.             }
  468.             if(ALARM == '0' && loop == '2'){
  469.                 probeID = incrementProbe_ID(probeMap, measurementType);
  470.                 request = new Coord2PeerControlMeasurement(probeID,1,measurementType, peerOrigem, peerDest, 1, packetsize, loop, ICMP);
  471.             }
  472.             if(ALARM == '1' && loop == '2'){
  473.                 probeID = incrementProbe_ID(probeMap, measurementType);
  474.                 String alarmCondition = alarmConditions();
  475.                 request = new Coord2PeerControlMeasurement(probeID,1,measurementType, peerOrigem, peerDest, 1, packetsize, loop, ICMP, ALARM, alarmCondition);
  476.             }
  477.             out.writeObject(request);
  478.             out.flush();
  479.  
  480.             byte[] buffer = new byte[2048];
  481.             StringBuilder sb = new StringBuilder();
  482.             System.out.println(in.readObject().toString());
  483.  
  484.             /* Atribuir request a null para o novo request ser preenchido */
  485.             request = null;
  486.  
  487.  
  488.             // Refresh na lista de probes e measurements na aba results
  489.             this.resultsMap.put(new TypeID(measurementType,probeID), new Pair<>("", ""));
  490.  
  491.             // Adicionar às choice boxes
  492.             measurementChoiceBox.getItems().add(measurementType);
  493.             probingChoiceBox.getItems().add(probeID);
  494.  
  495.             // fechar socket
  496.             socket.close();
  497.            
  498.             line_1_2.setStroke(Color.GREEN);
  499.             peer_loading.setVisible(true);
  500.            
  501.         } else if (result.get() == buttonTypeTwo) {
  502.             peer_loading.setVisible(false);
  503.             line_1_2.setStroke(Color.WHITE);
  504.             // CANCEL
  505.  
  506.             request = new Coord2PeerControlSpecial(probeID(), 'C', probeTYPE());
  507.             out.writeObject(request);
  508.             out.flush();
  509.            
  510.             byte[] buffer = new byte[2048];
  511.             StringBuilder sb = new StringBuilder();
  512.             System.out.println(in.readObject().toString());
  513.             /* Atribuir request a null para o novo request ser preenchido */
  514.             request = null;
  515.             socket.close();
  516.         } else {
  517.             // ... CLOSED DIALOG
  518.         }
  519.        
  520.     }
  521.    
  522.     public static String getHostAddress(String peerOrigem){
  523.         String res=null,sb;
  524.         try{
  525.         Process p = Runtime.getRuntime().exec( "ip route get " + peerOrigem);
  526.             BufferedReader stdInput = new BufferedReader(new
  527.                     InputStreamReader(p.getInputStream()));
  528.  
  529.             if((sb = stdInput.readLine()) != null){
  530.                 res = sb.split("src ")[1].split(" +")[0];
  531.             }
  532.         }catch(Exception e){ e.printStackTrace(); }
  533.         return res;
  534.     }
  535.    
  536.     public int incrementProbe_ID(HashMap<Character, Integer> map, char type){
  537.         if(map.containsKey(type)){
  538.             int id = map.get(type)+1;
  539.             map.put(type,id);
  540.             return id;
  541.         }
  542.         else{
  543.             map.put(type,1);
  544.             return 1;
  545.         }
  546.     }
  547.    
  548.     public static boolean isNum(String str){
  549.         try{  
  550.             int d = Integer.parseInt(str);
  551.         }  
  552.         catch(NumberFormatException e){  
  553.             return false;  
  554.         }
  555.  
  556.         return true;  
  557.     }
  558.  
  559.     /******************************************************************************************************************/
  560.     /** EVENTS AND RESULTS HANDLING**/
  561.  
  562.     public Pair<String,String> refreshResults(int probeID,char type){
  563.         Pair <String,String> p;
  564.  
  565.         String res = new String("");
  566.         String alarm = new String("");
  567.  
  568.         if (probeID != -1 && type != 'Z') {
  569.             p = this.resultsMap.get(new TypeID(type, probeID));
  570.         }
  571.  
  572.         else if(probeID != -1 && type == 'Z'){
  573.             for (TypeID typeID : this.resultsMap.keySet()) {
  574.                 if(typeID.getPROBE_ID() == probeID) {
  575.                     res = res.concat(this.resultsMap.get(typeID).getKey());
  576.                     alarm = alarm.concat(this.resultsMap.get(typeID).getValue());
  577.                 }
  578.             }
  579.             p = new Pair<>(res,alarm);
  580.         }
  581.  
  582.         else if(probeID == -1 && type != 'Z'){
  583.             for (TypeID typeID : this.resultsMap.keySet()) {
  584.                 if(typeID.getTYPE() == type) {
  585.                     res = res.concat(this.resultsMap.get(typeID).getKey());
  586.                     alarm = alarm.concat(this.resultsMap.get(typeID).getValue());
  587.                 }
  588.             }
  589.             p = new Pair<>(res,alarm);
  590.         }
  591.  
  592.         else {
  593.             for (Pair<String, String> aux: this.resultsMap.values()) {
  594.                 res = res.concat(aux.getKey());
  595.                 alarm = alarm.concat(aux.getValue());
  596.             }
  597.             p = new Pair<>(res,alarm);
  598.         }
  599.  
  600.         return p;
  601.     }
  602.  
  603.     public static void putOnMap(TypeID id, Pair<String, String> pair){
  604.         String alarm;
  605.         String res;
  606.         System.out.println("PROBE_ID: "+id.getPROBE_ID());
  607.         System.out.println("PAIR KEY: "+pair.getKey());
  608.         System.out.println("SIZE: " + resultsMap.size());
  609.         if(resultsMap.containsKey(id)){
  610.             System.out.println(resultsMap.get(id).getKey());
  611.             res = resultsMap.get(id).getKey() + pair.getKey();
  612.             alarm = resultsMap.get(id).getValue() + pair.getValue();
  613.             resultsMap.put(id, new Pair<>(res,alarm));
  614.         }
  615.         else{
  616.             resultsMap.put(id, pair);
  617.         }
  618.     }
  619.  
  620.     @FXML
  621.     private void resultsRefreshEvent(){
  622.  
  623.         int probeID = -1;
  624.         char type = 'Z';
  625.  
  626.         // Receber os dados dos resultados do Coordinator e colocar no Map
  627.  
  628.         System.out.println("SIZE: "+resultsMap.size());
  629.  
  630.         if(probingChoiceBox.getSelectionModel().getSelectedItem() != null)
  631.             probeID = (int) probingChoiceBox.getSelectionModel().getSelectedItem();
  632.         if(measurementChoiceBox.getSelectionModel().getSelectedItem() != null)
  633.             type = (char) measurementChoiceBox.getSelectionModel().getSelectedItem();
  634.  
  635.         Pair<String, String> p = refreshResults(probeID, type);
  636.  
  637.         // Key == RESULT
  638.         probingTextArea.setText(p.getKey());
  639.         // Value == ALARM
  640.         alarmTextArea.setText(p.getValue());
  641.  
  642.     }
  643.  
  644.     // EVENTO DE ATUALIZAR A PROBING CHOICE BOX E A MEASUREMENT CHOICE BOX QUANDO UMA PROBE É EFETUADA
  645. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement