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


Python JCheckBox.isSelected方法代码示例

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


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

示例1: EditSymbolAttr

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]
class EditSymbolAttr(JPanel):
    def __init__(self, sattr):
	self.attr = sattr
	self.cbox = JColorChooser(self.attr.color)
	self.sz_field = JTextField(str(self.attr.size))
	szpanel = JPanel()
	szpanel.add(self.sz_field)
	szpanel.setBorder(BorderFactory.createTitledBorder("symbol size (integer)"))
	self.filled_box = JCheckBox("Filled ?:",self.attr.filled)
	self.shape_cbox = JComboBox(SymbolProps.sym_shape_map.keys())
	self.shape_cbox.setSelectedItem(self.attr.shape)
	self.shape_cbox.setBorder(BorderFactory.createTitledBorder("Shape"))
	panel1 = JPanel()
	panel1.setLayout(BorderLayout())
	panel1.add(szpanel,BorderLayout.NORTH)
	panel2 = JPanel()
	panel2.setLayout(GridLayout(1,2))
	panel2.add(self.shape_cbox)
	panel2.add(self.filled_box)
	panel1.add(panel2,BorderLayout.SOUTH)
	self.setLayout(BorderLayout())
	self.add(self.cbox,BorderLayout.CENTER)
	self.add(panel1,BorderLayout.SOUTH)
    def setAttribute(self,sattr):
	self.attr = sattr
	self.cbox.color = self.attr.color
	self.sz_field.text = str(self.attr.size)
	self.shape_cbox.setSelectedItem(self.attr.shape)
    def update(self):
	self.attr.color = self.cbox.getColor()
	self.attr.size = string.atoi(self.sz_field.getText())
	self.attr.filled = self.filled_box.isSelected()
	self.attr.shape = self.shape_cbox.getSelectedItem()
	self.attr.sym = self.attr.createSymbol()
开发者ID:CalSimCalLite,项目名称:CalLiteGUI,代码行数:36,代码来源:xattr.py

示例2: EditCurveAttr

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]
class EditCurveAttr(JPanel):
    def __init__(self, cattr):
	self.attr = cattr
	self.cbox = JColorChooser(self.attr.color)
	self.sym_panel = EditSymbolAttr(cattr.sym_prop)
	self.thickness_field = JTextField(str(cattr.thickness),2)
	self.draw_symbol_box = JCheckBox("Draw Symbol?",cattr.draw_symbol)
	self.dps_field = JTextField(str(self.attr.data_per_symbol),2)
	self.dash_box = JComboBox(CurveProps.DASH_TYPES.keys())
	self.dash_box.setSelectedItem(self.attr.dash_type)
	self.dash_box.setBorder(BorderFactory.createTitledBorder("Dash type: (Only JDK2 & Slow!)"))
	tpanelx = JPanel()
	tpanelx.add(self.thickness_field)
	tpanelx.setBorder(BorderFactory.createTitledBorder("curve thickness (integer)"))
	tpanely = JPanel()
	tpanely.add(self.dps_field)
	tpanely.setBorder(BorderFactory.createTitledBorder("data per symbol(integer)"))
	tpanel = JPanel();tpanel.setLayout(GridLayout(2,2));
	tpanel.add(self.draw_symbol_box); tpanel.add(tpanelx);
	tpanel.add(tpanely); tpanel.add(self.dash_box);
	panel1 = JPanel()
	panel1.setLayout(BorderLayout())
	panel1.add(self.cbox,BorderLayout.CENTER)
	panel1.add(tpanel, BorderLayout.SOUTH)
	panel2 = JPanel()
	panel2.setLayout(BorderLayout())
	panel2.add(self.sym_panel,BorderLayout.CENTER)
	tp1 = JTabbedPane()
	tp1.addTab("Curve Attributes",panel1)
	tp1.addTab("Symbol Attributes",panel2)
	tp1.setSelectedComponent(panel1)
	self.setLayout(BorderLayout())
	self.add(tp1,BorderLayout.CENTER)
    def setAttribute(self,cattr):
	self.attr = cattr
	self.cbox.color = self.attr.color
	self.sym_panel.setAttribute(cattr.sym_prop)
	self.thickness_field.text = str(cattr.thickness)
	self.dps_field.text = str(cattr.data_per_symbol)
	self.draw_symbol_box.setSelected(cattr.draw_symbol)
	self.dash_box.setSelectedItem(cattr.dash_type)
    def update(self):
	self.attr.color = self.cbox.getColor()
	self.attr.thickness = string.atoi(self.thickness_field.text)
	self.attr.data_per_symbol = string.atoi(self.dps_field.text)
	self.attr.draw_symbol = self.draw_symbol_box.isSelected()
	self.attr.dash_type = self.dash_box.getSelectedItem()
	#print 'Updating Self.draw_symbol',self.draw_symbol,self.attr
	self.sym_panel.update()
开发者ID:CalSimCalLite,项目名称:CalLiteGUI,代码行数:51,代码来源:xattr.py

