()
| 179 | } |
| 180 | |
| 181 | protected void buildSelectionHelpers() { |
| 182 | double lineSelectionGap = 100; |
| 183 | double endGap = this.arrowEnd.getAdditionalGap(); |
| 184 | double startGap = this.arrowStart.getAdditionalGap(); |
| 185 | PhongMaterial material = new PhongMaterial(); |
| 186 | material.setDiffuseColor(Color.DODGERBLUE); |
| 187 | Box lineSelectionHelper = new Box(SELECTION_HELPER_WIDTH, SELECTION_HELPER_WIDTH, this.line.getDepth() - lineSelectionGap); |
| 188 | lineSelectionHelper.depthProperty().bind(this.line.depthProperty().subtract(lineSelectionGap).add((endGap + startGap) / 2)); |
| 189 | lineSelectionHelper.translateXProperty().bind(this.line.translateXProperty()); |
| 190 | lineSelectionHelper.translateYProperty().bind(this.line.translateYProperty()); |
| 191 | lineSelectionHelper.translateZProperty().bind(this.line.translateZProperty().subtract((-endGap + startGap) / 4)); |
| 192 | lineSelectionHelper.rotateProperty().bind(this.line.rotateProperty()); |
| 193 | lineSelectionHelper.setOpacity(0.0); // dont want to see it, but still receive mouse events |
| 194 | this.lineSelectionHelpers.add(lineSelectionHelper); |
| 195 | |
| 196 | this.startSelectionHelper = new Box(SELECTION_HELPER_WIDTH, SELECTION_HELPER_WIDTH / 2, lineSelectionGap / 2); |
| 197 | this.startSelectionHelper.setMaterial(material); // for debugging |
| 198 | this.startSelectionHelper.translateXProperty().bind(this.line.translateXProperty()); |
| 199 | this.startSelectionHelper.translateYProperty().bind(this.line.translateYProperty()); |
| 200 | this.startSelectionHelper.translateZProperty().bind(this.line.translateZProperty().subtract(this.line.depthProperty().divide(2)).subtract(startGap / 2).add(lineSelectionGap / 4)); |
| 201 | this.startSelectionHelper.rotateProperty().bind(this.line.rotateProperty()); |
| 202 | this.startSelectionHelper.setOpacity(0.0); // dont want to see it, but still receive mouse events |
| 203 | |
| 204 | this.endSelectionHelper = new Box(SELECTION_HELPER_WIDTH, SELECTION_HELPER_WIDTH / 2, lineSelectionGap / 2); |
| 205 | this.endSelectionHelper.setMaterial(material); // for debugging |
| 206 | this.endSelectionHelper.translateXProperty().bind(this.line.translateXProperty()); |
| 207 | this.endSelectionHelper.translateYProperty().bind(this.line.translateYProperty()); |
| 208 | this.endSelectionHelper.translateZProperty().bind(this.line.translateZProperty().add(this.line.depthProperty().divide(2)).add(endGap / 2).subtract(lineSelectionGap / 4)); |
| 209 | this.endSelectionHelper.rotateProperty().bind(this.line.rotateProperty()); |
| 210 | this.endSelectionHelper.setOpacity(0.0); // dont want to see it, but still receive mouse events |
| 211 | } |
| 212 | |
| 213 | protected void addElementsToGroup() { |
| 214 | getChildren().clear(); |
no test coverage detected