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();
   }
 }
    public void mouseClicked(MouseEvent ev) {
      Window w = (Window) ev.getSource();
      Frame f = null;

      if (w instanceof Frame) {
        f = (Frame) w;
      } else {
        return;
      }

      Point convertedPoint = SwingUtilities.convertPoint(w, ev.getPoint(), getTitlePane());

      int state = f.getExtendedState();
      if (getTitlePane() != null && getTitlePane().contains(convertedPoint)) {
        if ((ev.getClickCount() % 2) == 0 && ((ev.getModifiers() & InputEvent.BUTTON1_MASK) != 0)) {
          if (f.isResizable()) {
            if ((state & Frame.MAXIMIZED_BOTH) != 0) {
              f.setExtendedState(state & ~Frame.MAXIMIZED_BOTH);
            } else {
              f.setExtendedState(state | Frame.MAXIMIZED_BOTH);
            }
            return;
          }
        }
      }
    }
 void jListOnlineUsers_mouseClicked(MouseEvent e) {
   if (e.getClickCount() == 2) {
     jTextFieldTargetUser.setText(((HostItem) jListOnlineUsers.getSelectedValue()).name);
     Flasher.instance().flashBackground(jTextFieldTargetUser, Color.yellow, 2);
     jTextFieldSendMessages.requestFocus();
   }
 }
 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) {
   }
 }
Example #5
0
  @Override
  public final void mousePressed(final MouseEvent e) {
    if (!isEnabled() || !isFocusable()) return;

    requestFocusInWindow();
    caret(true);

    if (SwingUtilities.isMiddleMouseButton(e)) copy();

    final boolean shift = e.isShiftDown();
    final boolean selected = editor.selected();
    if (SwingUtilities.isLeftMouseButton(e)) {
      final int c = e.getClickCount();
      if (c == 1) {
        // selection mode
        if (shift) editor.startSelection(true);
        select(e.getPoint(), !shift);
      } else if (c == 2) {
        editor.selectWord();
      } else {
        editor.selectLine();
      }
    } else if (!selected) {
      select(e.getPoint(), true);
    }
  }
Example #6
0
  public void mouseClicked(MouseEvent e) {
    int x;
    int y;

    e.consume();

    if (mouseEventsEnabled) {

      x = Math.round(e.getX() / scale);
      y = Math.round(e.getY() / scale);

      // allow for the canvas margin
      y -= margin;

      // System.out.println("Mouse Click: (" + x + ", " + y + ")");

      if (e.getClickCount() < 2) {
        if (nativeSelectItem(x, y)) {
          parentFTAFrame.updateFrame();
        }
      } else {
        if (nativeSelectItem(x, y)) {
          parentFTAFrame.updateFrame();
        }

        editSelected();
        parentFTAFrame.updateFrame();
      }

      if (focusEventsEnabled) {
        // tell the main Canvas to point to this coordinate
        parentFTAFrame.setCanvasFocus(x, y);
      }
    }
  }
Example #7
0
  @Override
  public final void mousePressed(final MouseEvent e) {
    if (!isEnabled() || !isFocusable()) return;

    requestFocusInWindow();
    cursor(true);

    if (SwingUtilities.isMiddleMouseButton(e)) copy();

    final boolean marking = e.isShiftDown();
    final boolean nomark = !text.marked();
    if (SwingUtilities.isLeftMouseButton(e)) {
      final int c = e.getClickCount();
      if (c == 1) {
        // selection mode
        if (marking && nomark) text.startMark();
        rend.select(scroll.pos(), e.getPoint(), marking);
      } else if (c == 2) {
        text.selectWord();
      } else {
        text.selectLine();
      }
    } else if (nomark) {
      rend.select(scroll.pos(), e.getPoint(), false);
    }
  }
Example #8
0
 @Override
 public void mouseClicked(MouseEvent e) {
   if (e.getClickCount() == 2) {
     doubleClicked((JComponent) e.getSource());
   }
   super.mouseClicked(e);
 }
