(ActionEvent actionEvent)
| 89 | } |
| 90 | // 生成cfg的dot文件 |
| 91 | public void CFGG(ActionEvent actionEvent) { |
| 92 | if (!ConstatField.flag1) { |
| 93 | Alert alert = new Alert(Alert.AlertType.WARNING); |
| 94 | alert.setTitle("Warning"); |
| 95 | alert.setContentText("请重新打开程序在使用生成CFG功能模块!"); |
| 96 | alert.show(); |
| 97 | } |
| 98 | Generate generate = new Generate(); |
| 99 | boolean f = false; |
| 100 | if (!CFGFilePath.equals("")) { |
| 101 | SelectC.selectFile(CFGFilePath,CFGFileName); |
| 102 | f = generate.DotG(graphType.getValue(),CFGFileName); |
| 103 | CFGFileName = ""; |
| 104 | CFGFilePath = ""; |
| 105 | |
| 106 | }else { |
| 107 | String mContext = mC.getText(); |
| 108 | System.out.println(mContext); |
| 109 | if (!mContext.equals("")) { |
| 110 | String clzzname = generate.methodG("methodN", mContext); |
| 111 | f = generate.DotG(graphType.getValue(), clzzname); |
| 112 | }else { |
| 113 | Alert alert = new Alert(Alert.AlertType.ERROR); |
| 114 | alert.setTitle("Error"); |
| 115 | alert.setContentText("请输入方法名和方法内容"); |
| 116 | alert.show(); |
| 117 | System.out.println("请输入方法名和方法内容"); |
| 118 | } |
| 119 | } |
| 120 | if (!f) { |
| 121 | Alert alert = new Alert(Alert.AlertType.ERROR); |
| 122 | alert.setTitle("Exception Dialog"); |
| 123 | alert.setContentText("Something wrong, Please looking the log file"); |
| 124 | }else { |
| 125 | log.info("生成cfg的dot文件成功"); |
| 126 | ImageUtil imageUtil = new ImageUtil(); |
| 127 | String[] path = imageUtil.Dot2Image(); |
| 128 | imageUtil.setImage(path); |
| 129 | } |
| 130 | |
| 131 | } |
| 132 | |
| 133 | // 保存CFG的dot文件 |
| 134 | public void CFGSFile(ActionEvent actionEvent) { |
nothing calls this directly
no test coverage detected