示例3: RunPanel

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]
class RunPanel(JPanel, java.lang.Runnable):
    def __init__(self,view):
        self.view=view
        self.layout=BorderLayout()
        self.run_sim=JCheckBox('generate more data',False)
        self.add(self.run_sim)
        self.thread=java.lang.Thread(self)
        self.thread.priority=java.lang.Thread.MIN_PRIORITY
        self.thread.start()
    def run(self):
        while True:
            if self.run_sim.isSelected():
                name=self.view.stats.name
                params=self.view.selected_params()
                print params
                self.view.stats(**params).run(call_after=self.view.graph.update)
            else:
                time.sleep(0.1)
开发者ID:Elhamahm,项目名称:nengo_1.4,代码行数:20,代码来源:run.py

示例4: changeDomainPopup

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]
    def changeDomainPopup(self, oldDomain, index):
        hostField = JTextField(25)
        checkbox = JCheckBox()
        domainPanel = JPanel(GridLayout(0,1))
        domainPanel.add(JLabel("Request %s: Domain %s inaccessible. Enter new domain." % (str(index),oldDomain)))

        firstline = JPanel()
        firstline.add(JLabel("Host:"))
        firstline.add(hostField)
        domainPanel.add(firstline)
        secondline = JPanel()
        secondline.add(JLabel("Replace domain for all requests?"))
        secondline.add(checkbox)
        domainPanel.add(secondline)
        result = JOptionPane.showConfirmDialog(
            self._splitpane,domainPanel, "Domain Inaccessible", JOptionPane.OK_CANCEL_OPTION)
        cancelled = (result == JOptionPane.CANCEL_OPTION)
        if cancelled:
            return (False, None, False)
        return (True, hostField.getText(), checkbox.isSelected())
开发者ID:webpentest-factory,项目名称:AuthMatrix,代码行数:22,代码来源:AuthMatrix.py

示例5: BurpExtender

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........
    #
    # implement IHttpListener
    #
    
    def processHttpMessage(self, toolFlag, messageIsRequest, messageInfo):
   
        # Only process responses that came from the proxy. This will
        # ignore request/responses made by Otter itself.
        if not messageIsRequest and toolFlag == self._callbacks.TOOL_PROXY:
            # create a new log entry with the message details
            row = self._log.size()

            # analyze and store information about the original request/response
            responseBytes = messageInfo.getResponse()
            requestBytes = messageInfo.getRequest()
            request = self._helpers.analyzeRequest(messageInfo)
            response = self._helpers.analyzeResponse(responseBytes)
            
            # ignore out-of-scope requests.
            if not self._callbacks.isInScope(request.getUrl()):
                return

            wasModified = False
            ms = self._matchString.getText()
            rs = self._replaceString.getText()
            mss = ms.split(",")
            rss = rs.split(",")
            if len(rss) != len(mss):
                mss = [""]
                
            for i,x in enumerate(mss):
                if x == "":
                    continue
                if self._isRegexp.isSelected():
                    if search(x, requestBytes):
                        requestBytes = sub(x, rss[i], requestBytes)
                        wasModified = True
                else:
                    if fromBytes(requestBytes).find(x) >= 0:
                        requestBytes = toBytes(replace(fromBytes(requestBytes), x, rss[i]))
                        wasModified = True

            # make a modified request to test for authorization issues
            entry = None
            if wasModified:
                modReqResp = self._callbacks.makeHttpRequest(messageInfo.getHttpService(), requestBytes)
                modRequestBytes = modReqResp.getRequest()
                modResponseBytes = modReqResp.getResponse()
                modResponse = self._helpers.analyzeResponse(modResponseBytes)
                orig = self._callbacks.saveBuffersToTempFiles(messageInfo)
                mod = self._callbacks.saveBuffersToTempFiles(modReqResp)
                entry = LogEntry(orig, mod, request.getUrl(), response.getStatusCode(), len(responseBytes), modResponse.getStatusCode(), len(modResponseBytes), wasModified)
            else:
                orig = self._callbacks.saveBuffersToTempFiles(messageInfo)
                entry = LogEntry(orig, None, request.getUrl(), response.getStatusCode(), len(responseBytes), "None", 0, wasModified)

            self._lock.acquire()
            self._log.add(entry)
            self.fireTableRowsInserted(row, row)
            self._lock.release()
        return

    #
    # extend AbstractTableModel
    #
    
开发者ID:amlweems,项目名称:otter,代码行数:69,代码来源:otter.py

