Exemple #1
0
 def tag_4_11(self, c):
     # 创建 检查框
     self.is_purge_forward_requests_box = JCheckBox(
         u'转发PURGE请求', ForwardRequestsConfig.IS_PURGE_FORWARD_REQUESTS)
     self.setFontBold(self.is_purge_forward_requests_box)
     self.is_purge_forward_requests_box.setForeground(Color(0, 0, 153))
     c.insets = Insets(5, 5, 5, 5)
     c.gridx = 0
     c.gridy = 11
     self.white_list_http_method_settings.add(
         self.is_purge_forward_requests_box, c)
Exemple #2
0
 def tag_4_8(self, c):
     # 创建 检查框
     self.is_options_forward_requests_box = JCheckBox(
         u'转发OPTIONS请求', ForwardRequestsConfig.IS_OPTIONS_FORWARD_REQUESTS)
     self.setFontBold(self.is_options_forward_requests_box)
     self.is_options_forward_requests_box.setForeground(Color(0, 0, 153))
     c.insets = Insets(5, 5, 5, 5)
     c.gridx = 0
     c.gridy = 8
     self.white_list_http_method_settings.add(
         self.is_options_forward_requests_box, c)
Exemple #3
0
 def startOrStop(self, event):
     if self.startButton.getText() == "Autorize is off":
         self.startButton.setText("Autorize is on")
         self.startButton.setBackground(Color.GREEN)
         self.intercept = 1
         self._callbacks.registerHttpListener(self)
     else:
         self.startButton.setText("Autorize is off")
         self.startButton.setBackground(Color(255, 100, 91, 255))
         self.intercept = 0
         self._callbacks.removeHttpListener(self)
Exemple #4
0
    def __init__(self, frame, textComponent):
        JWindow.__init__(self, frame)
        self.textComponent = textComponent
        self.size = (200, 200)
        self.list = JList(keyPressed=self.key)
        self.list.setBackground(Color(255, 255, 225))  # TODO move this color
        self.getContentPane().add(JScrollPane(self.list))
        self.list.setSelectedIndex(0)

        self.originalData = ""
        self.data = ""
        self.typed = ""
Exemple #5
0
    def start(self):    
        self.bot=Bot()
        self.add(self.bot, 0, 0,1)
        #view=space.View(self, (0, -10, 5))


        for i in range(6):
            self.add(space.Box(1,1,1,mass=1,color=Color(0x8888FF),
            flat_shading=False),random.uniform(-5,5),random.uniform(-5,5),
            random.uniform(4,6))
        
        self.sch.add(space.Room.start,args=(self,))
Exemple #6
0
 def keyPressed(self, event):
   text = event.getSource().getText()
   try:
     # Attempt to parse number, will throw an error when not possible
     value = self.parse(text)
     # Update the params dictionary
     self.params[self.key] = value
     # Signal success
     event.getSource().setBackground(Color.white)
   except:
     print "Can't parse number from: %s" % text
     event.getSource().setBackground(Color(1.0, 82/255.0, 82/255.0))
Exemple #7
0
    def update_status(self):
        self.status.set("Updating...", bg=Color(0xCCCCCC))

        def set_username(hunter):
            txt = "Connected as {}".format(hunter.username)
            self.status.set(txt, Color(0x006400), Color.WHITE)

        def set_error(error):
            txt = "Disconnected  - {}".format(error.message)
            self.status.set(txt, Color(0xB80000), Color.WHITE)

        async_call(context.api.get_user, set_username, set_error)
Exemple #8
0
def styleApp():
    uiDefaults = UIManager.getDefaults()
    e = uiDefaults.keys()
    while e.hasMoreElements():
       obj = e.nextElement()
       if type(obj) == types.StringType:
           if obj.endswith("background") and \
              isinstance(uiDefaults.get(obj), Color):
               if str(obj).startswith('List.'):
                   uiDefaults.put(obj, Color(240, 240, 240))
               else:
                   uiDefaults.put(obj, Color.WHITE)
