/** * * @param id * @param node * @return */ public Node addReusableNode(String id, Node node) { node.setId(id); getReusableNodes().add(node); return node; }
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected void prepareView() { try { // Build the node by reflection without any parameter or excluded class this.rootNode = (N) ClassUtility.buildGenericType(this.getClass(), Node.class); // Find the RootNodeId annotation final RootNodeId rni = ClassUtility.getLastClassAnnotation(this.getClass(), RootNodeId.class); if (rni != null) { node().setId(rni.value().isEmpty() ? this.getClass().getSimpleName() : rni.value()); } initSimpleView(); } catch (final CoreException ce) { throw new CoreRuntimeException(ce); } }
node().setId(rni.value().isEmpty() ? this.getClass().getSimpleName() : rni.value());
/** * TODO To complete. * * @param mc */ protected void applyStyle(final ModelConfig<?, ?> mc) { if (!ModelConfig.UNDETERMINED.equals(mc.id())) { node().setId(mc.id()); } if (!ModelConfig.UNDETERMINED.equals(mc.style())) { node().setStyle(mc.style()); } if (!ModelConfig.UNDETERMINED.equals(mc.styleClass())) { node().getStyleClass().addAll(mc.styleClass().split(" ")); } }
public Node createReplacement(Node node) { Rectangle2D b = getBounds(node); Node replNode = new ImageView(node.snapshot(new SnapshotParameters(), null)); replacedNodeMap.put(node, replNode); replNode.setUserData(node); replNode.setManaged(false); replNode.setId(ANIM_REPLACE_ID); replNode.resizeRelocate(b.getMinX(), b.getMinY(), b.getWidth(), b.getHeight()); return replNode; }
/** * */ public ResponsivePane() { // just for easy reading SINGULARITY_LAYOUT.getRoot().setId("ResponsivePane.emptyLayout"); // default device sizes setDeviceSize(Device.PHONE, Diagonal.inch(3.5)); setDeviceSize(Device.TABLET, Diagonal.inch(7.0)); setDeviceSize(Device.DESKTOP, Diagonal.inch(13.0)); // react to changes in the available layouts and stylesheets layouts.addListener( (javafx.collections.ListChangeListener.Change<? extends Layout> c) -> { if (getTrace()) System.out.println(">>> requestLayout from changes in layouts, size=" + layouts.size()); requestLayout(); }); sceneStylesheets.addListener( (javafx.collections.ListChangeListener.Change<? extends Stylesheet> c) -> { if (getTrace()) System.out.println(">>> requestLayout from changes in scene stylesheets, size=" + sceneStylesheets.size()); requestLayout(); }); myStylesheets.addListener( (javafx.collections.ListChangeListener.Change<? extends Stylesheet> c) -> { if (getTrace()) System.out.println(">>> requestLayout from changes in my stylesheets, size=" + myStylesheets.size()); requestLayout(); }); }