示例6: ConfigTab

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]
class ConfigTab( ITab, JPanel ):

    def __init__( self, callbacks ):
        self._callbacks = callbacks
        self._helpers = callbacks.getHelpers()
        self.__initLayout__()

    def __initLayout__( self ):
        self._levelComboBox = JComboBox()
        levelComboBoxSize = Dimension( 300, 30 )
        self._levelComboBox.setPreferredSize( levelComboBoxSize )
        self._levelComboBox.setMaximumSize( levelComboBoxSize )
        for level in range( 0, 6 ):
            self._levelComboBox.addItem( str( level ) )

        self._techRenderedCheckBox = JCheckBox( 'Rendered', True )
        self._techTimebasedCheckBox = JCheckBox( 'Time-based', True )

        self._plugin_groups = {}
        for plugin in plugins:
            parent = plugin.__base__.__name__
            if not self._plugin_groups.has_key( parent ):
                self._plugin_groups[ parent ] = []
            self._plugin_groups[ parent ].append( plugin )
        self._pluginCheckBoxes = []
        for pluginGroup in self._plugin_groups.values():
            for plugin in pluginGroup:
                self._pluginCheckBoxes.append( PluginCheckBox( plugin ) )

        self._positionReplaceCheckBox = JCheckBox( 'Replace', True )
        self._positionAppendCheckBox = JCheckBox( 'Append', False )

        displayItems = (
            {
                'label': 'Level',
                'components': ( self._levelComboBox, ),
                'description': 'Level of code context escape to perform (1-5, Default:0).'
            },
            {
                'label': 'Techniques',
                'components': ( self._techRenderedCheckBox, self._techTimebasedCheckBox, ),
                'description': 'Techniques R(endered) T(ime-based blind). Default: RT.'
            },
            {
                'label': 'Template Engines',
                'components': self._pluginCheckBoxes,
                'description': 'Force back-end template engine to this value(s).'
            },
            {
                'label': 'Payload position',
                'components': ( self._positionReplaceCheckBox, self._positionAppendCheckBox, ),
                'description': 'Scan payload position. This feature only appears in BurpExtension.'
            }
        )

        layout = GroupLayout( self )
        self.setLayout( layout )
        layout.setAutoCreateGaps( True )
        layout.setAutoCreateContainerGaps( True )

        labelWidth = 200
        hgroup =  layout.createParallelGroup( GroupLayout.Alignment.LEADING )
        vgroup = layout.createSequentialGroup()
        for displayItem in displayItems:
            label = JLabel( displayItem.get( 'label' ) )
            label.setToolTipText( displayItem.get( 'description' ) )
            _hgroup = layout.createSequentialGroup().addComponent( label, labelWidth, labelWidth, labelWidth )
            _vgroup = layout.createParallelGroup( GroupLayout.Alignment.BASELINE ).addComponent( label )
            for component in displayItem.get( 'components' ):
                _hgroup.addComponent( component )
                _vgroup.addComponent( component )
            hgroup.addGroup( _hgroup )
            vgroup.addGroup( _vgroup )

        layout.setHorizontalGroup( hgroup )
        layout.setVerticalGroup( vgroup )

    def getTabCaption( self ):
        return 'Tplmap'

    def getUiComponent( self ):
        return self

    def getLevel( self ):
        return self._levelComboBox.getSelectedIndex()

    def getTechniques( self ):
        return '%s%s' % ( 'R' if self._techRenderedCheckBox.isSelected() else '', 'T' if self._techTimebasedCheckBox.isSelected() else '' )

    def getEngines( self ):
        return [ checkbox.getPlugin() for checkbox in self._pluginCheckBoxes if checkbox.isSelected() ]

    def getPayloadPosition( self ):
        return { 'replace': self._positionReplaceCheckBox.isSelected(), 'append': self._positionAppendCheckBox.isSelected() }
开发者ID:epinna,项目名称:tplmap,代码行数:96,代码来源:config_tab.py

示例7: ConfigurableConfigPanel

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........

    def changedUpdate(self, e):
        """ generated source for method changedUpdate """
        syncJSONtoUI()

    def insertUpdate(self, e):
        """ generated source for method insertUpdate """
        syncJSONtoUI()

    def removeUpdate(self, e):
        """ generated source for method removeUpdate """
        syncJSONtoUI()

    def stateChanged(self, arg0):
        """ generated source for method stateChanged """
        syncJSONtoUI()

    def syncJSONtoUI(self):
        """ generated source for method syncJSONtoUI """
        if settingUI:
            return
        self.params = getJSONfromUI()
        self.saveButton.setEnabled(self.savedParams == None or not self.params.__str__() == self.savedParams)

    def getJSONfromUI(self):
        """ generated source for method getJSONfromUI """
        newParams = JSONObject()
        try:
            if not self.name.getText().isEmpty():
                newParams.put("name", self.name.getText())
            newParams.put("strategy", self.strategy.getSelectedItem().__str__())
            newParams.put("metagameStrategy", self.metagameStrategy.getSelectedItem().__str__())
            newParams.put("stateMachine", self.stateMachine.getSelectedItem().__str__())
            newParams.put("cacheStateMachine", self.cacheStateMachine.isSelected())
            newParams.put("maxPlys", self.maxPlys.getModel().getValue())
            newParams.put("heuristicFocus", self.heuristicFocus.getModel().getValue())
            newParams.put("heuristicMobility", self.heuristicMobility.getModel().getValue())
            newParams.put("heuristicOpponentFocus", self.heuristicOpponentFocus.getModel().getValue())
            newParams.put("heuristicOpponentMobility", self.heuristicOpponentMobility.getModel().getValue())
            newParams.put("mcDecayRate", self.mcDecayRate.getModel().getValue())
        except JSONException as je:
            je.printStackTrace()
        return newParams

    settingUI = False

    def setUIfromJSON(self):
        """ generated source for method setUIfromJSON """
        self.settingUI = True
        try:
            if self.params.has("name"):
                self.name.setText(self.params.getString("name"))
            if self.params.has("strategy"):
                self.strategy.setSelectedItem(self.params.getString("strategy"))
            if self.params.has("metagameStrategy"):
                self.metagameStrategy.setSelectedItem(self.params.getString("metagameStrategy"))
            if self.params.has("stateMachine"):
                self.stateMachine.setSelectedItem(self.params.getString("stateMachine"))
            if self.params.has("cacheStateMachine"):
                self.cacheStateMachine.setSelected(self.params.getBoolean("cacheStateMachine"))
            if self.params.has("maxPlys"):
                self.maxPlys.getModel().setValue(self.params.getInt("maxPlys"))
            if self.params.has("heuristicFocus"):
                self.heuristicFocus.getModel().setValue(self.params.getInt("heuristicFocus"))
            if self.params.has("heuristicMobility"):
                self.heuristicMobility.getModel().setValue(self.params.getInt("heuristicMobility"))
