public void mousePressed(MouseEvent e) {
   if (e.getButton() != MouseEvent.BUTTON1) {
     return;
   }
   if (e.getClickCount() != 2) {
     return;
   }
   JTable table = (JTable) e.getSource();
   Point p = e.getPoint();
   int row = table.rowAtPoint(p);
   if (row < 0) {
     return;
   }
   PickerTableModel model = getDataModel();
   ICFInternetISOCountryObj o =
       (ICFInternetISOCountryObj) model.getValueAt(row, COLID_ROW_HEADER);
   invokeWhenChosen.choseISOCountry(o);
   try {
     Container cont = getParent();
     while ((cont != null) && (!(cont instanceof JInternalFrame))) {
       cont = cont.getParent();
     }
     if (cont != null) {
       ((JInternalFrame) cont).setClosed(true);
     }
   } catch (Exception x) {
   }
 }
 public void mousePressed(MouseEvent e) {
   if (e.getButton() != MouseEvent.BUTTON1) {
     return;
   }
   if (e.getClickCount() != 2) {
     return;
   }
   JTable table = (JTable) e.getSource();
   Point p = e.getPoint();
   int row = table.rowAtPoint(p);
   if (row < 0) {
     return;
   }
   FinderTableModel model = getDataModel();
   ICFSecurityISOTimezoneObj o =
       (ICFSecurityISOTimezoneObj) model.getValueAt(row, COLID_ROW_HEADER);
   if (o == null) {
     return;
   }
   JInternalFrame frame = swingSchema.getISOTimezoneFactory().newViewEditJInternalFrame(o);
   ((ICFSecuritySwingISOTimezoneJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View);
   if (frame == null) {
     return;
   }
   Container cont = getParent();
   while ((cont != null) && (!(cont instanceof JInternalFrame))) {
     cont = cont.getParent();
   }
   if (cont != null) {
     JInternalFrame myInternalFrame = (JInternalFrame) cont;
     myInternalFrame.getDesktopPane().add(frame);
     frame.setVisible(true);
     frame.show();
   }
 }
예제 #3
0
파일: JImage.java 프로젝트: RussTedrake/lcm
    public void mouseReleased(MouseEvent e) {
      int mods = e.getModifiersEx();

      if (nodrag && e.getButton() == MouseEvent.BUTTON3) {
        popupMenu.show(JImage.this, (int) e.getPoint().getX(), (int) e.getPoint().getY());
      }

      nodrag = true;
      dragBegin = null;
    }
 public void mousePressed(MouseEvent e) {
   if (e.getButton() != MouseEvent.BUTTON1) {
     return;
   }
   if (e.getClickCount() != 2) {
     return;
   }
   JTable table = (JTable) e.getSource();
   Point p = e.getPoint();
   int row = table.rowAtPoint(p);
   if (row < 0) {
     return;
   }
   ListTableModel model = getDataModel();
   ICFInternetVersionObj o = (ICFInternetVersionObj) model.getValueAt(row, COLID_ROW_HEADER);
   if (o == null) {
     return;
   }
   JInternalFrame frame = null;
   String classCode = o.getClassCode();
   if (classCode.equals("VERN")) {
     frame = swingSchema.getVersionFactory().newViewEditJInternalFrame(o);
     frame.addInternalFrameListener(getViewEditInternalFrameListener());
     ((ICFInternetSwingVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View);
   } else if (classCode.equals("MJVR")) {
     frame =
         swingSchema
             .getMajorVersionFactory()
             .newViewEditJInternalFrame((ICFInternetMajorVersionObj) o);
     frame.addInternalFrameListener(getViewEditInternalFrameListener());
     ((ICFInternetSwingMajorVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View);
   } else if (classCode.equals("MNVR")) {
     frame =
         swingSchema
             .getMinorVersionFactory()
             .newViewEditJInternalFrame((ICFInternetMinorVersionObj) o);
     frame.addInternalFrameListener(getViewEditInternalFrameListener());
     ((ICFInternetSwingMinorVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View);
   } else {
     frame = null;
   }
   if (frame == null) {
     return;
   }
   Container cont = getParent();
   while ((cont != null) && (!(cont instanceof JInternalFrame))) {
     cont = cont.getParent();
   }
   if (cont != null) {
     JInternalFrame myInternalFrame = (JInternalFrame) cont;
     myInternalFrame.getDesktopPane().add(frame);
     frame.setVisible(true);
     frame.show();
   }
 }
예제 #5
0
 /**
  * Allow to close the editor with a middle click on his tab.
  *
  * @param e The event.
  */
 @Override
 public void mouseClicked(MouseEvent e) {
   if (e.getButton() == MouseEvent.BUTTON2 && countEditors() > 0) {
     Point clic = e.getPoint();
     int idx = indexAtLocation(clic.x, clic.y);
     if (idx != -1) {
       // Middle click on a tab was clicked: close it.
       AbstractEditorPanel editor = (AbstractEditorPanel) getComponentAt(idx);
       removeEditor(editor, true);
     }
   }
 }
예제 #6
0
    public void mousePressed(MouseEvent e) {
      if (e == null || e.isConsumed()) {
        return;
      }

      if (!this.isEnabled()) {
        return;
      }

      if (e.getButton() == MouseEvent.BUTTON1) {
        this.handleSelect();
      }
    }
예제 #7
0
    public void mousePressed(MouseEvent event) {

      // Point selectedPoint = event.getPoint();
      int xPos = event.getX() - 20;
      int yPos = event.getY() - 50;
      int col = (int) (xPos / 50);
      int row = (int) (yPos / 50);
      // If left mouse is clicked, reveal
      // Get the coordinates of the click and use cascade on square

      if (event.getButton() == MouseEvent.BUTTON1) {

        if (xPos > 0 && xPos < 800 && yPos > 0 && yPos < 800) {

          if (!board[row][col].isReveal() && !board[row][col].isFlag()) cascade(board[row][col]);
        }
      }
      // If right mouse button is clicked, place flag
      else if (event.getButton() == MouseEvent.BUTTON3) {
        if (xPos > 0 && xPos < 800 && yPos > 0 && yPos < 800) {

          if (!board[row][col].isFlag && !board[row][col].isReveal() && currentFlags < maxFlags) {
            board[row][col].addFlag();
            currentFlags++;
            if (board[row][col].isBear()) {
              bearsCovered++;
              checkWin();
            }
          } else if (board[row][col].isFlag) {
            board[row][col].removeFlag();
            currentFlags--;
            if (board[row][col].isBear()) {
              bearsCovered--;
            }
          }
        }
      }
      repaint();
    }
예제 #8
0
    public void mouseClicked(MouseEvent e) {
      if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 1) {
        JButton source = (JButton) e.getSource();

        String value = source.getText();
        int day = Integer.parseInt(value);
        calendar.set(Calendar.DAY_OF_MONTH, day);
        Date selectDate = this.getSelectDate();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        MyDateChooseBtn.this.setText(simpleDateFormat.format(selectDate));
        Jtext.setText(simpleDateFormat.format(selectDate));

        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH) + 1;
        //        System.out.println(year + "骞�" + month + "鏈�" + day + "鏃�");
        f.dispose();
      }
    }
예제 #9
0
 public void mousePressed(MouseEvent e) {
   if (e.getButton() == e.BUTTON3) cbpm.show(e.getComponent(), e.getX(), e.getY());
   cbstarty = e.getY();
 }
예제 #10
0
파일: JImage.java 프로젝트: RussTedrake/lcm
 public void mouseClicked(MouseEvent e) {
   if (e.getButton() == 1 && e.getClickCount() == 2) {
     adjustZoom(1, null);
   }
 }