Java Code Examples for sun.swing.SwingUtilities2#pointOutsidePrefSize()

The following examples show how to use sun.swing.SwingUtilities2#pointOutsidePrefSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicTableUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 2
Source File: BasicTableUI.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 3
Source File: BasicTableUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 4
Source File: BasicTableUI.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 5
Source File: BasicTableUI.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 6
Source File: BasicTableUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 7
Source File: BasicTableUI.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 8
Source File: BasicTableUI.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 9
Source File: BasicTableUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 10
Source File: BasicTableUI.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 11
Source File: BasicTableUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 12
Source File: BasicTableUI.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 13
Source File: BasicTableUI.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 14
Source File: BasicTableUI.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 15
Source File: BasicTableUI.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 16
Source File: BasicTableUI.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 17
Source File: BasicTableUI.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private boolean pointOutsidePrefSize(int row, int column, Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 18
Source File: TableUIBridge.java    From darklaf with MIT License 5 votes vote down vote up
/**
 * Point outside pref size boolean.
 *
 * @param  row    the row
 * @param  column the column
 * @param  p      the p
 * @return        the boolean
 */
/*
 * Returns true if the given point is outside the preferredSize of the
 * item at the given row of the table. (Column must be 0).
 * Returns false if the DarkTableUI.KEY_IS_FILE_LIST client property is not set.
 */
protected boolean pointOutsidePrefSize(final int row, final int column, final Point p) {
    if (!isFileList) {
        return false;
    }

    return SwingUtilities2.pointOutsidePrefSize(table, row, column, p);
}
 
Example 19
Source File: DarkFilePane.java    From darklaf with MIT License 4 votes vote down vote up
@Override
public void mouseClicked(MouseEvent evt) {
    JComponent source = (JComponent) evt.getSource();

    int index;
    if (source instanceof JList) {
        index = list.locationToIndex(evt.getPoint());
    } else if (source instanceof JTable) {
        JTable table = (JTable) source;
        Point p = evt.getPoint();
        index = table.rowAtPoint(p);

        boolean pointOutsidePrefSize = SwingUtilities2.pointOutsidePrefSize(table, index,
                                                                            table.columnAtPoint(p), p);

        if (pointOutsidePrefSize && !fullRowSelection) {
            return;
        }

        // Translate point from table to list
        if (index >= 0 && list != null && listSelectionModel.isSelectedIndex(index)) {

            // Make a new event with the list as source, placing the
            // click in the corresponding list cell.
            Rectangle r = list.getCellBounds(index, index);
            MouseEvent newEvent = new MouseEvent(list, evt.getID(),
                                                 evt.getWhen(), evt.getModifiersEx(),
                                                 r.x + 1, r.y + r.height / 2,
                                                 evt.getXOnScreen(),
                                                 evt.getYOnScreen(),
                                                 evt.getClickCount(), evt.isPopupTrigger(),
                                                 evt.getButton());
            SwingUtilities.convertMouseEvent(list, newEvent, list);
            evt = newEvent;
        }
    } else {
        return;
    }

    if (index >= 0 && SwingUtilities.isLeftMouseButton(evt)) {
        JFileChooser fc = getFileChooser();

        // For single click, we handle editing file name
        if (evt.getClickCount() == 1 && source instanceof JList) {
            if ((!fc.isMultiSelectionEnabled() || fc.getSelectedFiles().length <= 1)
                && listSelectionModel.isSelectedIndex(index)
                && getEditIndex() == index && editFile == null
                && DarkUIUtil.isOverText(evt, index, list)) {
                editFileName(index);
            } else {
                setEditIndex(index);
            }
        } else if (evt.getClickCount() == 2) {
            // on double click (open or drill down one directory) be
            // sure to clear the edit index
            resetEditIndex();
        }
    }

    // Forward event to Basic
    if (getDoubleClickListener() != null) {
        list.putClientProperty("List.isFileList", false);
        getDoubleClickListener().mouseClicked(evt);
        list.putClientProperty("List.isFileList", true);
    }
}