示例#1
0
文件: Button.java 项目: KeplerFL/Java
 @Override
 public void mouseReleased(MouseEvent e) {
   Main.pressed = false;
   Main.reset();
   Main.send();
   Main.f.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
 }
示例#2
0
文件: Button.java 项目: KeplerFL/Java
  @Override
  public void mouseEntered(MouseEvent e) {

    if (Main.pressed) {
      this.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.red));
      if (!this.premuto) {
        int cx = e.getComponent().getX();
        int cy = e.getComponent().getY();

        cx = cx / 65;
        cy = cy / 65;
        if (Main.lastx == 125) Main.lastx = cx;
        if (Main.lasty == 125) Main.lasty = cy;
        if (Main.IsInRangeM(cx, cy)) {
          Main.lastx = cx;
          Main.lasty = cy;
          Main.sfinale += this.getText();
          premuto = true;
          Main.l.setText(Main.sfinale.substring(4));
        } else {
          Main.pressed = false;
          Main.sfinale = null;
          Main.f.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
          Main.lastx = cx;
          Main.lasty = cy;
          Main.reset();
        }
      }
    }
  }
示例#3
0
 /** MENU BAR ITEMS * */
 @FXML
 private void addFile() {
   FileChooser fileChooser = new FileChooser();
   File file = fileChooser.showOpenDialog(Main.getPrimaryStage());
   if (file != null) {
     // turn into P2PFile and add file to TableView<P2PFile> fileList
     // or maybe add it to the ObservableList<P2PFile> localFiles
     // and the table view will "listen" for it
   }
 }