@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setScaleX(0); contentContainer.setScaleY(0); }
@Override protected double computePrefHeight(double width) { return control.prefHeight(width); } };
@Override protected double computePrefWidth(double height) { return control.prefWidth(height); }
@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setTranslateX(-(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())); }
@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setTranslateY(contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY()); }
private static void setConstraint(Node node, Object key, Object value) { if (value == null) { node.getProperties().remove(key); } else { node.getProperties().put(key, value); } if (node.getParent() != null) { node.getParent().requestLayout(); } }
protected void initNode(Node node) { node.setScaleX(0); node.setScaleY(0); node.getStyleClass().add("sub-node"); } }
@Override public Node build() { leftButton = new JFXButton("Alert"); leftButton.setLayoutX(50); leftButton.setLayoutY(50); return new Group(leftButton); }
/** * this method is used to add shadow effect to the node, * however the shadow is not real ( gets affected with node transformations) * <p> * use {@link #createMaterialNode(Node, int)} instead to generate a real shadow */ public static void setDepth(Node control, int level) { level = level < 0 ? 0 : level; level = level > 5 ? 5 : level; control.setEffect(new DropShadow(BlurType.GAUSSIAN, depth[level].getColor(), depth[level].getRadius(), depth[level].getSpread(), depth[level].getOffsetX(), depth[level].getOffsetY())); }
@Override protected double computePrefWidth(double height) { double width = 0.0F; for (Node child : getChildren()) { if (child instanceof TabHeaderContainer && child.isVisible() && (measureClosingTabs || !((TabHeaderContainer) child).isClosing)) { width += child.prefWidth(height); } } return snapSize(width) + snappedLeftInset() + snappedRightInset(); }
Node node = ....; node.addEventHandler(OPTIONS_ALL, event -> handle(...)); node.addEventHandler(BEFORE_STORE, event -> handle(...));
private static Object getConstraint(Node node, Object key) { if (node.hasProperties()) { Object value = node.getProperties().get(key); if (value != null) { return value; } } return null; }
private void bindNodeToController(Node node, Class<?> controllerClass, Flow flow, FlowHandler flowHandler) { flow.withGlobalLink(node.getId(), controllerClass); }
@FXML protected void handleSubmitButtonAction(ActionEvent event) { // you just create new control, all fxml tricks are encapsulated InnerFxmlControl root = new InnerFxmlControl(); // and you can access all its' methods and fields including matched by @FXML tag: root.cb.getItems().add("new item"); Scene cc = buttonStatusText.getScene(); cc.setRoot(root); }
@Override public void requestFocus() { if (getParent() != null) { getParent().requestFocus(); } }
@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setTranslateX(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX()); }
@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setTranslateY(-(contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY())); }