class PreviewNode extends AbstractNode implements PropertyChangeListener {

    private final PropertySheet propertySheet;

    public PreviewNode(PropertySheet propertySheet) {
        super(Children.LEAF);
        this.propertySheet = propertySheet;
        setDisplayName(NbBundle.getMessage(PreviewNode.class, "PreviewNode.displayName"));
    }

    @Override
    protected Sheet createSheet() {<FILL_FUNCTION_BODY>}

    /**
     * default method for PropertyChangeListener, it is necessary to fire property change to update propertyEditor, which will refresh at runtime if a property value has been passively updated.
     *
     * @param pce a PropertyChangeEvent from a PreviewProperty object.
     */
    @Override
    public void propertyChange(PropertyChangeEvent pce) {
        firePropertyChange(pce.getPropertyName(), pce.getOldValue(), pce.getNewValue());
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                propertySheet.updateUI();
            }
        });
    }

    private static class PreviewPropertyWrapper extends PropertySupport.ReadWrite {

        private final PreviewProperty property;

        public PreviewPropertyWrapper(PreviewProperty previewProperty) {
            super(previewProperty.getName(), previewProperty.getType(), previewProperty.getDisplayName(),
                previewProperty.getDescription());
            this.property = previewProperty;
        }

        @Override
        public Object getValue() throws IllegalAccessException, InvocationTargetException {
            return property.getValue();
        }

        @Override
        public void setValue(Object t)
            throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
            property.setValue(t);
        }
    }

    private static class ChildPreviewPropertyWrapper extends PropertySupport.ReadWrite {

        private final PreviewProperty property;
        private final PreviewProperty[] parents;

        public ChildPreviewPropertyWrapper(PreviewProperty previewProperty, PreviewProperty[] parents) {
            super(previewProperty.getName(), previewProperty.getType(), previewProperty.getDisplayName(),
                previewProperty.getDescription());
            this.property = previewProperty;
            this.parents = parents;
        }

        @Override
        public Object getValue() throws IllegalAccessException, InvocationTargetException {
            return property.getValue();
        }

        @Override
        public void setValue(Object t)
            throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
            property.setValue(t);
        }

        @Override
        public boolean canWrite() {
            for (PreviewProperty parent : parents) {
                if (parent.getType().equals(Boolean.class) && parent.getValue().equals(Boolean.FALSE)) {
                    return false;
                }
            }
            return true;
        }
    }

    private class ParentPreviewPropertyWrapper extends PropertySupport.ReadWrite {

        private final PreviewProperty property;
        private final PreviewProperty[] children;

        public ParentPreviewPropertyWrapper(PreviewProperty previewProperty, PreviewProperty[] children) {
            super(previewProperty.getName(), previewProperty.getType(), previewProperty.getDisplayName(),
                previewProperty.getDescription());
            this.property = previewProperty;
            this.children = children;
        }

        @Override
        public Object getValue() throws IllegalAccessException, InvocationTargetException {
            return property.getValue();
        }

        @Override
        public void setValue(Object t)
            throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
            property.setValue(t);
            for (PreviewProperty p : children) {
                propertyChange(new PropertyChangeEvent(this, p.getName(), p.getValue(), p.getValue()));
            }
        }
    }
}

        Sheet sheet = Sheet.createDefault();
        PreviewController controller = Lookup.getDefault().lookup(PreviewController.class);

        Set<Renderer> enabledRenderers = null;
        if (controller.getModel() != null && controller.getModel().getManagedRenderers() != null) {
            enabledRenderers = new HashSet<>();
            for (ManagedRenderer mr : controller.getModel().getManagedRenderers()) {
                if (mr.isEnabled()) {
                    enabledRenderers.add(mr.getRenderer());
                }
            }
        }

        PreviewModel model = controller.getModel();
        if (model != null) {
            PreviewProperties properties = model.getProperties();

            Map<String, Sheet.Set> sheetSets = new HashMap<>();
            for (PreviewProperty property : properties.getProperties()) {
                Object source = property.getSource();
                boolean propertyEnabled = true;
                if (source instanceof Renderer) {
                    propertyEnabled = enabledRenderers == null || enabledRenderers.contains((Renderer) source);
                }

                if (propertyEnabled) {
                    String category = property.getCategory();
                    Sheet.Set sheetSet = sheetSets.get(category);
                    if (sheetSet == null) {
                        sheetSet = Sheet.createPropertiesSet();
                        sheetSet.setDisplayName(category);
                        sheetSet.setName(category);
                    }
                    Node.Property nodeProperty = null;
                    PreviewProperty[] parents = properties.getParentProperties(property);
                    PreviewProperty[] children = properties.getChildProperties(property);
                    if (parents.length > 0) {
                        nodeProperty = new ChildPreviewPropertyWrapper(property, parents);
                    } else if (children.length > 0) {
                        nodeProperty = new ParentPreviewPropertyWrapper(property, children);
                    } else {
                        nodeProperty = new PreviewPropertyWrapper(property);
                    }

                    sheetSet.put(nodeProperty);
                    sheetSets.put(category, sheetSet);
                }
            }

            //Ordered
            Sheet.Set nodeSet = sheetSets.remove(PreviewProperty.CATEGORY_NODES);
            Sheet.Set nodeLabelSet = sheetSets.remove(PreviewProperty.CATEGORY_NODE_LABELS);
            Sheet.Set edgeSet = sheetSets.remove(PreviewProperty.CATEGORY_EDGES);
            Sheet.Set arrowsSet = sheetSets.remove(PreviewProperty.CATEGORY_EDGE_ARROWS);
            Sheet.Set edgeLabelSet = sheetSets.remove(PreviewProperty.CATEGORY_EDGE_LABELS);
            if (nodeSet != null) {
                sheet.put(nodeSet);
            }
            if (nodeLabelSet != null) {
                sheet.put(nodeLabelSet);
            }
            if (edgeSet != null) {
                sheet.put(edgeSet);
            }
            if (arrowsSet != null) {
                sheet.put(arrowsSet);
            }
            if (edgeLabelSet != null) {
                sheet.put(edgeLabelSet);
            }
            for (Sheet.Set sheetSet : sheetSets.values()) {
                sheet.put(sheetSet);
            }
        }
        return sheet;
    
<no_super_class>