开发者ID:hobson,项目名称:ggpy,代码行数:70,代码来源:ConfigurableConfigPanel.py

示例8: getIp

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........
        if domainExpression.match(ipCidr):
            JOptionPane.showMessageDialog(None, "You must enter IP", "s1riu5", JOptionPane.INFORMATION_MESSAGE)
        

        else:
            ipList = list(ipRange(ipCidr))
            print len(ipList)
            if len(ipList) == 256:
                del ipList[0]
                del ipList[254]
    
            global NMAPPATH

            scan=ScanList(ipList, self, [NMAPPATH,"-Pn", "-sT", "-sV", "--open"])
            scan.start()

    
  

    def subDomain(self, event):
    	print self.textfield2.getText()
        b = subDomainThread(self.textfield2.getText(), self)
        b.start()

        


    def senFileScan(self, event):
        #print "Hello"

        urlListASP = ["/admin.asp"]
        urlListASPX = ["/admin.aspx"]
        urlListJSP = ["/admin.jsp"]
        urlListPHP = ["/admin.php"]
        urlListMDB = ["/admin.mdb"]
        urlListDIR = ["/admin/"]
        

        if self.chkbox1.isSelected():
            
            domainTextObj1 = open("path/ASP.txt", "r")
            for each1 in domainTextObj1.readlines():
                each1 = each1.strip()
                urlListASP.append(each1)
            domainTextObj1.close()

        if self.chkbox2.isSelected():
            domainTextObj2 = open("path/ASPX.txt", "r")
            for each2 in domainTextObj2.readlines():
                each2 = each2.strip()
                urlListASPX.append(each2)
            domainTextObj2.close()
            
        if self.chkbox3.isSelected():
            domainTextObj3 = open("path/JSP.txt", "r")
            for each3 in domainTextObj3.readlines():
                each3 = each3.strip()
                urlListJSP.append(each3)
            domainTextObj3.close()
        if self.chkbox4.isSelected():
            domainTextObj4 = open("path/PHP.txt", "r")
            for each4 in domainTextObj4.readlines():
                each4 = each4.strip()
                urlListPHP.append(each4)
            domainTextObj4.close()
        if self.chkbox5.isSelected():
            domainTextObj5 = open("path/MDB.txt", "r")
            for each5 in domainTextObj5.readlines():
                each5 = each5.strip()
                urlListMDB.append(each5)
            domainTextObj5.close()
        if self.chkbox6.isSelected():
            domainTextObj6 = open("path/DIR.txt", "r")
            for each6 in domainTextObj6.readlines():
                each6 = each6.strip()
                urlListDIR.append(each6)
            domainTextObj6.close()

        app = []
        app = urlListASP + urlListASPX + urlListJSP + urlListPHP + urlListMDB + urlListDIR
        app1 = list(set(app))
        

        theUrlText = self.textfield3.getText()

        


        #if str(theUrlText[0 : 7]) == "http://":
         #   theUrlText = "http://" + theUrlText
        

        print len(app1)
        print len(app)


        #fileObj1 = eachFileScan(theUrlText, app)
        #fileObj1.start()
        ab = numControl(theUrlText, app1, self)
        ab.start()
开发者ID:5ir1us,项目名称:Tarot,代码行数:104,代码来源:s1riu5TheMagician.py

