예제 #1
0
 def select(e):
     rowAtPoint = self.resultTable.rowAtPoint(
         SwingUtilities.convertPoint(self.resultTablePopupMenu,
                                     Point(0, 0), self.resultTable))
     if rowAtPoint > -1:
         self.resultTable.setRowSelectionInterval(
             rowAtPoint, rowAtPoint)
예제 #2
0
    def redispatchMouseEvent(self, e, repaint):
        glassPanePoint = e.getPoint()
        container = self.contentPane
        containerPoint = SwingUtilities.convertPoint(self.glassPane,
                                                     glassPanePoint,
                                                     self.contentPane)

        if containerPoint.y < 0:  # we're not in the content pane
            if (containerPoint.y + self.menuBar.getHeight() >= 0):
                # The mouse event is over the menu bar. Could handle specially.
                pass
            else:
                #---------------------------------------------------------------
                # The mouse event is over non-system window decorations, e.g.,
                # the ones provided by the Java look and feel.
                # Could handle specially.
                #---------------------------------------------------------------
                pass
        else:
            # The mouse event is probably over the content pane.
            # Find out exactly which component it's over.
            component = SwingUtilities.getDeepestComponentAt(
                container, containerPoint.x, containerPoint.y)

            if component and component == self.liveButton:
                # Forward events over the check box.
                componentPoint = SwingUtilities.convertPoint(
                    self.glassPane, glassPanePoint, component)
                component.dispatchEvent(
                    MouseEvent(component, e.getID(), e.getWhen(),
                               e.getModifiers(), componentPoint.x,
                               componentPoint.y, e.getClickCount(),
                               e.isPopupTrigger()))

        # Update the glass pane if requested.
        if repaint:
            self.glassPane.setPoint(glassPanePoint)
            self.glassPane.repaint()