Exemple #9
0
    def paintComponent(self, g):
        core.DataViewComponent.paintComponent(self, g)

        dt_tau = None
        if not self.ignore_filter and self.view.tau_filter > 0:
            dt_tau = self.view.dt / self.view.tau_filter
        try:
            data = self.data.get(start=self.view.current_tick,
                                 count=1,
                                 dt_tau=dt_tau)[0]
        except:
            return

        x0 = self.margin / 2.0
        y0 = self.margin / 2.0 + self.label_offset
        g.color = Color.black
        g.drawRect(
            int(x0) - 1,
            int(y0) - 1, int(self.size.width - self.margin),
            int(self.size.height - self.label_offset - self.margin) + 1)

        dy = float(self.size.height - self.label_offset - self.margin) / len(
            self.names)

        for i, n in enumerate(self.names):
            c = 1 - data[i]
            if c < 0:
                c = 0.0
            if c > 1:
                c = 1.0
            g.color = Color(c, c, c)
            g.fillRect(int(x0), int(y0 + dy * i),
                       int(self.size.width - self.margin - 1), int(dy + 1))

            if c < 0.5:
                g.color = Color.white
            else:
                g.color = Color.black

            bounds = g.font.getStringBounds(n, g.fontRenderContext)

            if self.show_values:
                textx = self.size.width / 4 - bounds.width / 2
            else:
                textx = self.size.width / 2 - bounds.width / 2
            g.drawString(n, textx,
                         int(y0 + dy * i + dy / 2 + bounds.height / 2))

            if self.show_values:
                v = '%4.2f' % data[i]
                bounds = g.font.getStringBounds(v, g.fontRenderContext)
                g.drawString(v, self.size.width * 3 / 4 - bounds.width / 2,
                             int(y0 + dy * i + dy / 2 + bounds.height / 2))
Exemple #10
0
 def setPixels(self, pixels):
    """Sets image to the provided 2D list of pixels (col, row) - each pixel is a list of RGB values, e.g., [255, 0, 0].""" 
    
    self.height = len(pixels)        # get number of rows
    self.width  = len(pixels[0])     # get number of columns (assume all columns have same length
    
    #for row in range(self.height-1, 0, -1):   # iterate through all rows      
    for row in range(0, self.height):   # iterate through all rows     
       for col in range(self.width):    # iterate through every column on this row
       
          RGBlist = pixels[row][col]
          #self.setPixel(col, row, RGBlist)   # this works also (but slower)
          color = Color(RGBlist[0], RGBlist[1], RGBlist[2])  # create color from RGB values
          self.image.setRGB(col, row, color.getRGB())
Exemple #11
0
def convertColorToJava(color='green'):
    """Convert a variety of input formats into a java.awt.Color object.
    
    Args:
        color: Default value is "green". This function understands:
               * color names (such as "green")
               * hex strings (such as "#ff00ff")
               * sequences of three colors ((255, 0.1, 1))
               
    Returns:
        java.awt.Color object for the given color.
    """
    red, green, blue = convertColor(color)
    return Color(red.getConstant(), green.getConstant(), blue.getConstant())
Exemple #12
0
    def __init__(self):

        dataDir = Settings.dataDir + 'WorkingWithTables/AlignText/'

        pres = Presentation()

        # Get the first slide
        slide = pres.getSlides().get_Item(0)

        # Define columns with widths and rows with heights
        dbl_cols = [120, 120, 120, 120]
        dbl_rows = [100, 100, 100, 100]

        # Add table shape to slide
        tbl = slide.getShapes().addTable(100, 50, dbl_cols, dbl_rows)

        # Add text to the merged cell
        tbl.getRows().get_Item(0).get_Item(1).getTextFrame().setText("10")
        tbl.getRows().get_Item(0).get_Item(2).getTextFrame().setText("20")
        tbl.getRows().get_Item(0).get_Item(3).getTextFrame().setText("30")

        # Accessing the text frame
        txt_frame = tbl.getRows().get_Item(0).get_Item(0).getTextFrame()

        # Create the Paragraph object for text frame
        para = txt_frame.getParagraphs().get_Item(0)

        # Create Portion object for paragraph

        fillType = FillType()
        color = Color()

        portion = para.getPortions().get_Item(0)
        portion.setText("Text here")
        portion.getPortionFormat().getFillFormat().setFillType(fillType.Solid)
        portion.getPortionFormat().getFillFormat().getSolidFillColor(
        ).setColor(color.BLACK)

        # Aligning the text vertically
        textVerticalType = TextVerticalType()
        cell = tbl.getRows().get_Item(0).get_Item(0)
        textAnchorType = TextAnchorType()
        cell.setTextAnchorType(textAnchorType.Center)
        cell.setTextVerticalType(textVerticalType.Vertical270)

        # Write the presentation as a PPTX file
        save_format = SaveFormat()
        pres.save(dataDir + "AlignText.pptx", save_format.Pptx)

        print "Aligned Text, please check the output file."
