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


Python awt.Dimension方法代码示例

本文整理汇总了Python中java.awt.Dimension方法的典型用法代码示例。如果您正苦于以下问题:Python awt.Dimension方法的具体用法?Python awt.Dimension怎么用?Python awt.Dimension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt的用法示例。


在下文中一共展示了awt.Dimension方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_set

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Dimension [as 别名]
def test_get_set(self):
        d = Dimension(3, 9)
        self.assertEquals(d.width, 3)
        self.assertEquals(d.height, 9)
        d.width = 42
        self.assertEquals(d.width, 42)
        self.assertEquals(d.height, 9)

        try:
            d.foo
        except AttributeError:
            pass
        else:
            raise AssertionError('d.foo should throw type error')

    # Used in test_java_bean_properties. 
开发者ID:Acmesec,项目名称:CTFCrackTools-V2,代码行数:18,代码来源:test_jbasic.py

示例2: test_multiple_inheritance_prohibited

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Dimension [as 别名]
def test_multiple_inheritance_prohibited(self):
        try:
            class MultiJava(Dimension, Color):
                pass
            self.fail("Shouldn't be able to subclass more than one concrete java class")
        except TypeError:
            pass

        class PyDim(Dimension):
            pass
        class PyDimRun(PyDim, Runnable):
            pass
        try:
            class PyDimRunCol(PyDimRun, Color):
                pass
            self.fail("Shouldn't be able to subclass more than one concrete java class")
        except TypeError:
            pass 
开发者ID:Acmesec,项目名称:CTFCrackTools-V2,代码行数:20,代码来源:test_java_subclasses.py

示例3: p_build_ui

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Dimension [as 别名]
def p_build_ui(self, event):
        """
        Adds a list of checkboxes, one for each loaded plugin
        to the Selct plugins window
        """
        if not self.loaded_p_list:
            self.update_scroll("[!!] No plugins loaded!")
            return

        scroll_pane = JScrollPane()
        scroll_pane.setPreferredSize(Dimension(200, 250))
        check_frame = JPanel(GridBagLayout())
        constraints = GridBagConstraints()
        constraints.fill = GridBagConstraints.HORIZONTAL
        constraints.gridy = 0
        constraints.anchor = GridBagConstraints.FIRST_LINE_START

        for plug in self.loaded_p_list:
            check_frame.add(JCheckBox(plug.get_name(), plug.enabled,
                                      actionPerformed=self.update_box),
                            constraints)
            constraints.gridy += 1

        vport = JViewport()
        vport.setView(check_frame)
        scroll_pane.setViewport(vport)
        self.window.contentPane.add(scroll_pane)
        self.window.pack()
        self.window.setVisible(True) 
开发者ID:aur3lius-dev,项目名称:SpyDir,代码行数:31,代码来源:SpyDir.py

示例4: test

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Dimension [as 别名]
def test(panel, size=None, name='AWT Tester'):
    f = awt.Frame(name, windowClosing=lambda event: sys.exit(0))
    if hasattr(panel, 'init'):
        panel.init()

    f.add('Center', panel)
    f.pack()
    if size is not None:
        f.setSize(apply(awt.Dimension, size))
    f.setVisible(1)
    return f 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:13,代码来源:__init__.py

示例5: test

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Dimension [as 别名]
def test(panel, size=None, name='Swing Tester'):
    f = swing.JFrame(name, windowClosing=lambda event: sys.exit(0))
    if hasattr(panel, 'init'):
        panel.init()

    f.contentPane.add(panel)
    f.pack()
    if size is not None:
        from java import awt
        f.setSize(apply(awt.Dimension, size))
    f.setVisible(1)
    return f 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:14,代码来源:swing.py

示例6: test_class_in_failed_constructor

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Dimension [as 别名]
def test_class_in_failed_constructor(self):
        try:
            Dimension(123, 456, 789)
        except TypeError, exc:
            self.failUnless("java.awt.Dimension" in exc.message) 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:7,代码来源:test_java_integration.py

示例7: test_awt_hack

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Dimension [as 别名]
def test_awt_hack(self):
        # We ignore several deprecated methods in java.awt.* in favor of bean properties that were
        # addded in Java 1.1.  This tests that one of those bean properties is visible.
        c = Container()
        c.size = 400, 300
        self.assertEquals(Dimension(400, 300), c.size) 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:8,代码来源:test_java_integration.py

示例8: test_auto_super

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Dimension [as 别名]
def test_auto_super(self):
        class Implicit(Rectangle):
            def __init__(self):
                self.size = Dimension(6, 7)
        class Explicit(Rectangle):
            def __init__(self):
                Rectangle.__init__(self, 6, 7)
        self.assert_("width=6,height=7" in Implicit().toString())
        self.assert_("width=6,height=7" in Explicit().toString()) 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:11,代码来源:test_java_subclasses.py


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