Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.MouseAdapter


            };
          }
          control.addFocusListener(focusListener);
        }

        mouseListener = new MouseAdapter() {
          public void mouseDown(MouseEvent e) {
            // time wrap?
            // check for expiration of doubleClickTime
            if (shouldFireDoubleClick(activationTime, e.time, activationEvent) && e.button == 1) {
              control.removeMouseListener(mouseListener);
View Full Code Here


      public void widgetSelected(SelectionEvent e) {
        showDialogMenu();
      }
    });
    // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=177183
    toolBar.addMouseListener(new MouseAdapter() {
      public void mouseDown(MouseEvent e) {
        showDialogMenu();
      }
    });
  }
View Full Code Here

          if (!MAC) {
            pe.gc.drawPolygon(getPolygon(true));
          }
        }
      });
      hoverShell.addMouseListener(new MouseAdapter() {
        public void mouseDown(MouseEvent e) {
          hideHover();
        }
      });
    }
View Full Code Here

  /*
   * (non-Javadoc) Method declared on AbstractTreeViewer.
   */
  protected void hookControl(Control control) {
    super.hookControl(control);
    tableTree.getTable().addMouseListener(new MouseAdapter() {
      public void mouseDown(MouseEvent e) {
        /*
         * If user clicked on the [+] or [-], do not activate
         * CellEditor.
         */
 
View Full Code Here

                  applyEditorValue();
                }
              };
            }
            control.addFocusListener(focusListener);
            mouseListener = new MouseAdapter() {
              public void mouseDown(MouseEvent e) {
                // time wrap?
                // check for expiration of doubleClickTime
                if (e.time <= doubleClickExpirationTime) {
                  control.removeMouseListener(mouseListener);
View Full Code Here

              table1LData.minimumHeight = 100;
              availableGameTables = new org.eclipse.swt.widgets.Table(composite1, SWT.SINGLE | SWT.BORDER);
              availableGameTables.setLayoutData(table1LData);
              availableGameTables.setHeaderVisible(true);
              availableGameTables.setLinesVisible(true);
              availableGameTables.addMouseListener(new MouseAdapter() {

                @Override
                public void mouseDoubleClick(MouseEvent evt) {
                  logger.info("Opening table");
                  TableItem[] selectedItems = availableGameTables.getSelection();
                  if (selectedItems.length == 1) {
                    // Open selected table
                    TableId tid = new TableId(Long.parseLong(selectedItems[0].getText(1)));

                    final GameWindow w = getClientCore().getGui().getGameWindow(tid, true);
                    getDisplay().asyncExec(new Runnable() {

                      public void run() {
                        w.show();
                      }
                    });

                  }
                }
              });
              availableGameTables.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent evt) {
                  logger.debug("table1.widgetSelected, event=" + evt);
                  // TODO add your code for
                  // table1.widgetSelected
                }
              });
              {
                nameColumn = new TableColumn(availableGameTables, SWT.NONE);
                nameColumn.setText("Name");
                nameColumn.setWidth(82);
              }
              {
                idColumn = new TableColumn(availableGameTables, SWT.NONE);
                idColumn.setText("Id");
                idColumn.setWidth(15);
              }
              {
                stakesColumn = new TableColumn(availableGameTables, SWT.NONE);
                stakesColumn.setText("Stakes");
                stakesColumn.setWidth(60);
              }
              {
                typeColumn = new TableColumn(availableGameTables, SWT.NONE);
                typeColumn.setText("Type");
                typeColumn.setWidth(60);
              }
              {
                playersColumn = new TableColumn(availableGameTables, SWT.NONE);
                playersColumn.setText("Players");
                playersColumn.setWidth(60);
              }
              {
                tableItem1 = new TableItem(availableGameTables, SWT.NONE);
                tableItem1.setText("No tables available ...");
              }
            }
            {
              createTableButton = new Button(composite1, SWT.PUSH | SWT.CENTER);
              GridData createTableButtonLData = new GridData();
              createTableButtonLData.horizontalAlignment = GridData.CENTER;
              createTableButtonLData.verticalAlignment = GridData.END;
              createTableButtonLData.grabExcessVerticalSpace = true;
              createTableButton.setLayoutData(createTableButtonLData);
              createTableButton.setText("Create Your Own Table");
              createTableButton.addMouseListener(new MouseAdapter() {

                @Override
                public void mouseDown(MouseEvent evt) {
                  logger.info("Table creation requested ...");
                  new TableCreationDialog(LobbyWindow.this).open();
View Full Code Here

        }
        {
          potButton = new Button(manualEnterBetGroup, SWT.PUSH | SWT.CENTER);
          potButton.setText("Pot");
          potButton.setLayoutData(new GridData(40, 30));
          potButton.addMouseListener(new MouseAdapter() {
           
            @Override
            public void mouseDown(MouseEvent evt) {
              setNewBetRaiseAmount(tableState.getGameState().getGamePotSize()
                  + tableState.getGameState().getCallValue(user.getId()));
            }
          });
        }
        {
          betAmountTextField = new Text(manualEnterBetGroup, SWT.CENTER | SWT.BORDER);
          betAmountTextField.setLayoutData(new GridData(70, 20));
          betAmountTextField.setText(ClientGUI.formatBet(0));
          betAmountTextField.addKeyListener(new KeyAdapter() {
           
            @Override
            public void keyReleased(KeyEvent e) {
              betAmountTextField.setToolTipText("Minimum is "
                  + ClientGUI.formatBet(getGameState().getMinNextRaise()
                      + getGameState().getLargestBet()));
              try {
                int desiredAmount = ClientGUI.parseBet(betAmountTextField.getText());
               
                if (desiredAmount - getGameState().getCallValue(user.getId()) >= getGameState()
                    .getMinNextRaise()) {
                  setNewBetRaiseAmount(desiredAmount - getGameState().getCallValue(user.getId()));
                }
              } catch (Exception ex) {
                logger.error("Could not parse manual bet input", ex);
                return;
              }
             
            }
          });
        }
      }
      {
        foldCallRaiseButtonGroup = new Composite(gameActionGroup, SWT.NONE);
        GridLayout foldCallRaiseLayout = new GridLayout(3, false);
        foldCallRaiseButtonGroup.setLayout(foldCallRaiseLayout);
        GridData foldCallRaiseLData = new GridData(SWT.FILL, SWT.CENTER, true, true);
        foldCallRaiseLData.minimumHeight = 30;
        foldCallRaiseLData.minimumWidth = 250;
        foldCallRaiseLData.heightHint = 40;
        foldCallRaiseLData.widthHint = 300;
        foldCallRaiseButtonGroup.setLayoutData(foldCallRaiseLData);
        {
          foldButton = new Button(foldCallRaiseButtonGroup, SWT.PUSH | SWT.CENTER);
          foldButton.setLayoutData(new GridData(50, 30));
          foldButton.setText("Fold");
          foldButton.addMouseListener(new MouseAdapter() {
           
            @Override
            public void mouseDown(MouseEvent evt) {
              foldButtonMouseDown(evt);
            }
          });
        }
        {
          checkCallButton = new Button(foldCallRaiseButtonGroup, SWT.PUSH | SWT.CENTER);
          checkCallButton.setLayoutData(new GridData(90, 30));
          checkCallButton.setText("Call");
          checkCallButton.addMouseListener(new MouseAdapter() {
           
            @Override
            public void mouseDown(MouseEvent evt) {
              checkCallButtonMouseDown(evt);
            }
          });
        }
        {
          betRaiseButton = new Button(foldCallRaiseButtonGroup, SWT.PUSH | SWT.CENTER);
          betRaiseButton.setLayoutData(new GridData(130, 30));
          betRaiseButton.setText("Raise");
          betRaiseButton.addMouseListener(new MouseAdapter() {
           
            @Override
            public void mouseDown(MouseEvent evt) {
              betRaiseButtonMouseDown(evt);
            }
          });
        }
      }
      {
        GridData generalActionHolderLData = new GridData(SWT.CENTER, SWT.CENTER, true, true);
        generalActionHolderLData.heightHint = 120;
        generalActionHolderLData.widthHint = 80;
        generalActionHolder = new Composite(this, SWT.NONE | ClientGUI.COMPOSITE_BORDER_STYLE);
        FillLayout generalActionHolderLayout = new FillLayout(SWT.VERTICAL);
        generalActionHolderLayout.spacing = 5;
        generalActionHolder.setLayout(generalActionHolderLayout);
        generalActionHolder.setLayoutData(generalActionHolderLData);
        generalActionHolder.setVisible(false);
        {
          sitInOutButton = new Button(generalActionHolder, SWT.TOGGLE | SWT.CENTER);
          sitInOutButton.setText("Sit In");
          sitInOutButton.addMouseListener(new MouseAdapter() {
           
            @Override
            public void mouseDown(MouseEvent evt) {
              sitInOutButtonMouseDown(evt);
            }
View Full Code Here

        gridData.heightHint = 148;
        gridData.minimumHeight = 148;
        gridData.widthHint = 350;
        gridData.minimumWidth = 350;
        extendedOperationsTable.setLayoutData( gridData );
        extendedOperationsTable.addMouseListener( new MouseAdapter()
        {
            public void mouseDoubleClick( MouseEvent e )
            {
                if ( extendedOperationsTable.getSelectionIndex() != -1 )
                {
View Full Code Here

        gridData.heightHint = 148;
        gridData.minimumHeight = 148;
        gridData.widthHint = 350;
        gridData.minimumWidth = 350;
        extendedOperationsTable.setLayoutData( gridData );
        extendedOperationsTable.addMouseListener( new MouseAdapter()
        {
            public void mouseDoubleClick( MouseEvent e )
            {
                if ( extendedOperationsTable.getSelectionIndex() != -1 )
                {
View Full Code Here

        gridData.heightHint = 148;
        gridData.minimumHeight = 148;
        gridData.widthHint = 350;
        gridData.minimumWidth = 350;
        interceptorsTable.setLayoutData( gridData );
        interceptorsTable.addMouseListener( new MouseAdapter()
        {
            public void mouseDoubleClick( MouseEvent e )
            {
                if ( interceptorsTable.getSelectionIndex() != -1 )
                {
View Full Code Here

TOP

Related Classes of org.eclipse.swt.events.MouseAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.