示例9: BurpExtender

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........
            if logEntry._unauthorizedRequestResponse != None:
                return len(logEntry._unauthorizedRequestResponse.getResponse())
            else:
                #return "-"
                return 0
        if columnIndex == 5:
            return logEntry._enfocementStatus   
        if columnIndex == 6:
            return logEntry._enfocementStatusUnauthorized        
        return ""

    #
    # implement IMessageEditorController
    # this allows our request/response viewers to obtain details about the messages being displayed
    #
    
    def getHttpService(self):
        return self._currentlyDisplayedItem.getHttpService()

    def getRequest(self):
        return self._currentlyDisplayedItem.getRequest()

    def getResponse(self):
        return self._currentlyDisplayedItem.getResponse()


    #
    # implement IHttpListener
    #
    def processHttpMessage(self, toolFlag, messageIsRequest, messageInfo):

        #if (self.intercept == 1) and (toolFlag != self._callbacks.TOOL_EXTENDER):
        if (self.intercept == 1) and (toolFlag == self._callbacks.TOOL_PROXY):
            if self.prevent304.isSelected():
                if messageIsRequest:
                    requestHeaders = list(self._helpers.analyzeRequest(messageInfo).getHeaders())
                    newHeaders = list()
                    found = 0
                    for header in requestHeaders:
                        if not "If-None-Match:" in header and not "If-Modified-Since:" in header:
                            newHeaders.append(header)
                            found = 1
                    if found == 1:
                        requestInfo = self._helpers.analyzeRequest(messageInfo)
                        bodyBytes = messageInfo.getRequest()[requestInfo.getBodyOffset():]
                        bodyStr = self._helpers.bytesToString(bodyBytes)
                        messageInfo.setRequest(self._helpers.buildHttpMessage(newHeaders, bodyStr))


            if not messageIsRequest:
                if not self.replaceString.getText() in self._helpers.analyzeRequest(messageInfo).getHeaders():
                    if self.ignore304.isSelected():
                        firstHeader = self._helpers.analyzeResponse(messageInfo.getResponse()).getHeaders()[0]
                        if "304" in firstHeader or "204" in firstHeader:
                           return
                    if self.IFList.getModel().getSize() == 0:
                        self.checkAuthorization(messageInfo,self._helpers.analyzeResponse(messageInfo.getResponse()).getHeaders(),self.doUnauthorizedRequest.isSelected())
                    else:
                        urlString = str(self._helpers.analyzeRequest(messageInfo).getUrl())
                        
                        do_the_check = 1

                        for i in range(0,self.IFList.getModel().getSize()):

                            if self.IFList.getModel().getElementAt(i).split(":")[0] == "Scope items only":
                                currentURL = URL(urlString)
开发者ID:federicodotta,项目名称:Autorize,代码行数:70,代码来源:Autorize.py

示例10: __init__

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........
    def showColorChooser(self, e):
        colorChooser = JColorChooser()
        self.overlayColor = colorChooser.showDialog(self.frame, "Choose color", Color.red)
        self.overlayColorPreviewLabel.setBackground(self.overlayColor)

    def showStackOverlayWindow(self):
        all = JPanel()
        all.setLayout(MigLayout())

        self.imageIDs = WindowManager.getIDList()
        self.imageNames = []

        if self.imageIDs is None:
            IJ.error("No open images", "Stack Overlay requires at least one image to be already open.")
            return

        for i in self.imageIDs:
            self.imageNames.append(WindowManager.getImage(i).getTitle())

        self.baseImageBox = JComboBox(self.imageNames)
        baseImageBoxLabel = JLabel("Base image")
        self.baseImageBox.setSelectedIndex(0)
        all.add(baseImageBoxLabel)
        all.add(self.baseImageBox, "wrap")

        self.overlayImageBox = JComboBox(self.imageNames)
        overlayImageBoxLabel = JLabel("Overlay image")
        if len(self.imageNames) > 1:
            self.overlayImageBox.setSelectedIndex(1)

        all.add(overlayImageBoxLabel)
        all.add(self.overlayImageBox, "wrap")

        all.add(JSeparator(SwingConstants.HORIZONTAL), "span, wrap")

        overlayStyleFrame = JPanel()
        overlayStyleFrame.setLayout(MigLayout())
        overlayStyleFrame.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Overlay Style"), BorderFactory.createEmptyBorder(5,5,5,5)))

        colorLabel = JLabel("Overlay color")
        self.overlayColorPreviewLabel = JLabel("           ")
        self.overlayColorPreviewLabel.setBorder(BorderFactory.createEmptyBorder(0,0,1,0))
        self.overlayColorPreviewLabel.setOpaque(True)
        self.overlayColorPreviewLabel.setBackground(Color.red)
        self.overlayColor = Color.red
        colorPicker = JColorChooser()
        colorPicker.setPreviewPanel(self.overlayColorPreviewLabel)
        colorButton = JButton("Select color...", actionPerformed=self.showColorChooser)

        opacityLabel = JLabel("Overlay opacity (%)")
        opacitySpinnerModel = SpinnerNumberModel(100, 0, 100, 1)
        self.opacitySpinner = JSpinner(opacitySpinnerModel)

        overlayStyleFrame.add(colorLabel)
        overlayStyleFrame.add(self.overlayColorPreviewLabel)
        overlayStyleFrame.add(colorButton, "wrap")

        overlayStyleFrame.add(opacityLabel)
        overlayStyleFrame.add(self.opacitySpinner, "wrap")
        

        all.add(overlayStyleFrame, "span, wrap")
        
        self.virtualStackCheckbox = JCheckBox("Use Virtual Stack", True)
        all.add(self.virtualStackCheckbox, "span, wrap")

        # TODO: add non-thermonuclear cancel button functionality
        overlayCancelButton = JButton("Cancel", actionPerformed=self.onQuit)
        overlayStartButton = JButton("Overlay images", actionPerformed=self.overlayImages)
        
        all.add(overlayCancelButton, "gapleft push")
        all.add(overlayStartButton, "gapleft push")

        self.frame = JFrame("Stack Overlay")
        self.frame.getContentPane().add(JScrollPane(all))
        self.frame.pack()
        self.frame.setLocationRelativeTo(None)
        self.frame.setVisible(True)
        
    def overlayImages(self, e):
        impBase = WindowManager.getImage(self.imageIDs[self.baseImageBox.getSelectedIndex()])
        refBase = impBase.getStack().getProcessor(1)
        
        impOverlay = WindowManager.getImage(self.imageIDs[self.overlayImageBox.getSelectedIndex()])
        refOverlay = impOverlay.getStack().getProcessor(1)
        
        print "Overlaying for stack sizes " + str(impBase.getStackSize()) + "/" + str(impOverlay.getStackSize()) + "..."
        
        stack = None
        
        if self.virtualStackCheckbox.isSelected():
            stack = OverlayVirtualStack()
            stack.overlayOpacity = float(self.opacitySpinner.getValue())/100.0
            stack.overlayColor = AWTColorToArray(self.overlayColorPreviewLabel.getBackground())
            stack.base = impBase
            stack.overlay = impOverlay

            ImagePlus("Stack Overlay from " + self.imageNames[self.baseImageBox.getSelectedIndex()] + " and " + self.imageNames[self.overlayImageBox.getSelectedIndex()], stack).show()
        else:
            IJ.error("Not implemented yet", "Using normal stacks is not implemented yet. Please use the Virtual Stack option.")