Example #9
0
    public void mousePressed(MouseEvent evt) {
      requestFocus();

      // Focus events not fired sometimes?
      setCaretVisible(true);
      focusedComponent = JEditTextArea.this;

      if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) != 0 && popup != null) {
        popup.show(painter, evt.getX(), evt.getY());
        return;
      }

      int line = yToLine(evt.getY());
      int offset = xToOffset(line, evt.getX());
      int dot = getLineStartOffset(line) + offset;

      switch (evt.getClickCount()) {
        case 1:
          doSingleClick(evt, line, offset, dot);
          break;
        case 2:
          // It uses the bracket matching stuff, so
          // it can throw a BLE
          try {
            doDoubleClick(evt, line, offset, dot);
          } catch (BadLocationException bl) {
            bl.printStackTrace();
          }
          break;
        case 3:
          doTripleClick(evt, line, offset, dot);
          break;
      }
    }
Example #10
0
  public void mouseClicked(MouseEvent e) {
    // Double Click
    if (e.getClickCount() == 2) {
      System.out.println("Double CLIKC!!\n\n\n");
      if (treeMode == SUBROLE_ID) {
        if (editor.getMode() == PBModePanel.SUB_ROLE_MODE) {
          editor.getSubRolePanel().loadSelected();
        } else if (editor.getMode() == PBModePanel.TEST_MODE) {
          editor.getTestPanel().selectSubRole();
        }
      }

      // Single Click
    } else if (e.getClickCount() == 1) {
      return;
    }
  }
    public void mousePressed(MouseEvent e) {
      if (e.getClickCount() == 2) {
        JList list = (JList) e.getSource();
        int index = list.locationToIndex(e.getPoint());

        optionPane.setInputValue(list.getModel().getElementAt(index));
      }
    }
    public void mouseClicked(MouseEvent e) {
      int selRow = tree.getRowForLocation(e.getX(), e.getY());
      TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());

      if (e.getClickCount() == 2) {
        myDoubleClick(selRow, selPath);
      }
    }
Example #13
0
    public void mouseClicked(MouseEvent e) {
      if (e.getButton() == e.BUTTON1) {
        showButton.setEnabled(list.getSelectedIndex() != -1 ? true : false);

        if (e.getClickCount() == 2) {
          int index = list.locationToIndex(e.getPoint());
          sp.doVisualComparison(index, scores[index]);
        }
      }
    }
 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();
   }
 }
  protected void handleMouseEvent(MouseEvent e, boolean forceUpdate) {
    KeyType selected = getCellKeyForPoint(e.getPoint());
    if (forceUpdate || !Comparing.equal(myKey, selected)) {
      handleSelectionChange(selected, true);
    }

    // Temporary workaround
    if (e.getClickCount() == 2) {
      hideHint();
    }
  }
Example #16
0
    public void mouseClicked(MouseEvent e) {
      details = String.format("You clicked %d", e.getClickCount());

      // isMetaDown() = what kind mouse is used now? one button or two
      // button or more?
      if (e.isMetaDown()) details += "with right mouse button";
      else if (e.isAltDown()) details += "with center mouse button";
      else details += "with left mouse";

      statusBar.setText(details);
    }
 @Override
 public void mouseClicked(MouseEvent e) {
   if (e.getClickCount() == 2) {
     JTable table = (JTable) e.getSource();
     ListTableModel<PatientModel> tableModel = getTableModel();
     PatientModel value = (PatientModel) tableModel.getObject(table.getSelectedRow());
     if (value != null) {
       openKarte();
     }
   }
 }
Example #18
0
 /**
  * If a genome is single clicked, we just store the selection. When a genome is double clicked, we
  * treat that as the user wanting to load the genome.
  *
  * @param e
  */
 private void genomeListMouseClicked(MouseEvent e) {
   switch (e.getClickCount()) {
     case 1:
       List<GenomeListItem> selValues = genomeList.getSelectedValuesList();
       downloadSequenceCB.setEnabled(selValues != null && selValues.size() == 1);
       break;
     case 2:
       okButtonActionPerformed(null);
       break;
   }
 }
