當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。