Exemple #13
0
 def testPixWrite(self):
     color1 = Color(self.consts['1RED'], self.consts['1GREEN'],
                    self.consts['1BLUE'])
     setColor(self.pix1, color1)
     writePictureTo(self.pic1, self.consts['TMPFILE'])
     self.pic2 = Picture()
     self.pic2.loadImage(self.consts['TMPFILE'])
     self.pix2 = getPixel(self.pic2, self.consts['XVAL'],
                          self.consts['YVAL'])
     os.remove(self.consts['TMPFILE'])
     self.assert_(
         getColor(self.pix1) == getColor(self.pix2),
         'Pixel change did not properly save to file.  You may need to delete %s from the working directory.'
         % (self.consts['TMPFILE']))
Exemple #14
0
def backtrack_call(instruction, register, depth=0):
	global backtrackTable
	global backtrackStart
	if depth > MAXDEPTH:    # limiting recursiv backtracking depth by setting MAXDEPT
		return 0
	if depth == 0:          # reset backtracking table
		backtrackTable = []
		backtrackStart = instruction
	func = getFunctionContaining(instruction.address)
	instruction = instruction.previous     # jump to previous instruction to avoid endless loop :)
	
	if (instruction, register) in backtrackTable:   # already visited this instruction regarding this register change 
		return 0

	while func.getBody().contains(instruction.address):
		monitor.checkCanceled()
		mnemonic = instruction.mnemonicString
		atr1 = instruction.getOpObjects(0)
		atr2 = instruction.getOpObjects(1)
		
		for a1 in atr1:
			monitor.checkCanceled()
			if not isinstance(a1, Register):
				continue
			if (instruction, a1) in backtrackTable:
				break
			elif register.getBaseRegister().contains(a1) :
				line_start = '%s  --> 0x%s %s\t' % ('\t'*depth, instruction.address, instruction)
				if atr2 and isinstance(atr2[0], Scalar):
					cf = getFunctionContaining(toAddr(atr2[0].getUnsignedValue()))
					if cf:
						print(line_start+'(Address of known function: %s)' % cf.entryPoint)
						if not backtrackStart.getOperandReferences(0):
							backtrackStart.addOperandReference(0, cf.entryPoint, COMPUTED_CALL, USER_DEFINED)
					else:
						print(line_start+'(Static value assignment found in code) %s' % atr2[0])
				elif instruction.pcode[0].opcode == INT_XOR and atr1 == atr2:
					print(line_start+'(Resets %s to 0x0)' % a1)
				elif instruction.pcode[0].opcode == COPY and atr1 == atr2:
					print(line_start+'(2-byte NOP for alignment)')
				else:
					print(line_start)
				
				setBackgroundColor(instruction.address, Color(255/MAXDEPTH*depth,255,255/MAXDEPTH*depth))
				backtrackTable.append((instruction, register))
				
				for a2 in atr2:
					if isinstance(a2, Register):
						backtrack_call(instruction, a2, depth+1)
		instruction = instruction.previous
