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


Python awt.Color方法代码示例

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


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

示例1: test_multiple_inheritance_prohibited

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Color [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:ofermend,项目名称:medicare-demo,代码行数:20,代码来源:test_java_subclasses.py

示例2: test_serialization

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Color [as 别名]
def test_serialization(self):
        object1 = 42
        object2 = ['a', 1, 1.0]
        object3 = Foo()
        object3.baz = 99

        object4 = awt.Color(1, 2, 3)

        #writing
        fout = io.ObjectOutputStream(io.FileOutputStream(self.sername))
        #Python int
        fout.writeObject(object1)
        #Python list
        fout.writeObject(object2)
        #Python instance
        fout.writeObject(object3)
        #Java instance
        fout.writeObject(object4)
        fout.close()

        fin = io.ObjectInputStream(io.FileInputStream(self.sername))

        #reading
        iobject1 = fin.readObject()
        iobject2 = fin.readObject()
        iobject3 = fin.readObject()
        iobject4 = fin.readObject()
        fin.close()

        self.assertEquals(iobject1, object1)
        self.assertEquals(iobject2, object2)
        self.assertEquals(iobject3.baz, 99)
        self.assertEquals(iobject3.bar(), 'bar')
        self.assertEquals(iobject3.__class__, Foo)
        self.assertEquals(iobject4, object4) 
开发者ID:Acmesec,项目名称:CTFCrackTools-V2,代码行数:37,代码来源:test_jser.py

示例3: initUI

# 需要导入模块: from java import awt [as 别名]
# 或者: from java.awt import Color [as 别名]
def initUI(self):
        self.tab = swing.JPanel()

        # UI for Output
        self.outputLabel = swing.JLabel("LinkFinder Log:")
        self.outputLabel.setFont(Font("Tahoma", Font.BOLD, 14))
        self.outputLabel.setForeground(Color(255,102,52))
        self.logPane = swing.JScrollPane()
        self.outputTxtArea = swing.JTextArea()
        self.outputTxtArea.setFont(Font("Consolas", Font.PLAIN, 12))
        self.outputTxtArea.setLineWrap(True)
        self.logPane.setViewportView(self.outputTxtArea)
        self.clearBtn = swing.JButton("Clear Log", actionPerformed=self.clearLog)
        self.exportBtn = swing.JButton("Export Log", actionPerformed=self.exportLog)
        self.parentFrm = swing.JFileChooser()



        # Layout
        layout = swing.GroupLayout(self.tab)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)
        self.tab.setLayout(layout)
      
        layout.setHorizontalGroup(
            layout.createParallelGroup()
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup()
                    .addComponent(self.outputLabel)
                    .addComponent(self.logPane)
                    .addComponent(self.clearBtn)
                    .addComponent(self.exportBtn)
                )
            )
        )
        
        layout.setVerticalGroup(
            layout.createParallelGroup()
            .addGroup(layout.createParallelGroup()
                .addGroup(layout.createSequentialGroup()
                    .addComponent(self.outputLabel)
                    .addComponent(self.logPane)
                    .addComponent(self.clearBtn)
                    .addComponent(self.exportBtn)
                )
            )
        ) 
开发者ID:InitRoot,项目名称:BurpJSLinkFinder,代码行数:49,代码来源:FransLinkfinder.py


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