javafx.scene.Node.getProperties()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中javafx.scene.Node.getProperties()方法的一些代码示例,展示了Node.getProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getProperties()方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:getProperties

Node.getProperties介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

  1. private static Object getConstraint(Node node, Object key) {
  2. if (node.hasProperties()) {
  3. Object value = node.getProperties().get(key);
  4. if (value != null) {
  5. return value;
  6. }
  7. }
  8. return null;
  9. }

代码示例来源:origin: jfoenixadmin/JFoenix

  1. private static void setConstraint(Node node, Object key, Object value) {
  2. if (value == null) {
  3. node.getProperties().remove(key);
  4. } else {
  5. node.getProperties().put(key, value);
  6. }
  7. if (node.getParent() != null) {
  8. node.getParent().requestLayout();
  9. }
  10. }

代码示例来源:origin: org.fxmisc.wellbehaved/wellbehavedfx

  1. private static ObservableMap<Object, Object> getProperties(Node node) {
  2. return node.getProperties();
  3. }
  4. }

代码示例来源:origin: com.miglayout/miglayout-javafx

  1. /** called from the subnodes in FXML via MigPane.cc="..." */
  2. public static void setCc(Node node, CC cc)
  3. {
  4. node.getProperties().put(FXML_CC_KEY, cc);
  5. }

代码示例来源:origin: org.codehaus.griffon/griffon-javafx

  1. /**
  2. * Finds out if an {@code Action} has been registered with the target {@code Node}, returning the action id if found.
  3. *
  4. * @param node the target node on which the action may have been registered.
  5. *
  6. * @return the name of the action registered with the target {@code Node} or {@code null} if not found.
  7. *
  8. * @since 2.8.0
  9. */
  10. @Nullable
  11. public static String getGriffonActionId(@Nonnull Node node) {
  12. requireNonNull(node, ERROR_NODE_NULL);
  13. return (String) node.getProperties().get(Action.class.getName());
  14. }

代码示例来源:origin: org.codehaus.griffon/griffon-javafx

  1. /**
  2. * Associates a {@code Action} with a target {@code Node}.
  3. *
  4. * @param node the target node on which the action will be registered.
  5. * @param actionId the id of the action to be registered.
  6. *
  7. * @since 2.8.0
  8. */
  9. public static void setGriffonActionId(@Nonnull Node node, @Nonnull String actionId) {
  10. requireNonNull(node, ERROR_NODE_NULL);
  11. requireNonBlank(actionId, ERROR_ID_BLANK);
  12. node.getProperties().put(Action.class.getName(), actionId);
  13. }

代码示例来源:origin: org.controlsfx/controlsfx

  1. /***************************************************************************
  2. * *
  3. * Implementation *
  4. * *
  5. **************************************************************************/
  6. private static final ObservableList<Decoration> getDecorations(Node target, boolean createIfAbsent) {
  7. @SuppressWarnings("unchecked")
  8. ObservableList<Decoration> decorations = (ObservableList<Decoration>) target.getProperties().get(DECORATIONS_PROPERTY_KEY);
  9. if (decorations == null && createIfAbsent) {
  10. decorations = FXCollections.observableArrayList();
  11. target.getProperties().put(DECORATIONS_PROPERTY_KEY, decorations);
  12. }
  13. return decorations;
  14. }

代码示例来源:origin: com.jfoenix/jfoenix

  1. private static Object getConstraint(Node node, Object key) {
  2. if (node.hasProperties()) {
  3. Object value = node.getProperties().get(key);
  4. if (value != null) {
  5. return value;
  6. }
  7. }
  8. return null;
  9. }

代码示例来源:origin: com.jfoenix/jfoenix

  1. private static void setConstraint(Node node, Object key, Object value) {
  2. if (value == null) {
  3. node.getProperties().remove(key);
  4. } else {
  5. node.getProperties().put(key, value);
  6. }
  7. if (node.getParent() != null) {
  8. node.getParent().requestLayout();
  9. }
  10. }