class ExecutionStyle(object):
    pythonExecution = AttributeNamespace('pythonExecution')

    labelStyle = InheritedAttributeNonNull(
        pythonExecution, 'labelStyle', StyleSheet,
        StyleSheet.style(Primitive.fontSize(10)))

    stdOutStyle = InheritedAttributeNonNull(
        pythonExecution, 'stdOutStyle', StyleSheet,
        StyleSheet.style(
            Primitive.border(
                SolidBorder(1.0, 3.0, 7.0, 7.0, Color(0.5, 1.0, 0.5),
                            Color(0.9, 1.0, 0.9))),
            Primitive.foreground(Color(0.0, 0.5, 0.0))))
    stdErrStyle = InheritedAttributeNonNull(
        pythonExecution, 'stdErrStyle', StyleSheet,
        StyleSheet.style(
            Primitive.border(
                SolidBorder(1.0, 3.0, 7.0, 7.0, Color(1.0, 0.75, 0.5),
                            Color(1.0, 0.95, 0.9))),
            Primitive.foreground(Color(0.75, 0.375, 0.0))))
    exceptionBorderStyle = InheritedAttributeNonNull(
        pythonExecution, 'exceptionBorderStyle', StyleSheet,
        StyleSheet.style(
            Primitive.border(
                SolidBorder(1.0, 3.0, 7.0, 7.0, Color(0.8, 0.0, 0.0),
                            Color(1.0, 0.9, 0.9)))))
    resultBorderStyle = InheritedAttributeNonNull(
        pythonExecution, 'resultBorderStyle', StyleSheet,
        StyleSheet.style(
            Primitive.border(
                SolidBorder(1.0, 3.0, 10.0, 10.0, Color(0.0, 0.0, 0.8),
                            Color.WHITE))))

    resultBoxStyle = InheritedAttributeNonNull(
        pythonExecution, 'resultSpacing', StyleSheet,
        StyleSheet.style(Primitive.columnSpacing(5.0)))

    @PyDerivedValueTable(pythonExecution)
    def _resultBoxStyle(style):
        resultSpacing = style.get(ExecutionStyle.resultSpacing)
        return style.withValues(Primitive.columnSpacing(resultSpacing))
Exemple #16
0
    def initConfigurationTab(self):
        #
        ##  init configuration tab
        #
        self.prevent304 = JCheckBox("Prevent 304 Not Modified status code")
        self.prevent304.setBounds(290, 25, 300, 30)

        self.ignore304 = JCheckBox("Ignore 304/204 status code responses")
        self.ignore304.setBounds(290, 5, 300, 30)
        self.ignore304.setSelected(True)

        self.autoScroll = JCheckBox("Auto Scroll")
        self.autoScroll.setBounds(290, 45, 140, 30)

        startLabel = JLabel("Authorization checks:")
        startLabel.setBounds(10, 10, 140, 30)
        self.startButton = JButton("Autorize is off",
                                   actionPerformed=self.startOrStop)
        self.startButton.setBounds(160, 10, 120, 30)
        self.startButton.setBackground(Color(255, 100, 91, 255))

        self.clearButton = JButton("Clear List",
                                   actionPerformed=self.clearList)
        self.clearButton.setBounds(10, 40, 100, 30)

        self.replaceString = JTextArea("Cookie: Insert=injected; header=here;",
                                       5, 30)
        self.replaceString.setWrapStyleWord(True)
        self.replaceString.setLineWrap(True)
        self.replaceString.setBounds(10, 80, 470, 180)

        self.filtersTabs = JTabbedPane()
        self.filtersTabs.addTab("Enforcement Detector", self.EDPnl)
        self.filtersTabs.addTab("Interception Filters", self.filtersPnl)
        self.filtersTabs.addTab("Export", self.exportPnl)

        self.filtersTabs.setBounds(0, 280, 2000, 700)

        self.pnl = JPanel()
        self.pnl.setBounds(0, 0, 1000, 1000)
        self.pnl.setLayout(None)
        self.pnl.add(self.startButton)
        self.pnl.add(self.clearButton)
        self.pnl.add(self.replaceString)
        self.pnl.add(startLabel)
        self.pnl.add(self.autoScroll)
        self.pnl.add(self.ignore304)
        self.pnl.add(self.prevent304)
        self.pnl.add(self.filtersTabs)
Exemple #17
0
def chooseColor(initialColor, dialogTitle="Choose Color"):
    """Prompts the user to pick a color using the default color-chooser
    dialog box.

    Args:
        initialColor (Color): A color to use as a starting point in the
            color choosing popup.
        dialogTitle (str): The title for the color choosing popup.
            Defaults to "Choose Color". Optional.

    Returns:
        Color: The new color chosen by the user.
    """
    print(initialColor, dialogTitle)
    return Color()
