Examples of locationToIndex()


Examples of javax.swing.JList.locationToIndex()

        private void showContextMenu(MouseEvent e) {
            if (e.isPopupTrigger()) {
                // Select item under context-click.
                if (e.getSource() instanceof JList) {
                    JList jList = (JList) e.getSource();
                    int locIndex = jList.locationToIndex(e.getPoint());
                    if (locIndex >= 0) {
                        jList.setSelectedIndex(locIndex);
                    }
                } else if (e.getSource() instanceof JTable) {
                    JTable jTable = (JTable) e.getSource();
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

        private void showContextMenu(MouseEvent e) {
            if (e.isPopupTrigger()) {
                // Select item under context-click.
                if (e.getSource() instanceof JList) {
                    JList jList = (JList) e.getSource();
                    int locIndex = jList.locationToIndex(e.getPoint());
                    if (locIndex >= 0) {
                        jList.setSelectedIndex(locIndex);
                    }
                } else if (e.getSource() instanceof JTable) {
                    JTable jTable = (JTable) e.getSource();
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

        private void showContextMenu(MouseEvent e) {
            if (e.isPopupTrigger()) {
                // Select item under context-click.
                if (e.getSource() instanceof JList) {
                    JList jList = (JList) e.getSource();
                    int locIndex = jList.locationToIndex(e.getPoint());
                    if (locIndex >= 0) {
                        jList.setSelectedIndex(locIndex);
                    }
                } else if (e.getSource() instanceof JTable) {
                    JTable jTable = (JTable) e.getSource();
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

        pane.add(new JScrollPane(examples), c);

        MouseListener mouseListener = new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    int index = examples.locationToIndex(e.getPoint());
                    String example = ExampleModels.EXAMPLE_MODELS[index];
                    example = example.split(":")[0];
                    mSplash.setVisible(false);
                    loadModel(BUILTIN, example);
                    boolean[] coverage = { true, true, false, false, false };
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

        private void showContextMenu(MouseEvent e) {
            if (e.isPopupTrigger()) {
                // Select item under context-click.
                if (e.getSource() instanceof JList) {
                    JList jList = (JList) e.getSource();
                    int locIndex = jList.locationToIndex(e.getPoint());
                    if (locIndex >= 0) {
                        jList.setSelectedIndex(locIndex);
                    }
                } else if (e.getSource() instanceof JTable) {
                    JTable jTable = (JTable) e.getSource();
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

public class ListRolloverProducer extends RolloverProducer {

    @Override
    protected void updateRolloverPoint(JComponent component, Point mousePoint) {
        JList list = (JList) component;
        int row = list.locationToIndex(mousePoint);
        if (row >= 0) {
            Rectangle cellBounds = list.getCellBounds(row, row);
            if (!cellBounds.contains(mousePoint)) {
                row = -1;
            }
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

    addMouseListener(new MouseAdapter() {
      public void mouseClicked(MouseEvent event) {
        JList list = (JList) event.getSource();

        // Get index of item clicked
        int index = list.locationToIndex(event.getPoint());

        if (index >= 0) {
          if (event.getClickCount() == 2) {   
            CheckListItem item = (CheckListItem) model.getElementAt(index);
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

        private void showContextMenu(MouseEvent e) {
            if (e.isPopupTrigger()) {
                // Select item under context-click.
                if (e.getSource() instanceof JList) {
                    JList jList = (JList) e.getSource();
                    int locIndex = jList.locationToIndex(e.getPoint());
                    if (locIndex >= 0) {
                        jList.setSelectedIndex(locIndex);
                    }
                } else if (e.getSource() instanceof JTable) {
                    JTable jTable = (JTable) e.getSource();
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

        private void showContextMenu(MouseEvent e) {
            if (e.isPopupTrigger()) {
                // Select item under context-click.
                if (e.getSource() instanceof JList) {
                    JList jList = (JList) e.getSource();
                    int locIndex = jList.locationToIndex(e.getPoint());
                    if (locIndex >= 0) {
                        jList.setSelectedIndex(locIndex);
                    }
                } else if (e.getSource() instanceof JTable) {
                    JTable jTable = (JTable) e.getSource();
View Full Code Here

Examples of javax.swing.JList.locationToIndex()

            boolean doubleClicked = super.mouseReallyClicked(e);
           
            // If it is the popup trigger, show the popup.
            if (e.isPopupTrigger()) {
                JList matchingGemsList = getIntellicutList();
                int index = matchingGemsList.locationToIndex(e.getPoint());
                if (index >= 0) {
                    matchingGemsList.setSelectedIndex(index);
                    JPopupMenu popupMenu = adapter.getIntellicutPopupMenu();
                    if (popupMenu != null) {
                        popupMenu.show(e.getComponent(), e.getX(), e.getY());
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.