def _hdf5_tree_editor(selected=''): """Return a ui.TreeEditor specifically for HDF5 file trees.""" return ui.TreeEditor(nodes=[ui.TreeNode(node_for=[Hdf5FilesNode], auto_open=True, children='files', label='name', view=no_view, ), ui.TreeNode(node_for=[Hdf5FileNode], auto_open=True, children='groups_and_arrays', label='name', view=no_view, ), ui.TreeNode(node_for=[Hdf5GroupNode], auto_open=False, children='groups_and_arrays', label='name', view=no_view, ), ui.TreeNode(node_for=[Hdf5ArrayNode], auto_open=False, children='', label='name', view=no_view, ), ], editable=False, selected=selected, )
def make_plugin_view(model_name, model_nodes, selection_view, model_view): node_label = '=' + model_name container_nodes = [ _traitsui.TreeNode( node_for=[CalcContainer], label=node_label, children='', auto_open=True, menu=[], ), _traitsui.TreeNode( node_for=[CalcContainer], label=node_label, children='calculations', auto_open=True, menu=[], ), ] plugin_tree = _traitsui.TreeEditor( nodes=container_nodes + model_nodes, # refresh='controller.update_tree', selected='controller.selected_object', editable=False, hide_root=True, ) plugin_view = _traitsui.View( _traitsui.Group( # Left side tree _traitsui.Item('controller.model', editor=plugin_tree, show_label=False), # Right side _traitsui.Group( # Upper right side data set selection panel selection_view, # Lower right side calc settings panel _traitsui.Group( _traitsui.Item( 'controller.edit_node', editor=_traitsui.InstanceEditor(view=model_view), style='custom', show_label=False), show_border=True, ), orientation='vertical', ), _traitsui.Spring(width=10), orientation='horizontal', ), resizable=True, buttons=['OK'], ) return plugin_view
resizable=True, show_label=False), title='Conjoint settings', ) ds_exp_action = _traitsui.Action( name='Copy to Data set', visible_when= 'object.node_name in ("Fixed residuals", "Full model residuals")', action='handler.export_data(editor, object)', ) conjoint_nodes = [ _traitsui.TreeNode(node_for=[ConjointController], label='name', children='', view=conjoint_view, menu=[]), _traitsui.TreeNode(node_for=[ConjointController], label='=Analysis results', children='table_win_launchers', auto_open=True, view=conjoint_view, menu=[]), _traitsui.TreeNode(node_for=[ConjointController], label='=Main effect plots', children='me_plot_launchers', auto_open=True, view=conjoint_view, menu=[]), _traitsui.TreeNode(
_traitsui.Heading('List showing all imported data sets'), width=500, ) def dclk_activator(obj): dstv = DSTableViewer(obj) dstv.edit_traits(view=dstv.get_view(), parent=win_handle) tree_editor = _traitsui.TreeEditor( nodes=[ _traitsui.TreeNode( node_for=[DatasetContainer], label='=Data sets', children='', auto_open=True, view=list_view, ), _traitsui.TreeNode( node_for=[DatasetContainer], label='=Data sets', children='dsl', auto_open=True, view=list_view, ), DSNode( node_for=[DataSet], label='display_name', tooltip='kind', icon_path='graphics',
style='custom', show_label=True), _traitsui.Item('standardise_y', label='Standardise Y', style='custom', show_label=True), _traitsui.Item('calc_n_pc', editor=_traitsui.RangeEditor( low_name='min_pc', high_name='max_pc', mode='auto'), style='simple', label='PC to calc:'), title='Prefmap settings', ) prefmap_nodes = [ _traitsui.TreeNode( node_for=[PrefmapController], label='name', children='', view=prefmap_view, menu=[]), _traitsui.TreeNode( node_for=[PrefmapController], label='=Overview plot', icon_path='graphics', icon_group='overview.ico', icon_open='overview.ico', children='window_launchers', view=prefmap_view, menu=[], on_dclick=overview_activator), _traitsui.TreeNode( node_for=[PrefmapController], label='=Y predicted (calibration)',
tree_view = ui.View( ui.VGroup( ui.Item('import_manager', style='custom', show_label=False) ) ) traits_view = tree_view tree_editor = ui.TreeEditor( orientation='vertical', nodes=[ # The first node specified is the top level one ui.TreeNode(node_for=[HCFFRoot], auto_open=True, children='filters', label='=HCF', # view=ui.View() # Empty view ), ui.TreeNode(node_for=[HCFFilter], auto_open=True, children='filters', label='name', # view=ui.View() ), ui.TreeNode(node_for=[PlotOptions], auto_open=True, children='', label='=Plot Options', view='view' ) ]
pca_view = _traitsui.View( _traitsui.Item('standardise', style='custom', show_label=True), _traitsui.Item('calc_n_pc', editor=_traitsui.RangeEditor(low_name='min_pc', high_name='max_pc', mode='auto'), style='simple', label='PC to calc:'), title='PCA settings', ) pca_nodes = [ _traitsui.TreeNode(node_for=[PcaController], label='name', children='', view=pca_view, menu=[]), _traitsui.TreeNode(node_for=[PcaController], label='=Overview plot', icon_path='graphics', icon_group='overview.ico', icon_open='overview.ico', children='window_launchers', view=pca_view, menu=[], on_dclick=overview_activator), _traitsui.TreeNode(node_for=[WindowLauncher], label='node_name', view=no_view, menu=[],
""" element = Element(tag=root.tag) if root.text is not None: element.text = root.text.strip() for name in sorted(root.keys()): element.attributes.append(Attribute(name=name, value=root.get(name))) for child in root: element.children.append(xml_to_tree(child)) return element xml_tree_editor = tui.TreeEditor( nodes=[ tui.TreeNode( node_for=[Element], children='kids', label='label', menu=False, ), tui.TreeNode( node_for=[Attribute], children='', label='label', menu=False, ) ], editable=False, show_icons=False, ) class XMLTree(tui.ModelView):
name='Export dummified attributes', # visible_when='object.node_name in ("Fixed residuals", "Full model residuals")', action='handler.export_dum_attr(editor, object)', ) ds_dum_seg_action = _traitsui.Action( # FIXME: Remove this name='Export dummified segments', # visible_when='object.node_name in ("Fixed residuals", "Full model residuals")', action='handler.export_dum_segments(editor, object)', ) ind_diff_nodes = [ _traitsui.TreeNode(node_for=[IndDiffController], label='name', children='', view=no_view, menu=[]), _traitsui.TreeNode( node_for=[IndDiffController], label='=Study individual differences', children='individual_differences', view=no_view, menu=_traitsui.Menu(ds_dum_attr_action), ), _traitsui.TreeNode( node_for=[IndDiffController], label='=Analysis of segments', children='segments_analysis', view=no_view, menu=_traitsui.Menu(ds_dum_seg_action),
no_view = _traitsui.View() bs_view = _traitsui.View( _traitsui.Item( 'summary_axis', # editor=_traitsui.EnumEditor(cols=2), # style='custom', show_label=False), title='Basic stat settings', ) bs_nodes = [ _traitsui.TreeNode(node_for=[BasicStatController], label='name', children='', view=bs_view, menu=[]), _traitsui.TreeNode(node_for=[BasicStatController], label='=Plots for all products', children='base_win_launchers', view=bs_view, menu=[]), _traitsui.TreeNode(node_for=[BasicStatController], label='=Single product histograms', children='idx_win_launchers', view=bs_view, menu=[]), _traitsui.TreeNode(node_for=[WindowLauncher], label='node_name', view=no_view,