Exemple #18
0
   def getPixels(self):
      """Returns a 2D list of pixels (col, row) - each pixel is a list of RGB values, e.g., [255, 0, 0].""" 
      
      pixels = []                      # initialize list of pixels
      #for row in range(self.height-1, 0, -1):   # load pixels from image      
      for row in range(0, self.height):   # load pixels from image      
         pixels.append( [] )              # add another empty row
         for col in range(self.width):    # populate row with pixels    
            # RGBlist = self.getPixel(col, row)   # this works also (but slower)    
            color = Color(self.image.getRGB(col, row))  # get pixel's color
            RGBlist = [color.getRed(), color.getGreen(), color.getBlue()]  # create list of RGB values (0-255)
            pixels[-1].append( RGBlist )   # add a pixel as (R, G, B) values (0-255, each)

      # now, 2D list of pixels has been created, so return it
      return pixels
Exemple #19
0
    def tag_2_3(self, c):
        self.url_forward_xray = JCheckBox(
            u'是否将请求转发到xray', ForwardRequestsConfig.URL_FORWARD_XRAY)
        self.setFontBold(self.url_forward_xray)
        self.url_forward_xray.setForeground(Color(0, 0, 153))
        c.insets = Insets(5, 5, 5, 5)
        c.gridx = 0
        c.gridy = 5
        self.forward_requests_settings.add(self.url_forward_xray, c)

        self.xray_listen_text_field = JTextField(u"127.0.0.1:7777")
        c.fill = GridBagConstraints.BOTH
        c.gridx = 0
        c.gridy = 6
        self.forward_requests_settings.add(self.xray_listen_text_field, c)
Exemple #20
0
    def prepareRenderer(self, renderer, row, col):
        comp = JTable.prepareRenderer(self, renderer, row, col)
        value = self.getValueAt(
            self._extender.logTable.convertRowIndexToModel(row), col)

        if col == 0:
            if "Vulnerable" in value:
                comp.setBackground(Color(255, 153, 153))
                comp.setForeground(Color.BLACK)
            elif "Possible" in value:
                comp.setBackground(Color(255, 204, 153))
                comp.setForeground(Color.BLACK)
            else:
                comp.setBackground(Color(204, 255, 153))
                comp.setForeground(Color.BLACK)
        else:
            comp.setForeground(Color.BLACK)
            comp.setBackground(Color.WHITE)

        selectedRow = self._extender.logTable.getSelectedRow()
        if selectedRow == row:
            comp.setBackground(Color(201, 215, 255))
            comp.setForeground(Color.BLACK)
        return comp
def drawLines(imp, points=None):
    if points and (len(points) % 2 == 0):
        # points is numeric list of even length
        pRoi = PointRoi(points[0::2], points[1::2], len(points) / 2)
        pRoi.setShowLabels(True)
        pRoi.setSize(3)
        imp.setRoi(pRoi)
    roi = imp.getRoi()
    pp = roi.getFloatPolygon()
    # print "Added", pp.npoints
    if pp.npoints <= 1:
        # don't draw if only one point
        return
    xys = []
    for i in xrange(pp.npoints):
        xys.append([pp.xpoints[i], pp.ypoints[i]])
    ol = Overlay()
    x0 = xys[0][0]
    y0 = xys[0][1]
    cal = imp.getCalibration()
    for i in xrange(1, pp.npoints):
        xi = xys[i][0]
        yi = xys[i][1]
        # prepare text label
        d = math.sqrt((xi - x0)**2 + (yi - y0)**2) * cal.pixelWidth
        dText = String.format("%.2f ", d) + cal.getUnits()
        textOffset = 30
        xt = xi
        yt = yi
        #        if xi > x0:
        #            xt += textOffset
        if xi < x0:
            xt -= textOffset


#        if yi > y0:
#            yt += textOffset
        if yi < y0:
            yt -= textOffset
        dTextRoi = TextRoi(xt, yt, dText)
        ol.add(dTextRoi)

        lineRoi = Line(x0, y0, xi, yi)
        lineRoi.setStrokeWidth(1)
        lineRoi.setStrokeColor(Color(255, 255, 0))
        ol.add(lineRoi)
    imp.setOverlay(ol)
    imp.updateAndDraw()