Example #19
0
 public void mouseClicked(MouseEvent e) {
   if (e.getClickCount() != 1) return;
   // String s = html.getToolTipText();
   if (word == null) return;
   setMessage(word);
   String s = text.getText();
   String h =
       s.substring(0, selB)
           + " <FONT color=blue> "
           + s.substring(selB, selE)
           + " </FONT> "
           + s.substring(selE);
   setHTML(h);
 }
    @Override
    public void mouseClicked(MouseEvent e) {
      Point p = e.getPoint();
      CPArtwork artwork = controller.getArtwork();
      int layerIndex = getLayerNb(p);

      if (e.getClickCount() == 2
          && layerIndex >= 0
          && layerIndex < artwork.getLayersNb()
          && p.x > eyeW) {
        showRenameControl(layerIndex);
      } else if (renameField.isVisible()) {
        renameField.renameAndHide();
      }
    }
Example #21
0
  /** {@inheritDoc} */
  @Override
  public void mouseClicked(final MouseEvent aEvent) {
    // Ensure the focus is moved to the main signal diagram component...
    getSignalDiagram().requestFocusInWindow();

    if (getModel().isCursorMode() && (aEvent.getClickCount() == 2)) {
      final MouseEvent event = convertEvent(aEvent);

      final Cursor hoveredCursor = findCursor(event.getPoint());
      if (hoveredCursor != null) {
        editCursorProperties(hoveredCursor);
        // Consume the event to stop further processing...
        aEvent.consume();
      }
    }
  }
 void this_mouseClicked(MouseEvent e) {
   if (e.getClickCount() == 1) {
     int row = this.getSelectedRow();
     ItemTableDwnld item = (ItemTableDwnld) getMessageList().get(row);
     Container parent = (Container) this;
     while ((parent != null) && !(parent instanceof FrmMain)) parent = parent.getParent();
     if (parent != null) {
       ((FrmMain) parent).setTxtName(item.getTextName());
       ((FrmMain) parent).setTxtTextStart(item.getTextStart());
       ((FrmMain) parent).setTxtTextEnd(item.getTextEnd());
       ((FrmMain) parent).setTxtPath(item.getTextPath());
       ((FrmMain) parent).setCboxType(item.getTextType());
       ((FrmMain) parent).enableBtnUpDown(row);
     }
   }
 }
Example #23
0
  public void mouseClicked(MouseEvent e) {
    if (e.getClickCount() >= 2) {
      int x = e.getX();
      int y = e.getY();
      if (x >= posX && x < posX + Constant.BATTLEFIELD_WIDTH) {
        if (y >= posY) {
          if (y < posY + Constant.BATTLEFIELD_HEIGHT) {

          } else if (y < posY + Constant.BATTLEFIELD_HEIGHT + Constant.CARDPANEL_HEIGHT) {
            card_panel.doDoubleClick(x - posX, y - (posY + Constant.BATTLEFIELD_HEIGHT));
            return;
          }
        }
      }
    }
  }