代码示例来源:origin: com.guigarage/responsivefx

  1. private static void updateManagedProperty(Node n, DeviceType type) {
  2. // first time we've set this invisible => store the preset
  3. if (!n.getProperties().containsKey(PROP_MANAGED_STATE)) {
  4. n.getProperties().put(PROP_MANAGED_STATE, n.isManaged());
  5. }
  6. // don't track changes through this
  7. n.managedProperty().removeListener(MANAGED_LISTENER);
  8. // If it's visible we use the stored value for "managed" property
  9. n.setManaged(n.isVisible() ? (Boolean) n.getProperties().get(PROP_MANAGED_STATE) : false);
  10. // need to track changes through API
  11. n.managedProperty().addListener(MANAGED_LISTENER);
  12. }

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.panes

  1. /**
  2. * Access the current constraint value
  3. *
  4. * @param node
  5. * the node
  6. * @param key
  7. * the key
  8. * @return the value if associated
  9. */
  10. protected static @Nullable Object getConstraint(@NonNull Node node, @NonNull Object key) {
  11. if (node.hasProperties()) {
  12. Object value = node.getProperties().get(key);
  13. if (value != null) {
  14. return value;
  15. }
  16. }
  17. return null;
  18. }

代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx

  1. Class<?> connectorShapeClass = (Class<?>) n.getProperties().get(ConnectorShape.CONNECTOR_SHAPE_CLASS);
  2. if (nodeClass.isAssignableFrom(result.getClass())) {
  3. return result;

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.panes

  1. /**
  2. * Remember a layout constraint
  3. *
  4. * @param node
  5. * the node
  6. * @param key
  7. * the constraint key
  8. * @param value
  9. * the value
  10. */
  11. protected static void setConstraint(@NonNull Node node, @NonNull Object key, @Nullable Object value) {
  12. if (value == null) {
  13. node.getProperties().remove(key);
  14. } else {
  15. node.getProperties().put(key, value);
  16. }
  17. if (node.getParent() != null) {
  18. node.getParent().requestLayout();
  19. }
  20. }

代码示例来源:origin: org.eclipse.fx/org.eclipse.fx.ui.panes

  1. /**
  2. * Access the current constraint value
  3. *
  4. * @param node
  5. * the node
  6. * @param key
  7. * the key
  8. * @return the value if associated
  9. */
  10. protected static @Nullable Object getConstraint(@NonNull Node node, @NonNull Object key) {
  11. if (node.hasProperties()) {
  12. Object value = node.getProperties().get(key);
  13. if (value != null) {
  14. return value;
  15. }
  16. }
  17. return null;
  18. }

代码示例来源:origin: org.controlsfx/controlsfx

  1. /**
  2. * Removes all the decorations that have previously been set on the given node.
  3. * @param target The node from which all previously set decorations should be removed.
  4. */
  5. public static final void removeAllDecorations(Node target) {
  6. List<Decoration> decorations = getDecorations(target, true);
  7. List<Decoration> removed = FXCollections.observableArrayList(decorations);
  8. target.getProperties().remove(DECORATIONS_PROPERTY_KEY);
  9. updateDecorationsOnNode(target, null, removed);
  10. }

代码示例来源:origin: org.eclipse.fx/org.eclipse.fx.ui.panes

  1. /**
  2. * Remember a layout constraint
  3. *
  4. * @param node
  5. * the node
  6. * @param key
  7. * the constraint key
  8. * @param value
  9. * the value
  10. */
  11. protected static void setConstraint(@NonNull Node node, @NonNull Object key, @Nullable Object value) {
  12. if (value == null) {
  13. node.getProperties().remove(key);
  14. } else {
  15. node.getProperties().put(key, value);
  16. }
  17. if (node.getParent() != null) {
  18. node.getParent().requestLayout();
  19. }
  20. }

代码示例来源:origin: no.tornado/tornadofx-controls

  1. private void configureMnemonicTarget( Node target ){
  2. if( target.getProperties().containsKey("mnemonicTarget") ){
  3. getLabel().setMnemonicParsing(true);
  4. getLabel().setLabelFor(target);
  5. }
  6. }

代码示例来源:origin: no.tornado/tornadofx-controls

  1. public static void setMnemonicTarget( Node target ){
  2. Field parent = NodeHelper.findParentOfType( target, Field.class);
  3. if( parent != null ){
  4. parent.getLabel().setMnemonicParsing(true);
  5. parent.getLabel().setLabelFor(target);
  6. } else {
  7. // we will detect this when this target is added as an input
  8. target.getProperties().put("mnemonicTarget",Boolean.TRUE);
  9. }
  10. }

代码示例来源:origin: org.gillius/jfxutils

  1. Pane parent = (Pane) original.getParent();
  2. replacement.getProperties().putAll( original.getProperties() );
  3. original.getProperties().clear();

代码示例来源:origin: com.miglayout/miglayout-javafx

  1. CC cc = (CC) node.getProperties().remove(FXML_CC_KEY);
  2. FXComponentWrapper wrapper = new FXComponentWrapper(node);

相关文章

Node类方法