Exemple #22
0
 def get_attribs(color, error=False):
     '''
     Closure to make the generation of font styling cleaner.
     Note closures need to be defined before being invoked.
     '''
     attribs = SimpleAttributeSet()
     StyleConstants.setFontFamily(attribs, self.font.getFamily())
     StyleConstants.setFontSize(attribs, self.font.getSize())
     StyleConstants.setForeground(attribs, Color(*self.colorlut[color]))
     # Add yellow background to error line styling
     # White if no error, otherwise it'll keep on being yellow forever
     if error:
         StyleConstants.setBackground(attribs, Color.yellow)
     else:
         StyleConstants.setBackground(attribs, Color.white)
     return attribs
Exemple #23
0
 def makeMe(self):
     self.colormake = C
     self.test = disk(P2(0.0,0.96))
     
     self.setTitle("Functional Graphics")
     self.setLayout(None) 
     self.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
     self.setLocationRelativeTo(None)
     self.setSize(winsize*2,winsize*2)
     self.setVisible(True)
     
     self.panel = GameWindow(lambda g: self.mypaint(g),lambda x, y: self.myclick(x, y))
     self.panel.setBackground(Color(100,250,100))
     self.getContentPane().add(self.panel)
     self.panel.setBounds(10,10,winsize,winsize)
     self.panel.setOpaque(False)
Exemple #24
0
 def keyReleased(self, event):
     src = event.getSource()
     text = src.getText()
     try:
         # Attempt to parse number, will throw an error when not possible
         value = self.parse(float(text))
         # Update the params dictionary
         self.params[self.key] = value
         # Update the text, in case it was cast to int
         if int == self.parse:
             event.getSource().setText(str(value))
         # Signal success
         event.getSource().setBackground(Color.white)
     except:
         print "Can't parse number from: %s" % text
         event.getSource().setBackground(Color(1.0, 82 / 255.0, 82 / 255.0))
    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()

        self.exclusionLabel = swing.JLabel(
            "Exclusion list (separated by by comma):")
        self.exclusionInput = swing.JTextField(focusLost=self.save_config)

        # 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.exclusionLabel).addComponent(
                        self.exclusionInput).addComponent(
                            self.outputLabel).addComponent(
                                self.logPane).addComponent(
                                    self.clearBtn).addComponent(
                                        self.exportBtn))))

        layout.setVerticalGroup(layout.createParallelGroup().addGroup(
            layout.createParallelGroup().addGroup(
                layout.createSequentialGroup().addComponent(
                    self.exclusionLabel).addComponent(
                        self.exclusionInput).addComponent(
                            self.outputLabel).addComponent(
                                self.logPane).addComponent(
                                    self.clearBtn).addComponent(
                                        self.exportBtn))))
Exemple #26
0
    def __init__(self):

        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())

        size = Dimension(800, 800)
        self.setPreferredSize(size)

        screenSize = Toolkit.getDefaultToolkit().getScreenSize()
        self.setLocation(screenSize.getSize().width / 2 - size.width / 2, 100)
        self.setTitle("bashED Terminal HQ EXTREME")

        self.setUndecorated(True)
        self.getRootPane().setOpaque(False)
        #self.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
        self.setBackground(Color(0, 128, 0, 198))

        #j = JDesktopPane()
        #j.setOpaque(False)
        self.setLayout(None)

        self.setIconImage(ImageIcon('bin/gui/media/' + "icon.png").getImage())

        mp = MainPanel()
        self.add(mp)
        mp.setBounds(0, 0, size.width, size.height)

        imageTest = ImageIcon('bin/gui/media/' + "image.png")
        imageTestLabel = JLabel(imageTest)
        self.add(imageTestLabel)
        imageTestLabel.setBounds(0, 0, size.width, size.height)
        #self.getContentPane().add(mp)

        #self.getContentPane().add(JLabel("Iglo"))

        bb = BorderFactory.createLineBorder(Color.BLACK, 5)
        bw1 = BorderFactory.createLineBorder(Color.WHITE, 1)
        bw2 = BorderFactory.createLineBorder(Color.WHITE, 1)

        mp.setBorder(
            BorderFactory.createCompoundBorder(
                bw1, BorderFactory.createCompoundBorder(bb, bw2)))

        #make the window viewable
        self.defaultCloseOperation = JFrame.EXIT_ON_CLOSE
        self.pack()
        self.setVisible(True)