Example #24
0
    @Override
    public void mouseReleased(MouseEvent evt) {
      if (evt.getClickCount() % 2 != 0 && !GUIUtilities.isMiddleButton(evt.getModifiers())) return;

      int row = parentDirectories.locationToIndex(evt.getPoint());
      if (row != -1) {
        Object obj = parentDirectories.getModel().getElementAt(row);
        if (obj instanceof VFSFile) {
          VFSFile dirEntry = (VFSFile) obj;
          if (!GUIUtilities.isPopupTrigger(evt)) {
            browser.setDirectory(dirEntry.getPath());
            if (browser.getMode() == VFSBrowser.BROWSER) focusOnFileView();
          }
        }
      }
    }
 void forwardEventToParent(MouseEvent e) {
   getParent()
       .dispatchEvent(
           new MouseEvent(
               getParent(),
               e.getID(),
               e.getWhen(),
               e.getModifiers(),
               e.getX(),
               e.getY(),
               e.getXOnScreen(),
               e.getYOnScreen(),
               e.getClickCount(),
               e.isPopupTrigger(),
               MouseEvent.NOBUTTON));
 }
 private void dateTableMouseClicked(MouseEvent e) {
   if (e.getClickCount() == 2) {
     try {
       DomainEditor domainEditor =
           new DomainEditor(
               ArchDescriptionDates.class,
               editorField.getParentEditor(),
               "Dates",
               new ArchDescriptionDatesFields());
       domainEditor.setCallingTable(dateTable);
       domainEditor.setNavigationButtonListeners(domainEditor);
       editRelatedRecord(dateTable, ArchDescriptionDates.class, true, domainEditor);
     } catch (UnsupportedTableModelException e1) {
       new ErrorDialog("Error creating editor for Dates", e1).showDialog();
     }
   }
 }
Example #27
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();
      }
    }
Example #28
0
  /**
   * Propagates certain mouse events, such as MOUSE_CLICKED, MOUSE_RELEASED etc. to the deepest
   * component.
   *
   * @param e The MouseEvent to be propagated.
   */
  protected void propagateMouseListenerEvent(MouseEvent e) {
    if (POPUP_IS_MODAL == false) {

      Component deepestComponent = getDeepestComponent(e.getPoint());

      if (deepestComponent != null) {
        MouseListener[] mouseListeners = deepestComponent.getMouseListeners();

        int eventID;

        // Get the event type
        eventID = e.getID();

        Point pt = e.getPoint();

        Point convertedPt = SwingUtilities.convertPoint(glassPane, e.getPoint(), deepestComponent);

        MouseEvent evt =
            new MouseEvent(
                deepestComponent,
                e.getID(),
                System.currentTimeMillis(),
                e.getModifiers(),
                convertedPt.x,
                convertedPt.y,
                e.getClickCount(),
                e.isPopupTrigger(),
                e.getButton());

        // Distibute the event to the component's listeners.
        for (int i = 0; i < mouseListeners.length; i++) {

          // Forward the appropriate mouse event
          if (eventID == MouseEvent.MOUSE_PRESSED) {
            mouseListeners[i].mousePressed(evt);
          } else if (eventID == MouseEvent.MOUSE_RELEASED) {
            mouseListeners[i].mouseReleased(evt);
          } else if (eventID == MouseEvent.MOUSE_CLICKED) {
            mouseListeners[i].mouseClicked(evt);
          }
        }
      }
    }
  }
 private void dispatchEvent(MouseEvent me) {
   if (rect != null && rect.contains(me.getX(), me.getY())) {
     Point pt = me.getPoint();
     pt.translate(-offset, 0);
     comp.setBounds(rect);
     comp.dispatchEvent(
         new MouseEvent(
             comp,
             me.getID(),
             me.getWhen(),
             me.getModifiers(),
             pt.x,
             pt.y,
             me.getClickCount(),
             me.isPopupTrigger(),
             me.getButton()));
     if (!comp.isValid()) container.repaint();
   }
 }
  private void instancesTableMouseClicked(MouseEvent e) {
    if (e.getClickCount() == 2) {
      // get the current instance record to edit
      DomainObject instanceRecord = null;
      int selectedRow = getInstancesTable().getSelectedRow();
      if (selectedRow != -1) {
        instanceRecord = getInstancesTable().getSortedList().get(selectedRow);
      }

      if (usePluginDomainEditor(false, instanceRecord, getInstancesTable())) {
        return;
      }

      if (handleTableMouseClick(e, getInstancesTable(), ArchDescriptionInstances.class)
          == JOptionPane.OK_OPTION) {
        findLocationForInstance(currentInstance);
      }
    }
  }