Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def traits_view(self):
agrp = HGroup(UItem('mass_spectrometer', editor=EnumEditor(name='mass_spectrometers')),
Item('n', label='Limit'))
adapter = AnalysisAdapter()
adapter.run_history_columns()
v = View(VSplit(VGroup(agrp,
UItem('analyses', editor=TabularEditor(dclicked='selected',
editable=False,
adapter=adapter))),
UItem('analysis_view',
visible_when='analysis_view',
style='custom', editor=InstanceEditor())),
title='Run History',
width=700,
height=700,
resizable=True,
buttons=['OK'])
return v
######################
main_view = View(
Group(
Group(HSplit(HSplit(VSplit(
Item(name='engine_view',
style='custom',
resizable=True,
height =500,
width = 200,
show_label=False
),
),
Item(name='current_selection',
editor=InstanceEditor(),
enabled_when='current_selection is not None',
style='custom',
resizable = True,
height = 500,
width = 200,
springy=True,
show_label=False),
)),label = 'Settings',show_border = False),
Group(
Group(
Item(name = 'density_filter',editor = RangeEditor()),
'_',
HSplit(
Item('initial_button', show_label=False),
# The mayavi engine view.
engine_view = Instance(EngineView)
# The current selection in the engine tree view.
current_selection = Property
######################
view = View(HSplit(VSplit(Item(name='engine_view',
style='custom',
resizable=True,
show_label=False
),
Item(name='current_selection',
editor=InstanceEditor(),
enabled_when='current_selection is not None',
style='custom',
springy=True,
show_label=False),
),
Item(name='scene',
editor=SceneEditor(),
show_label=False,
resizable=True,
height=500,
width=500),
),
resizable=True,
scrollable=True
)
def traits_view(self):
v = View(UItem('analysis_view', style='custom', editor=InstanceEditor()))
return v
def traits_view(self):
v = okcancel_view(VGroup(icon_button_editor('add_filter_button', 'add'),
UItem('filters', editor=ListEditor(mutable=False,
style='custom',
editor=InstanceEditor()))),
title='Advanced Search',
width=700,
height=350)
return v
Group(Item(name='background'),
Item(name='foreground'),
Item(name='parallel_projection'),
Item(name='disable_render'),
Item(name='off_screen_rendering'),
Item(name='jpeg_quality'),
Item(name='jpeg_progressive'),
Item(name='magnification'),
Item(name='anti_aliasing_frames'),
Item(name='full_screen',
show_label=False),
),
Group(Item(name='render_window',
style='custom',
visible_when='object.stereo',
editor=InstanceEditor(view=View(_stereo_view)),
show_label=False),
),
label='Scene'),
Group( Item(name='light_manager',
style='custom', show_label=False),
label='Lights'),
Group(
Item(
name='movie_maker',
style='custom', show_label=False
),
label='Movie'),
buttons=['OK', 'Cancel']
)
########################################
def gauge_view(self):
v = View(Group(Item('gauges', style='custom',
show_label=False,
editor=ListEditor(mutable=False,
style='custom',
editor=InstanceEditor())),
show_border=True,
label=self.display_name))
return v
self.set(viewpoint=vp, trait_change_notify=False)
if 'saved_views' in options:
cPickle.dump(self.saved_views, open(os.path.join(cwd, options['saved_views']), 'w'))
view = View(
HGroup(
Group(
Item("figure", editor=SceneEditor(scene_class=MayaviScene)),
Group("mix", "pivot", show_labels=True),
show_labels=False),
Group(
Item('colormap',
editor=ImageEnumEditor(values=lut_manager.lut_mode_list(),
cols=6, path=lut_manager.lut_image_dir)),
"fliplut", Item("show_colorbar", label="colorbar"), "vmin", "vmax", "_",
Item('datapack', editor=InstanceEditor(name="datavars", editable=False), width=100),
Item('datavars', editor=ListEditor(style='custom')),
"_",
"showlabels", "showrois", Item("reset_btn", show_label=False),
"_",
"hide_backfaces",
"_",
Item('viewpoint', editor=InstanceEditor(name='saved_views', editable=False), style='custom',
visible_when="len(saved_views) > 0"),
),
show_labels=False),
resizable=True, title="Mixer")
from jigna.editors.api import IntEditor as JIntEditor, FloatEditor as JFloatEditor, \
BoolEditor as JBoolEditor, StringEditor as JStringEditor, EnumEditor as JEnumEditor, \
RangeEditor as JRangeEditor, ListEditor as JListEditor, InstanceEditor as JInstanceEditor
from traitsui.api import TextEditor, RangeEditor, EnumEditor, ListEditor, InstanceEditor, \
BooleanEditor
class FactoryMapping(object):
traitsui_to_jigna_editor = {
TextEditor: JStringEditor,
RangeEditor: JRangeEditor,
EnumEditor: JEnumEditor,
ListEditor: JListEditor,
InstanceEditor: JInstanceEditor,
BooleanEditor: JBoolEditor,
}
trait_to_jigna_editor = {
Int: {'simple': JIntEditor},
Str: {'simple': JStringEditor},
Float: {'simple': JFloatEditor},
Range: {'simple': JRangeEditor},
Bool: {'simple': JBoolEditor},
Enum: {'simple': JEnumEditor},
List: {'simple': JListEditor},
Instance: {'simple': JInstanceEditor}
}
@classmethod
def get_editor_factory(cls, obj, item):
def traits_view(self):
v = View(HGroup(Item('threshold')),
UItem('peaks', editor=TabularEditor(adapter=PeaksAdapter(),
selected='selected')),
UItem('selected', style='custom', editor=InstanceEditor()),
title='Candidate Associations',
resizable=True,
kind='livemodal',
width=500,
height=500)
return v
# ============= EOF =============================================