documentationfor yFiles for HTML 3.0.0.3

FolderNodeDefaults

A helper class that provides configuration options and helper methods that can be used in the context of initializing and updating folder nodes.

Inheritance Hierarchy
FolderNodeDefaults

Remarks

This class can be used to manage and synchronize the state of folder nodes in implementations of the IFolderNodeConverter interfaces. Start by configuring the initializeOptions, updateFoldingOptions, and updateMasterOptions, as well as copyLabels, to match your synchronization requirements and use the style and other properties to set a default value for the initialization. The labels property can be configured to recursively define the behavior for the immediate labels at the node. Likewise, the ports property is used to synchronize the ports and their labels at the folder node. For custom requirements, this class may be sub-classed and implement a more customized synchronization behavior.

FolderNodeConverter delegates to an instance of this class.

Examples

const defaultFolderNodeConverter = new FolderNodeConverter()
// set a gray rectangle to initialize a freshly collapsed group node with
defaultFolderNodeConverter.folderNodeDefaults.style = new ShapeNodeStyle({
  stroke: 'gray',
})
// use the same instance for all folders
defaultFolderNodeConverter.folderNodeDefaults.shareStyleInstance = true
// configure label handling: copy the labels
defaultFolderNodeConverter.folderNodeDefaults.copyLabels = true

// initialize labels on a freshly collapsed group node with a default style
defaultFolderNodeConverter.folderNodeDefaults.labels.style =
  new LabelStyle()
// share the same style instance
defaultFolderNodeConverter.folderNodeDefaults.labels.shareStyleInstance =
  true
// copy all properties from the group node labels to the folder node labels
defaultFolderNodeConverter.folderNodeDefaults.labels.initializeOptions =
  FoldingSynchronizationOptions.ALL
// copy all properties from the group node labels to the folder node labels
defaultFolderNodeConverter.folderNodeDefaults.labels.updateFoldingOptions =
  FoldingSynchronizationOptions.LABEL_TEXT
// upon subsequent collapse and expand: only synchronize the text
defaultFolderNodeConverter.folderNodeDefaults.labels.updateMasterOptions =
  FoldingSynchronizationOptions.LABEL_TEXT
// adjust the preferred size to the new text
defaultFolderNodeConverter.folderNodeDefaults.labels.autoAdjustPreferredSize =
  true

manager.folderNodeConverter = defaultFolderNodeConverter

Type Details

yFiles module
view

See Also

Constructors

Properties

Methods