开发者ID:skalarproduktraum,项目名称:fiji-stackoverlay,代码行数:104,代码来源:Stack_Overlay.py

示例11: PreferencesFrame

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........
                          None,
                          panel3,
                          None)

        self.add(self.tabbedPane, BorderLayout.CENTER)

        exitPanel = JPanel()
        saveBtn = JButton(self.app.strings.getString("OK"),
                          ImageProvider.get("ok"),
                          actionPerformed=self.on_saveBtn_clicked)
        cancelBtn = JButton(self.app.strings.getString("cancel"),
                            ImageProvider.get("cancel"),
                            actionPerformed=self.on_cancelBtn_clicked)
        saveBtn.setToolTipText(self.app.strings.getString("save_preferences"))
        saveBtn.setAlignmentX(0.5)
        exitPanel.add(saveBtn)
        exitPanel.add(cancelBtn)
        self.add(exitPanel, BorderLayout.PAGE_END)

        self.addWindowListener(self)
        self.pack()

    def windowClosing(self, windowEvent):
        self.on_cancelBtn_clicked()

    def hyperlinkUpdate(self, e):
        if e.getEventType() == HyperlinkEvent.EventType.ACTIVATED:
            OpenBrowser.displayUrl(e.getURL().toString())

    def itemStateChanged(self, e):
        """A ttol has been activated/deactivated.
           Check if at least one tool is on.
        """
        if all(not button.isSelected() for button in self.toolsCBtns):
            JOptionPane.showMessageDialog(
                Main.parent,
                self.app.strings.getString("tools_disabled_warning"),
                self.app.strings.getString("tools_disabled_warning_title"),
                JOptionPane.WARNING_MESSAGE)
            source = e.getItemSelectable()
            source.setSelected(True)

    def actionPerformed(self, e=None):
        """Enable/disable favourite zones panel
        """
        for container in (self.scrollPane, self.buttonsPanel):
            self.enableComponents(container, self.favZoneStatusCBtn.isSelected())
        if self.favZoneStatusCBtn.isSelected():
            self.check_removeBtn_status()

    def enableComponents(self, container, enable):
        components = container.getComponents()
        for component in components:
            component.setEnabled(enable)
            if isinstance(component, Container):
                self.enableComponents(component, enable)

    def on_downloadBtn_clicked(self, e):
        update_checker.Updater(self.app, "manual")

    def clean_map(self):
        """Remove all rectangles and polygons from the map
        """
        self.zonesMap.removeAllMapRectangles()
        self.zonesMap.removeAllMapPolygons()
开发者ID:floscher,项目名称:qat_script,代码行数:69,代码来源:PreferencesFrame.py

