当前位置: 首页>>代码示例>>Python>>正文


Python OverlayPlotContainer.do_layout方法代码示例

本文整理汇总了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
开发者ID:brycehendrix,项目名称:chaco,代码行数:9,代码来源:plotcontainer_test_case.py

示例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
开发者ID:brycehendrix,项目名称:chaco,代码行数:11,代码来源:plotcontainer_test_case.py

示例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
开发者ID:brycehendrix,项目名称:chaco,代码行数:13,代码来源:plotcontainer_test_case.py

示例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
开发者ID:brycehendrix,项目名称:chaco,代码行数:18,代码来源:plotcontainer_test_case.py

示例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
开发者ID:brycehendrix,项目名称:chaco,代码行数:22,代码来源:plotcontainer_test_case.py


注:本文中的enthought.chaco.api.OverlayPlotContainer.do_layout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。