Examples of locationToIndex()


Examples of javax.swing.JList.locationToIndex()

    if (!SwingUtilities.isLeftMouseButton(e)) return;

    JList list = (JList) e.getSource();
    if ( !list.isEnabled() || (!(list.getModel() instanceof ICheckListModel<?>))) return;

    int index = list.locationToIndex(e.getPoint());
    if (index < 0) return;

    Rectangle bounds = list.getCellBounds(index, index);

    if ( bounds.contains(e.getPoint()) ) {
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

  public void mouseClicked(MouseEvent evt) {
    JList list = (JList) evt.getSource();

    if (evt.getClickCount() == 2) {
      int index = list.locationToIndex(evt.getPoint());

      if (index >= 0) {
        list.setSelectedIndex(index);
        String listName = list.getName();
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

            return;
        }

        ActionList actions = null;
        JList list = (JList) e.getSource();
        int row = list.locationToIndex(e.getPoint());
        if (row == -1 || !list.getCellBounds(row, row).contains(e.getPoint())) {
            if (list.getSelectedIndex() != -1) {
                list.clearSelection();
            }
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

                JTree tree = (JTree) component;
                int rowClickedOn = tree.getRowForLocation(evt.getX(), evt.getY());
                return rowClickedOn >= 0;
            } else if (component instanceof JList) {
                JList list = (JList) component;
                int rowClickedOn = list.locationToIndex(evt.getPoint());
                return rowClickedOn >= 0;
            }
            return true;
        }
    }
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

        selectList.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    int index = selectList.locationToIndex(e.getPoint());
                    User u = (User) selectList.getModel().getElementAt(index);
                    UserSelector.this.finialize(u.getName());
                }
            }
        });
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

    });

    list.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent e) {
        int index = list.locationToIndex(e.getPoint());

        if (index < 0 || index >= list.getModel().getSize()) {
          return;
        }
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    list.setSize(200, 180);
    list.addMouseListener(new MouseAdapter() {
      public void mouseClicked(MouseEvent e) {
        if (e.getClickCount() == 2) {
          int index = list.locationToIndex(e.getPoint());
          if (index >= 0)
            connect(crazyflie, (String) list.getModel()
                .getElementAt(index));
        }
      }
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

  }// GEN-LAST:event_aboutMenuItemActionPerformed

  private void AnalysisMethodPanel_AnalysisMethodsListBoxMouseMoved(
      java.awt.event.MouseEvent evt) {// GEN-FIRST:event_AnalysisMethodPanel_AnalysisMethodsListBoxMouseMoved
    JList theList = (JList) evt.getSource();
    int index = theList.locationToIndex(evt.getPoint());
    if (index > -1) {
      String text = AnalysisDriverMasterList.get(index).tooltipText();
      theList.setToolTipText(text);
    }
  }// GEN-LAST:event_AnalysisMethodPanel_AnalysisMethodsListBoxMouseMoved
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

  }

  private void AnalysisMethodPanel_SelectedAnalysisMethodsListBoxMouseMoved(
      java.awt.event.MouseEvent evt) {// GEN-FIRST:event_AnalysisMethodPanel_SelectedAnalysisMethodsListBoxMouseMoved
    JList theList = (JList) evt.getSource();
    int index = theList.locationToIndex(evt.getPoint());
    if (index > -1) {
      String text = SelectedAnalysisDriverList.get(index).tooltipText();
      theList.setToolTipText(text);
    }
  }// GEN-LAST:event_AnalysisMethodPanel_SelectedAnalysisMethodsListBoxMouseMoved
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

  }// GEN-LAST:event_AnalysisMethodPanel_SelectedAnalysisMethodsListBoxMouseClicked

  private void EventCullingPanel_EventCullingListBoxMouseMoved(
      java.awt.event.MouseEvent evt) {// GEN-FIRST:event_EventCullingPanel_EventCullingListBoxMouseMoved
    JList theList = (JList) evt.getSource();
    int index = theList.locationToIndex(evt.getPoint());
    if (index > -1) {
      String text = EventCullersMasterList.get(index).tooltipText();
      theList.setToolTipText(text);
    }
  }// GEN-LAST:event_EventCullingPanel_EventCullingListBoxMouseMoved
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.