@Override protected void setOverLayBounds(Rectangle overlay) { overlay.setWidth(ripplerPane.getWidth()); overlay.setHeight(ripplerPane.getHeight()); }
private void refreshPopup() { Bounds contentBound = this.getLayoutBounds(); double offsetX = Math.ceil(snackbarContainer.getWidth() / 2) - Math.ceil(contentBound.getWidth() / 2); double offsetY = snackbarContainer.getHeight() - contentBound.getHeight(); this.setLayoutX(offsetX); this.setLayoutY(offsetY); }
linesWrapper.promptContainer.getChildren().add(promptText); if (getSkinnable().isFocused() && ((IFXLabelFloatControl) getSkinnable()).isLabelFloat()) { promptText.setTranslateY(-Math.floor(textPane.getHeight())); linesWrapper.promptTextScale.setX(0.85); linesWrapper.promptTextScale.setY(0.85);
linesWrapper.promptContainer.getChildren().add(promptText); if (getSkinnable().isFocused() && ((IFXLabelFloatControl) getSkinnable()).isLabelFloat()) { promptText.setTranslateY(-Math.floor(textPane.getHeight())); linesWrapper.promptTextScale.setX(0.85); linesWrapper.promptTextScale.setY(0.85);
private void updateColor() { final ColorPicker colorPicker = (ColorPicker) getSkinnable(); Color color = colorPicker.getValue(); // update picker box color Color circleColor = color == null ? Color.WHITE : color; Circle colorCircle = new Circle(); colorCircle.setFill(circleColor); colorCircle.setLayoutX(colorBox.getWidth() / 4); colorCircle.setLayoutY(colorBox.getHeight() / 2); colorBox.getChildren().add(colorCircle); Timeline animateColor = new Timeline(new KeyFrame(Duration.millis(240), new KeyValue(colorCircle.radiusProperty(), 200, Interpolator.EASE_BOTH))); animateColor.setOnFinished((finish) -> { JFXNodeUtils.updateBackground(colorBox.getBackground(), colorBox, colorCircle.getFill()); colorBox.getChildren().remove(colorCircle); }); animateColor.play(); // update label color displayNode.setTextFill(circleColor.grayscale().getRed() < 0.5 ? Color.valueOf( "rgba(255, 255, 255, 0.87)") : Color.valueOf("rgba(0, 0, 0, 0.87)")); if (colorLabelVisible.get()) { displayNode.setText(JFXNodeUtils.colorToHex(circleColor)); } else { displayNode.setText(""); } }
WritableImage temp = monthContent.snapshot(snapShotparams, new WritableImage((int) monthContent.getWidth(), (int) monthContent.getHeight())); ImageView tempImage = new ImageView(temp); calendarPlaceHolder.getChildren().add(calendarPlaceHolder.getChildren().size() - 2, tempImage);
@Override protected void setOverLayBounds(Rectangle overlay) { overlay.setWidth(ripplerPane.getWidth()); overlay.setHeight(ripplerPane.getHeight()); }
/** * To bounds Y. * * @param aTranslateY the translate Y * @param aSprite the sprite * @return the double */ private double toBoundsY( double aTranslateY, Node aSprite ) { return toBounds( aTranslateY, aSprite.getBoundsInParent().getHeight(), _scene.getHeight() ); }
private void refreshPopup() { Bounds contentBound = this.getLayoutBounds(); double offsetX = Math.ceil(snackbarContainer.getWidth() / 2) - Math.ceil(contentBound.getWidth() / 2); double offsetY = snackbarContainer.getHeight() - contentBound.getHeight(); this.setLayoutX(offsetX); this.setLayoutY(offsetY); }
/** * To snap Y. * * @param aTranslateY the translate Y * @param aSprite the sprite * @return the double */ private double toSnapY( double aTranslateY, Node aSprite ) { return toSnap( aTranslateY, aSprite.getBoundsInParent().getHeight(), getFieldHeight(), _scene.getHeight() ); }
private void createLegend() { VBox pane = new VBox(); // pane.setScaleX(0.5); // pane.setScaleY(0.5); pane.getChildren().add(new Label("Legend")); pane.getChildren().add(createLegendEntry("adapter", AdapterAnimation.ADAPTER_COLOR)); pane.getChildren().add(createLegendEntry("adapter method call", CallAnimation.ADAPTER_CALL_COLOR)); pane.getChildren().add(createLegendEntry("notify correlation id ", NotifyAnimation.ADAPTER_NOTIFY_COLOR)); pane.getChildren().add(createLegendEntry("workflow launch", LaunchAnimation.ADAPTER_LAUNCH_COLOR)); pane.getChildren().add(createLegendEntry("workflow instance", WorkflowAnimation.WORKFLOW_COLOR)); pane.setStyle("-fx-border-color: black; -fx-border-width: 1;"); pane.setTranslateX(3); pane.setTranslateY(animationPane.getHeight() - 150); animationPane.getChildren().add(pane); }
private void onMouseMoved(MouseEvent event) { double space = 5.0; if (event.getX() < parent.getWidth() / 3 || event.getX() > parent.getWidth() * 2 / 3) { // left right r1.setLayoutX(5); r1.setLayoutY(5); r1.setWidth((overlay.getWidth() - space * 3) / 2); r1.setHeight((overlay.getHeight() - space * 2) / 1); r2.setLayoutX(overlay.getWidth() / 2 + space / 2); r2.setLayoutY(5); r2.setWidth((overlay.getWidth() - space * 3) / 2); r2.setHeight((overlay.getHeight() - space * 2 / 1)); } else { // topbottom r1.setLayoutX(5); r1.setLayoutY(5); r1.setWidth((overlay.getWidth() - space * 2) / 1); r1.setHeight((overlay.getHeight() - space * 3) / 2); r2.setLayoutX(5); r2.setLayoutY(overlay.getHeight() / 2 + space / 2); r2.setWidth((overlay.getWidth() - space * 2) / 1); r2.setHeight((overlay.getHeight() - space * 3) / 2); } }
/** * add a location if there is one * * @param displayContext */ public static void addLocation(DisplayContext displayContext) { // make sure the necessary prerequisites are there if (displayContext.location == null || displayContext.composite == null) return; Pane drawOnGlass = displayContext.mapView.getDrawPane(); UnLocode loc = displayContext.location; DPoint latlon = new DPoint(loc.getLat(), loc.getLon()); DPoint gpd = displayContext.composite.translateLatLonToGrid(latlon.x, latlon.y); IPoint gp = new IPoint(gpd); double value = displayContext.composite.getValue(gp.x, gp.y); // Position now needs to be adapted to screen size DPoint vp = displayContext.composite.translateGridToView(gp, drawOnGlass.getWidth(), drawOnGlass.getHeight()); String text = String.format("%s - %.1f mm", loc.getName(), value); Circle circle = Draw.drawCircleWithText(displayContext.mapView.getDrawPane(), text, 4, Color.BLUE, vp.x, vp.y); if (debug) LOGGER.log(Level.INFO,String.format("x: %.0f y: %.0f",vp.x,vp.y)); //Zoom zoom = new Zoom(displayContext, 12); //zoom.arm(gp, vp); //zoom.triggerOnMouseEntered(circle); } }
linesWrapper.promptContainer.getChildren().add(promptText); if (getSkinnable().isFocused() && ((IFXLabelFloatControl) getSkinnable()).isLabelFloat()) { promptText.setTranslateY(-Math.floor(textPane.getHeight())); linesWrapper.promptTextScale.setX(0.85); linesWrapper.promptTextScale.setY(0.85);
/** * draw a cross on the given pane with the given stroke width and color * * @param pane * @param strokeWidth * @param color */ public static void drawCross(Pane pane, double strokeWidth, Color color) { double w = pane.getWidth(); double h = pane.getHeight(); Line line = new Line(0, 0, w, h); line.setStrokeWidth(strokeWidth); line.setStroke(color); Line line2 = new Line(w, 0, 0, h); line2.setStrokeWidth(strokeWidth); line2.setStroke(color); pane.getChildren().addAll(line, line2); }
pane.getHeight()); Zoom zoom = new Zoom(displayContext, 12); String text = zoom.arm(gp, vp);
root.resize(root.getWidth() + getSkinnable().getInsets().getLeft() + getSkinnable().getInsets().getRight(), root.getHeight() + getSkinnable().getInsets().getTop() + getSkinnable().getInsets().getBottom()); double contentHeight = root.getHeight() - getSkinnable().getInsets().getBottom() - titleBar.prefHeight(0);
private void updateColor() { final ColorPicker colorPicker = (ColorPicker) getSkinnable(); Color color = colorPicker.getValue(); // update picker box color Color circleColor = color == null ? Color.WHITE : color; Circle colorCircle = new Circle(); colorCircle.setFill(circleColor); colorCircle.setLayoutX(colorBox.getWidth() / 4); colorCircle.setLayoutY(colorBox.getHeight() / 2); colorBox.getChildren().add(colorCircle); Timeline animateColor = new Timeline(new KeyFrame(Duration.millis(240), new KeyValue(colorCircle.radiusProperty(), 200, Interpolator.EASE_BOTH))); animateColor.setOnFinished((finish) -> { JFXNodeUtils.updateBackground(colorBox.getBackground(), colorBox, colorCircle.getFill()); colorBox.getChildren().remove(colorCircle); }); animateColor.play(); // update label color displayNode.setTextFill(circleColor.grayscale().getRed() < 0.5 ? Color.valueOf( "rgba(255, 255, 255, 0.87)") : Color.valueOf("rgba(0, 0, 0, 0.87)")); if (colorLabelVisible.get()) { displayNode.setText(JFXNodeUtils.colorToHex(circleColor)); } else { displayNode.setText(""); } }
WritableImage temp = monthContent.snapshot(snapShotparams, new WritableImage((int) monthContent.getWidth(), (int) monthContent.getHeight())); ImageView tempImage = new ImageView(temp); calendarPlaceHolder.getChildren().add(calendarPlaceHolder.getChildren().size() - 2, tempImage);