本文整理汇总了Python中enthought.chaco.api.OverlayPlotContainer.do_layout方法的典型用法代码示例。如果您正苦于以下问题:Python OverlayPlotContainer.do_layout方法的具体用法?Python OverlayPlotContainer.do_layout怎么用?Python OverlayPlotContainer.do_layout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类enthought.chaco.api.OverlayPlotContainer
的用法示例。
在下文中一共展示了OverlayPlotContainer.do_layout方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_basics
# 需要导入模块: from enthought.chaco.api import OverlayPlotContainer [as 别名]
# 或者: from enthought.chaco.api.OverlayPlotContainer import do_layout [as 别名]
def test_basics(self):
container = OverlayPlotContainer(resizable='', bounds=[100.0,200.0])
self.assert_tuple(container.get_preferred_size(), (100.0,200.0))
self.assertEquals(container._layout_needed, True)
container.do_layout()
self.assertEquals(container._layout_needed, False)
return
示例2: test_min_size
# 需要导入模块: from enthought.chaco.api import OverlayPlotContainer [as 别名]
# 或者: from enthought.chaco.api.OverlayPlotContainer import do_layout [as 别名]
def test_min_size(self):
container = OverlayPlotContainer(resizable='', bounds=[50.0,50.0])
component = PlotComponent(resizable='', position=[50.0,60.0],
bounds=[100.0, 110.0])
container.add(component)
container.do_layout()
self.assert_tuple(component.position, (50.0,60.0))
self.assert_tuple(component.bounds, (100.0,110.0))
return
示例3: test_multiple_min_size
# 需要导入模块: from enthought.chaco.api import OverlayPlotContainer [as 别名]
# 或者: from enthought.chaco.api.OverlayPlotContainer import do_layout [as 别名]
def test_multiple_min_size(self):
comp1 = StaticPlotComponent([200, 50])
comp2 = StaticPlotComponent([60, 300])
container = OverlayPlotContainer(resizable='hv', bounds=[30,30])
container.fit_components = "hv"
container.add(comp1, comp2)
container.do_layout()
self.assert_tuple(container.get_preferred_size(), (200,300))
self.assert_tuple(comp1.bounds, (200,50))
self.assert_tuple(comp2.bounds, (60,300))
return
示例4: test_fixed_size_component
# 需要导入模块: from enthought.chaco.api import OverlayPlotContainer [as 别名]
# 或者: from enthought.chaco.api.OverlayPlotContainer import do_layout [as 别名]
def test_fixed_size_component(self):
container = OverlayPlotContainer(resizable='', bounds=[200.0,300.0])
# non-resizable component
component = PlotComponent(resizable='', position=[50.0,60.0], bounds=[100.0,110.0])
self.assertEquals(container._layout_needed, True)
container.do_layout()
container.add(component)
self.assertEquals(container._layout_needed, True)
container.do_layout()
self.assertEquals(container._layout_needed, False)
# check the results of the layout
self.assert_tuple(container.get_preferred_size(), (200.0,300.0))
self.assert_tuple(component.position, (50.0,60.0))
self.assert_tuple(component.bounds, (100.0,110.0))
return
示例5: test_resizable_component
# 需要导入模块: from enthought.chaco.api import OverlayPlotContainer [as 别名]
# 或者: from enthought.chaco.api.OverlayPlotContainer import do_layout [as 别名]
def test_resizable_component(self):
container = OverlayPlotContainer(resizable='', bounds=[200.0,300.0])
component = PlotComponent(resizable='hv', position=[50.0,56.0], bounds=[100.0,110.0])
container.add(component)
container.do_layout()
self.assert_tuple(component.position, (0.0,0.0))
self.assert_tuple(component.bounds, (200.0,300.0))
comp2 = PlotComponent(resizable="h", position=[10,20], bounds=[100,150])
container.add(comp2)
container.do_layout()
self.assert_tuple(comp2.position, (0.0, 20.0))
self.assert_tuple(comp2.bounds, (200.0, 150.0))
comp3 = PlotComponent(resizable="v", position=[30,40], bounds=[100,150])
container.add(comp3)
container.do_layout()
self.assert_tuple(comp3.position, (30.0, 0.0))
self.assert_tuple(comp3.bounds, (100,300))
return