Exemple #27
0
    def highlightTab(self):
        currentPane = self._splitpane
        previousPane = currentPane
        while currentPane and not isinstance(currentPane, JTabbedPane):
            previousPane = currentPane
            currentPane = currentPane.getParent()
        if currentPane:
            index = currentPane.indexOfComponent(previousPane)
            currentPane.setBackgroundAt(index, Color(0xff6633))

            class setColorBackActionListener(ActionListener):
                def actionPerformed(self, e):
                    currentPane.setBackgroundAt(index, Color.BLACK)

            timer = Timer(5000, setColorBackActionListener())
            timer.setRepeats(False)
            timer.start()
Exemple #28
0
    def initUI(self):
        self.manImage = ImageIcon('bin/gui/media/' + "danglewood.gif")
        self.manImageSilent = ImageIcon('bin/gui/media/' +
                                        "danglewood-silent.png")
        self.manLabel = JLabel(self.manImage)

        self.dialogText = JTextPane()
        self.dialogText.setEditable(False)
        self.dialogTextScroller = JScrollPane(self.dialogText)

        self.dialogText.setBackground(Color(0, 24, 0))
        self.dialogText.setForeground(Color.WHITE)
        self.dialogText.setFont(Font("Arial", Font.BOLD, 15))

        self.buttonsPanel = ButtonPanel(self.consolePanel, self)

        self.dialogText.setText("Welcome to BashED!!!")
Exemple #29
0
    def __init__(self, tree, mapContext):
        self.tree = tree
        self.mapContext = mapContext
        self.lblGroup = JLabel()
        self.lblGroup.setBackground(Color(222, 227, 233))  #.BLUE.brighter())
        self.lblGroup.setOpaque(True)
        self.lblGroup.setText(
            "plddddddddddddddddddddddddddddddddddddddddddddddddddddddd")

        self.lblGroupPreferredSize = self.lblGroup.getPreferredSize()
        #h = self.lblGroupPreferredSize.getHeight()
        #w = self.lblGroupPreferredSize.getWidth()
        #self.lblGroupPreferredSize.setSize(h, w)
        self.pnlLayer = JPanel()
        self.pnlLayer.setOpaque(False)

        self.pnlLayer.setLayout(FlowLayout(FlowLayout.LEFT))

        self.lblClean = JLabel()

        self.chkLayerVisibility = JCheckBox()
        self.chkLayerVisibility.setOpaque(False)
        self.lblLayerName = JLabel()
        self.lblLayerIcon = JLabel()
        self.lblFeatureSelecteds = JLabel()

        self.pnlLayer.add(self.chkLayerVisibility)
        self.pnlLayer.add(self.lblClean)
        self.pnlLayer.add(self.lblFeatureSelecteds)
        self.pnlLayer.add(self.lblLayerIcon)
        self.pnlLayer.add(self.lblLayerName)
        self.tree.setRowHeight(
            int(self.pnlLayer.getPreferredSize().getHeight()) - 3)
        self.lblUnknown = JLabel()

        ## Feature
        self.lblFeatureIcon = JLabel()
        self.lblFeatureName = JLabel()
        i18n = ToolsLocator.getI18nManager()
        self.lblFeatureName.setText(i18n.getTranslation("_Feature"))
        self.pnlFeature = JPanel()
        self.pnlFeature.setOpaque(False)
        self.pnlFeature.setLayout(FlowLayout(FlowLayout.LEFT))
        self.pnlFeature.add(self.lblFeatureIcon)
        self.pnlFeature.add(self.lblFeatureName)
Exemple #30
0
    def tag_1_2(self, c):
        # 创建 检查框
        self.url_repeated_box = JCheckBox(
            u'是否启动url重复验证', ForwardRequestsConfig.URL_REPEATED_VERIFY)
        self.setFontBold(self.url_repeated_box)
        self.url_repeated_box.setForeground(Color(0, 0, 153))
        c.insets = Insets(5, 5, 5, 5)
        c.gridx = 0
        c.gridy = 3
        self.settings.add(self.url_repeated_box, c)

        # 在窗口添加一句话
        url_repeated_box_lbl = JLabel(u'打勾-开启验证, 不打勾-关闭验证')
        self.setFontItalic(url_repeated_box_lbl)
        c.insets = Insets(5, 5, 5, 5)
        c.gridx = 0
        c.gridy = 4
        self.settings.add(url_repeated_box_lbl, c)