def helpMenu(self,event): self._helpPopup = JFrame('JWT Fuzzer', size=(550, 450) ); self._helpPopup.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE) helpPanel = JPanel() helpPanel.setPreferredSize(Dimension(550, 450)) helpPanel.setBorder(EmptyBorder(10, 10, 10, 10)) helpPanel.setLayout(BoxLayout(helpPanel, BoxLayout.Y_AXIS)) self._helpPopup.setContentPane(helpPanel) helpHeadingText = JLabel("<html><h2>JWT Fuzzer</h2></html>") authorText = JLabel("<html><p>@author: <pinnace></p></html>") aboutText = JLabel("<html><br /> <p>This extension adds an Intruder payload processor for JWTs.</p><br /></html>") repositoryText = JLabel("<html>Documentation and source code:</html>") repositoryLink = JLabel("<html>- <a href=\"https://github.com/pinnace/burp-jwt-fuzzhelper-extension\">https://github.com/pinnace/burp-jwt-fuzzhelper-extension</a></html>") licenseText = JLabel("<html><br/><p>JWT Fuzzer uses a GPL 3 license. This license does not apply to the dependency below:<p></html>") dependencyLink = JLabel("<html>- <a href=\"https://github.com/jpadilla/pyjwt/blob/master/LICENSE\">pyjwt</a></html>") dependencyLink.addMouseListener(ClickListener()) dependencyLink.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)) repositoryLink.addMouseListener(ClickListener()) repositoryLink.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)) helpPanel.add(helpHeadingText) helpPanel.add(authorText) helpPanel.add(aboutText) helpPanel.add(repositoryText) helpPanel.add(repositoryLink) helpPanel.add(licenseText) helpPanel.add(dependencyLink) self._helpPopup.setSize(Dimension(550, 450)) self._helpPopup.pack() self._helpPopup.setLocationRelativeTo(None) self._helpPopup.setVisible(True) return
def wait( self, event ) : source = event.getSource() prev = source.getCursor() source.setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) ) sleep( 5 ) source.setCursor( prev )
def get_cursor(self): """ Return cursor object. Cursor type and name accessed with object getType and getName methods. """ if not self._cursor: self._cursor = Cursor(Cursor.DEFAULT_CURSOR) return self._cursor
def __init__(self, view, handler): JButton.__init__(self) self.view = view self.icon = GUIUtilities.loadIcon("Find.png") self.margin = Insets(0, 0, 0, 0) self.handler = handler self.alignY = 1 self.actionPerformed = self.action self.cursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR) self.toolTipText = u"Jump to error file %s:%s" % (unicode( handler[0]), unicode(handler[1]))
def set_cursor(self, *cursor): """ Set mouse cursor. Alternative arguments: * JVM system cursor or cursor object * image or surface, hotspot (x,y), and optional name * size, hotspot, data, mask, and optional name Refer to pyj2d.cursors for details. """ args = len(cursor) if len(cursor) == 1: if isinstance(cursor[0], int): self._cursor = Cursor(cursor[0]) else: self._cursor = cursor[0] elif args in (2,3): image = cursor[0] hotspot = Point(*cursor[1]) if args == 2: name = 'Custom Cursor' else: name = cursor[2] tk = Toolkit.getDefaultToolkit() self._cursor = tk.createCustomCursor(image, hotspot, name) elif args in (4,5): size = cursor[0] hotspot = Point(*cursor[1]) data = cursor[2] mask = cursor[3] if args == 4: name = 'Custom Cursor' else: name = cursor[4] surface = cursors.create_cursor(size, data, mask) tk = Toolkit.getDefaultToolkit() self._cursor = tk.createCustomCursor(surface, hotspot, name) else: self._cursor = Cursor(Cursor.DEFAULT_CURSOR) if self._cursorVisible: env.jframe.getContentPane().setCursor(self._cursor)
def keyPressed(self, event): if KeyEvent.VK_ENTER == event.getKeyCode(): regex_field = event.getSource() frame = regex_field.getTopLevelAncestor() # the JFrame window frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)) def repaint(): self.table.updateUI() self.table.repaint() frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)) def filterRows(): self.table.getModel().filter(regex_field.getText()) SwingUtilities.invokeLater(repaint) exe.submit(filterRows)
def keyPressed(self, event): if KeyEvent.VK_ENTER == event.getKeyCode(): self.frame.setCursor(Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR)) ins = self def repaint(): ins.table.updateUI() ins.table.repaint() ins.frame.setCursor( Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)) def filterRows(): ins.table_model.filter(event.getSource().getText()) SwingUtilities.invokeLater(repaint) exe.submit(filterRows)
def mouseMoved(self, event): size = self.resize_border if event.x < size: if event.y < size: self.cursor = Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR) elif event.y >= self.size.height - size: self.cursor = Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR) else: self.cursor = Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR) elif event.x >= self.size.width - size: if event.y < size: self.cursor = Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR) elif event.y >= self.size.height - size: self.cursor = Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR) else: self.cursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR) else: if event.y < size: self.cursor = Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR) elif event.y >= self.size.height - size: self.cursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR) else: self.cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)
def set_visible(self, visible): """ Set mouse cursor visibility according to visible bool argument. Return previous cursor visibility state. """ visible_pre = self._cursorVisible if visible: if not self._cursor: self._cursor = Cursor(Cursor.DEFAULT_CURSOR) env.jframe.getContentPane().setCursor(self._cursor) self._cursorVisible = True else: if not self._cursorBlank: image = BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB) hotspot = Point(0,0) name = 'Blank Cursor' try: tk = Toolkit.getDefaultToolkit() self._cursorBlank = tk.createCustomCursor(image, hotspot, name) except AWTError: return visible_pre env.jframe.getContentPane().setCursor(self._cursorBlank) self._cursorVisible = False return visible_pre
def repaint(): self.table.updateUI() self.table.repaint() frame.setCursor( Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR))
def repaint(): ins.table.updateUI() ins.table.repaint() ins.frame.setCursor( Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR))
from javax.swing.tree import TreePath from org.gvsig.fmap.dal.feature.impl import DefaultFeatureStore from org.gvsig.fmap.mapcontext.layers import LayerListener from tocutils import createToCContextMenu from tocutils import addUpdateToCListener #from tocutils import expandAllNodes from tocutils import getIconFromLayer from tocutils import getIconByName from org.gvsig.tools import ToolsLocator from tocutils import getExpansionState from tocutils import setExpansionState from gvsig import logger from gvsig import LOGGER_WARN, LOGGER_INFO, LOGGER_ERROR waitCursor = Cursor(Cursor.WAIT_CURSOR) defaultCursor = Cursor(Cursor.DEFAULT_CURSOR) def setTreeAsSelectionOrder(tree, mapContext): updateAll(tree, mapContext) tree.setCellRenderer(SelectionCellRenderer(tree, mapContext)) tree.addMouseListener(SelectionMouseAdapter(tree, mapContext)) addUpdateToCListener("SelectionOrder", mapContext, UpdateListener(tree, mapContext)) tree.revalidate() tree.repaint() def updateAll(tree, mapContext): exp = getExpansionState(tree)
def __init__(self, text, url): """ generated source for method __init__ """ super(JLabelHyperlink, self).__init__(text) self.url = url addMouseListener(self) setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR))