Java Code Examples for javafx.scene.Node#setManaged()

The following examples show how to use javafx.scene.Node#setManaged() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigController.java    From houdoku with MIT License 6 votes vote down vote up
/**
 * Update the content pane using the selected item in the list.
 */
private void updateContent() {
    HBox selected_item = listView.getSelectionModel().getSelectedItem();
    Text selected_text = (Text) selected_item.getChildren().get(1);
    for (Node node : configContentContainer.getChildren()) {
        boolean matches_clicked = node.getUserData().toString().equals(selected_text.getText());
        node.setVisible(matches_clicked);
        node.setManaged(matches_clicked);
    }
}
 
Example 2
Source File: CircularProgressIndicator.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
private void manageNode(final Node NODE, final boolean MANAGED) {
    if (MANAGED) {
        NODE.setManaged(true);
        NODE.setVisible(true);
    } else {
        NODE.setVisible(false);
        NODE.setManaged(false);
    }
}
 
Example 3
Source File: CircularProgressIndicator.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
private void manageNode(final Node NODE, final boolean MANAGED) {
    if (MANAGED) {
        NODE.setManaged(true);
        NODE.setVisible(true);
    } else {
        NODE.setVisible(false);
        NODE.setManaged(false);
    }
}
 
Example 4
Source File: ParagraphOverlayGraphicFactory.java    From markdown-writer-fx with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void createOverlayNodes() {

			paragraphTextNode = getParent().lookup(".paragraph-text");

			for (OverlayFactory overlayFactory : overlayFactories) {
				overlayFactory.init(textArea, paragraphTextNode, gutter);
				List<Node> nodes = overlayFactory.createOverlayNodes(paragraphIndex);
				overlayNodesMap.put(overlayFactory, nodes);

				for (Node node : nodes)
					node.setManaged(false);

				getChildren().addAll(nodes);
			}
		}
 
Example 5
Source File: ResponsiveHandler.java    From ResponsiveFX with Apache License 2.0 5 votes vote down vote up
private static void updateManagedProperty(Node n, DeviceType type) {
    // first time we've set this invisible => store the preset
    if (!n.getProperties().containsKey(PROP_MANAGED_STATE)) {
        n.getProperties().put(PROP_MANAGED_STATE, n.isManaged());
    }
    // don't track changes through this
    n.managedProperty().removeListener(MANAGED_LISTENER);
    // If it's visible we use the stored value for "managed" property
    n.setManaged(n.isVisible() ? (Boolean) n.getProperties().get(PROP_MANAGED_STATE) : false);
    // need to track changes through API
    n.managedProperty().addListener(MANAGED_LISTENER);
}
 
Example 6
Source File: Helper.java    From SpaceFX with Apache License 2.0 4 votes vote down vote up
public static final void enableNode(final Node node, final boolean enable) {
    node.setVisible(enable);
    node.setManaged(enable);
}
 
Example 7
Source File: Helper.java    From OEE-Designer with MIT License 4 votes vote down vote up
public static final void enableNode(final Node NODE, final boolean ENABLE) {
	NODE.setManaged(ENABLE);
	NODE.setVisible(ENABLE);
}
 
Example 8
Source File: Helper.java    From charts with Apache License 2.0 4 votes vote down vote up
public static final void enableNode(final Node NODE, final boolean ENABLE) {
    NODE.setVisible(ENABLE);
    NODE.setManaged(ENABLE);
}
 
Example 9
Source File: Helper.java    From tilesfx with Apache License 2.0 4 votes vote down vote up
public static final void enableNode(final Node NODE, final boolean ENABLE) {
    NODE.setManaged(ENABLE);
    NODE.setVisible(ENABLE);
}
 
Example 10
Source File: Helper.java    From Medusa with Apache License 2.0 4 votes vote down vote up
public static final void enableNode(final Node NODE, final boolean ENABLE) {
    NODE.setManaged(ENABLE);
    NODE.setVisible(ENABLE);
}
 
Example 11
Source File: MainViewController.java    From examples-javafx-repos1 with Apache License 2.0 4 votes vote down vote up
private void applySecurity(Scene s, UserSecurity security, Node n) {

        if( n == null ) return;

        if( n.getProperties().containsKey(NodePropertiesKeyType.commandType) ) {

            //
            // This is a Node that should have security applied
            //
            CommandType command = (CommandType) n.getProperties().get(NodePropertiesKeyType.commandType );
            AccessType access = security.getAccess(command);

            if( log.isDebugEnabled() ) {
                log.debug("[APPLY] command={}, access={}", command, access);
            }

            switch( security.getAccess(command) ) {

                case SHOW:
                    n.setVisible(true);
                    n.setDisable(false);
                    n.setManaged(true);
                    break;
                case HIDE:
                    n.setVisible(false);
                    n.setDisable(true);
                    n.setManaged(false);
                    break;
                case DISABLE:
                    n.setVisible(true);
                    n.setDisable(true);
                    n.setManaged(true);
                    break;
            }
        }

        //
        // Menus and MenuItems are not Nodes
        //
        if( n instanceof MenuBar ) {
            MenuBar mb = (MenuBar)n;
            for( Menu toplevel : mb.getMenus() ) {
                applySecurity( s, security, toplevel );
            }
        }

        if( n instanceof Parent) {
            Parent p = (Parent)n;
            for( Node childNode : p.getChildrenUnmodifiable() ) {
                applySecurity( s, security, childNode );
            }
            p.layout();
        }
    }
 
Example 12
Source File: ShowerHider.java    From AsciidocFX with Apache License 2.0 4 votes vote down vote up
private void makeHidden(Node node) {
    node.setVisible(false);
    node.setManaged(false);
}
 
Example 13
Source File: ShowerHider.java    From AsciidocFX with Apache License 2.0 4 votes vote down vote up
private void makeVisible(Node node) {
    node.setVisible(true);
    node.setManaged(true);
}