示例12: WorkHelper

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........
    def mCategories(self, e):
        "@sig public void setExpression(java.lang.String e)"
        """
Takes every line of text form the Input Area and by using a
string composotion it creates the output in the SPSS dimension
categories format.
"""
        try:
            StartIndex = int(self.iStart.getText())
        except ValueError:
            StartIndex=1




        text=self.area1.getText().rstrip()
        
        
        counter=StartIndex
        lastindex=0
        textO=""
        
        for i in range(0,len(text)):
                if text[i]=='\n':
                        textO=textO+("_"+str(counter)+' "'+text[lastindex:i]+'",\n')
                        lastindex=i+1
                        counter=counter+1

        if len(text[lastindex:len(text)])>0:
                textO=textO+("_"+str(counter)+' "'+text[lastindex:len(text)]+'"')


        if len(textO)>0:
            if self.cCurly.isSelected():
                textO = "{\n"+ textO + "\n}"
                if self.cSemiC.isSelected():
                    textO = textO + ";"
            self.copyToClipboard(textO)    
            self.area2.setText(textO)
    
    def copyToClipboard(self, text):
            if self.cCtClipB.isSelected():
                stringSelection = StringSelection(text)
                self.clipboard.setContents(stringSelection, None)
            
        
        
    def bCopyToInput(self, e):
        "@sig public void setExpression(java.lang.String e)"
        """Copy the Text from the Output Area to the input Area for further operations"""
        
        self.area1.setText(self.area2.getText())
    
    def bRemoveNBSP_L(self, e):
        "@sig public void setExpression(java.lang.String e)"
        text=self.area1.getText().rstrip()
        textO=""
        lastindex=0
        
        for i in range(0,len(text)):
            if text[i] == '\n':
                textO = textO+text[lastindex:i].lstrip()+"\n"
                lastindex=i+1
                #print(text[0:i].lstrip()+'\n')
        if len(text[lastindex:len(text)])>0:
                textO=textO+text[lastindex:len(text)].lstrip()
开发者ID:Azyl,项目名称:WorkHelper,代码行数:70,代码来源:test.py

示例13: WorkHelper

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........
    def mCategories(self, e):
        "@sig public void setExpression(java.lang.String e)"
        """
        Takes every line of text form the Input Area and by using a
        string composition it creates the output in the SPSS dimension
        categories format.
        """
        try:
            StartIndex = int(self.iStart.getText())
        except ValueError:
            StartIndex=1




        text=self.area1.getText().rstrip()


        counter=StartIndex
        lastindex=0
        textO=""

        for i in range(0,len(text)):
                if text[i]=='\n':
                        textO=textO+("_"+str(counter)+' "'+text[lastindex:i]+'",\n')
                        lastindex=i+1
                        counter=counter+1

        if len(text[lastindex:len(text)])>0:
                textO=textO+("_"+str(counter)+' "'+text[lastindex:len(text)]+'"')


        if len(textO)>0:
            if self.cCurly.isSelected():
                textO = "{\n"+ textO + "\n}"
                if self.cSemiC.isSelected():
                    textO = textO + ";"
            self.copyToClipboard(textO)
            self.area2.setText(textO)

    def copyToClipboard(self, text):
            if self.cCtClipB.isSelected():
                stringSelection = StringSelection(text)
                self.clipboard.setContents(stringSelection, None)



    def bCopyToInput(self, e):
        "@sig public void setExpression(java.lang.String e)"
        """Copy the Text from the Output Area to the input Area for further operations"""

        self.area1.setText(self.area2.getText())

    def bRemoveNBSP_L(self, e):
        "@sig public void setExpression(java.lang.String e)"
        text=self.area1.getText().rstrip()
        textO=""
        lastindex=0

        for i in range(0,len(text)):
            if text[i] == '\n':
                textO = textO+text[lastindex:i].lstrip()+"\n"
                lastindex=i+1
                #print(text[0:i].lstrip()+'\n')
        if len(text[lastindex:len(text)])>0:
                textO=textO+text[lastindex:len(text)].lstrip()
开发者ID:Azyl,项目名称:WorkHelper,代码行数:70,代码来源:WorkHelper.py

示例14: BurpExtender

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........

    def reloadProjects(self):
        self.currentProject.setModel(DefaultComboBoxModel(self.config.options('projects')))

    def rmProj(self, event):
        if self.popUpAreYouSure() == JOptionPane.YES_OPTION:
            self._requestViewer.setMessage("None", False)
            self._responseViewer.setMessage("None", False)
            shutil.rmtree(self.projPath.getText())
            self.config.remove_option('projects',self.currentProject.getSelectedItem())
            self.reloadProjects()
            self.currentProject.setSelectedIndex(0)
            self.loadVulnerabilities(self.projPath.getText())

    def popup(self,msg):
        JOptionPane.showMessageDialog(None,msg)

    def addProj(self, event):
        projPath = self.projPath.getText()
        if projPath == None or projPath == "":
            self.popup("Please select path")
            return
        self.config.set('projects', self.projName.getText(), projPath)
        self.saveCfg()
        xml = ET.Element('project')
        name = ET.SubElement(xml, "name")
        path = ET.SubElement(xml, "path")
        details = ET.SubElement(xml, "details")
        autoSaveMode = ET.SubElement(xml, "autoSaveMode")

        name.text = self.projName.getText()
        path.text = projPath
        details.text = self.projDetails.getText()
        autoSaveMode.text = str(self.autoSave.isSelected())
        tree = ET.ElementTree(xml)
        try:
            tree.write(self.getCurrentProjPath()+'/project.xml')
        except:
            self.popup("Invalid path")
            return

        self.reloadProjects()
        self.clearVulnerabilityTab()
        self.clearList(None)
        self.currentProject.getModel().setSelectedItem(self.projName.getText())

    def resize(self, image, width, height):
        bi = BufferedImage(width, height, BufferedImage.TRANSLUCENT)
        g2d = bi.createGraphics()
        g2d.addRenderingHints(RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY))
        g2d.drawImage(image, 0, 0, width, height, None)
        g2d.dispose()
        return bi;

    def clearStr(self, var):
        return var.replace(" " , "_").replace("\\" , "").replace("/" , "").replace(":" , "").replace("*" , "").replace("?" , "").replace("\"" , "").replace("<" , "").replace(">" , "").replace("|" , "").replace("(" , "").replace(")" , "")

    def popUpAreYouSure(self):
        dialogResult = JOptionPane.showConfirmDialog(None,"Are you sure?","Warning",JOptionPane.YES_NO_OPTION)
        if dialogResult == 0:
            return 0
        return 1

    def removeSS(self,event):
        if self.popUpAreYouSure() == JOptionPane.YES_OPTION:
            os.remove(self.getCurrentVulnPath() + "/" + self.ssList.getSelectedValue())
开发者ID:anhnt4288,项目名称:PT-Manager,代码行数:70,代码来源:PTManager.py

示例15: BurpExtender

# 需要导入模块: from javax.swing import JCheckBox [as 别名]
# 或者: from javax.swing.JCheckBox import isSelected [as 别名]

#.........这里部分代码省略.........
        self.ASCII2HexEnabled.setToolTipText("Enable ASCII 2 Hex encoding/decoding") 
        self.URLEnabled.setToolTipText("Enable URL encoding/decoding")
        self.IntruderEnabled.setToolTipText("Check this if You want the extension to intercept and modify every request made by the Burp Intruder containing the selected paramter")
        self.ScannerEnabled.setToolTipText("Check this if You want the extension to intercept and modify every request made by the Burp Scanner containing the selected paramter")

        #add checkboxes to the panel            
        panel1.add(self.parameterName)
        panel1.add(self.POSTparameterTypeRadioButton)
        panel1.add(self.GETparameterTypeRadioButton)
        panel1.add(self.COOKIEparameterTypeRadioButton)
        panel1.add(self.base64Enabled)
        panel1.add(self.URLEnabled)
        panel1.add(self.ASCII2HexEnabled)
        panel1.add(self.IntruderEnabled)
        panel1.add(self.ScannerEnabled)
        #assign tabPane
        self.tab = tabPane
        
    def reloadConf(self,event):
        #~ if DEBUG:
            #~ import pdb; pdb.set_trace()
        source = event.getSource()
        print 'APPLY button clicked. New configuration loaded.'
        global MAGIC_PARAMETER
        global PARAMETERISPOST
        global PARAMETERISGET
        global PARAMETERISCOOKIE
        global BASE64ENCODINGENABLED
        global ASCII2HEXENCODINGENABLED
        global URLENCODINGENABLED
        global INTRUDERENABLED
        global SCANNERENABLED
        MAGIC_PARAMETER=self.parameterName.getText()
        print 'Base64 checkbox is: '+str(self.base64Enabled.isSelected())
        if self.base64Enabled.isSelected(): 
            BASE64ENCODINGENABLED=True
        else:
            BASE64ENCODINGENABLED=False
        print 'ASCII2Hex checkbox is: '+str(self.ASCII2HexEnabled.isSelected())
        if self.ASCII2HexEnabled.isSelected(): 
            ASCII2HEXENCODINGENABLED=True
        else:
            ASCII2HEXENCODINGENABLED=False
        print 'URL checkbox is: '+str(self.URLEnabled.isSelected())
        if self.URLEnabled.isSelected(): 
            URLENCODINGENABLED=True
        else:
            URLENCODINGENABLED=False
        print 'New Magic parameter is: '+str(MAGIC_PARAMETER)
        if self.POSTparameterTypeRadioButton.isSelected(): #BODYPARAM
            PARAMETERISPOST=True
            print "parameterispost has been set to: " + str(PARAMETERISPOST)
        else:
            PARAMETERISPOST=False
            print "parameterispost has been set to: " + str(PARAMETERISPOST)
        if self.GETparameterTypeRadioButton.isSelected(): #GETPARAM
            PARAMETERISGET=True
            print "parameterisget has been set to: " + str(PARAMETERISGET)
        else:
            PARAMETERISGET=False
            print "parameterisget has been set to: " + str(PARAMETERISGET)
        if self.COOKIEparameterTypeRadioButton.isSelected(): #COOKIEPARAM
            PARAMETERISCOOKIE=True
            print "parameteriscookie has been set to: " + str(PARAMETERISCOOKIE)
        else:
            PARAMETERISCOOKIE=False
开发者ID:marcotinari,项目名称:CustomDeserializer,代码行数:70,代码来源:CustomDeserializer.py


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