Examples of tabForCoordinate()


Examples of javax.swing.plaf.TabbedPaneUI.tabForCoordinate()

    private void handlePopup(final MouseEvent e)
    {
      final JTabbedPane reportEditorPane = getReportEditorPane();
      final TabbedPaneUI ui = reportEditorPane.getUI();
      final int tabIndex = ui.tabForCoordinate(reportEditorPane, e.getX(), e.getY());
      final JPopupMenu popupMenu = new JPopupMenu();

      final CloseReportAction closeThisAction = new CloseReportAction(tabIndex);
      closeThisAction.setReportDesignerContext(getContext());
      final CloseChildReportsAction closeChildsAction = new CloseChildReportsAction(tabIndex);
View Full Code Here

Examples of javax.swing.plaf.TabbedPaneUI.tabForCoordinate()

    public Rectangle getBounds(Component c) {
        JTabbedPane tabs = (JTabbedPane)c;
        TabbedPaneUI ui = tabs.getUI();
        Point p = getPoint(tabs);
        int idx = ui.tabForCoordinate(tabs, p.x, p.y);
        return idx == -1 ? null : ui.getTabBounds(tabs, idx);
    }

    // FIXME if they correspond to the same tab, are they equal?
    public boolean equals(Object o) {
View Full Code Here

Examples of javax.swing.plaf.TabbedPaneUI.tabForCoordinate()

     * cell, or coordinate.
     */
    public ComponentLocation getLocation(Component c, Point p) {
        JTabbedPane tabs = (JTabbedPane)c;
        TabbedPaneUI ui = tabs.getUI();
        int index = ui.tabForCoordinate(tabs, p.x, p.y);
        if (index != -1) {
            String name = tabs.getTitleAt(index);
            return new JTabbedPaneLocation(name);
        }
        return new JTabbedPaneLocation(p);
View Full Code Here

Examples of javax.swing.plaf.TabbedPaneUI.tabForCoordinate()

    public boolean accept(AWTEvent event) {
        if (isClick(event)) {
            MouseEvent me = (MouseEvent)event;
            JTabbedPane tp = tabbedPane = (JTabbedPane)me.getComponent();
            TabbedPaneUI ui = tp.getUI();
            int index = ui.tabForCoordinate(tp, me.getX(), me.getY());
            if (index != -1) {
                setStatus("Selecting tab '" + tp.getTitleAt(index));
                init(SE_CLICK);
                return true;
            }
View Full Code Here

Examples of javax.swing.plaf.TabbedPaneUI.tabForCoordinate()

    protected Step createClick(Component target, int x, int y,
                               int mods, int count) {
        ComponentReference cr = getResolver().addComponent(target);
        JTabbedPane tp = (JTabbedPane)target;
        TabbedPaneUI ui = tp.getUI();
        int index = ui.tabForCoordinate(tp, x, y);
        if (index != -1) {
            // NOTE only tab selections are allowed for when clicking on tabs;
            // no multi-clicks or other buttons are saved, although nothing
            // prevents manual generation of such actions.
            return new Action(getResolver(),
View Full Code Here

Examples of javax.swing.plaf.TabbedPaneUI.tabForCoordinate()

    private void handlePopup(final MouseEvent e)
    {
      final JTabbedPane reportEditorPane = getReportEditorPane();
      final TabbedPaneUI ui = reportEditorPane.getUI();
      final int tabIndex = ui.tabForCoordinate(reportEditorPane, e.getX(), e.getY());
      final JPopupMenu popupMenu = new JPopupMenu();

      final CloseReportAction closeThisAction = new CloseReportAction(tabIndex);
      closeThisAction.setReportDesignerContext(getContext());
      final CloseChildReportsAction closeChildsAction = new CloseChildReportsAction(tabIndex);
View Full Code Here

Examples of javax.swing.plaf.TabbedPaneUI.tabForCoordinate()

        public void mouseDragged(MouseEvent e) {
            // Gets the tab index based on the mouse position
            if (!isDragging) {
                TabbedPane pane = TabbedPane.this;
                TabbedPaneUI paneUI = pane.getUI();
                dragIndex = paneUI.tabForCoordinate(pane, e.getX(), e.getY());
                if (dragIndex >= 0) {
                    Rectangle bounds = paneUI.getTabBounds(pane, dragIndex);
                    // Paint the tabbed pane to a buffer
                    Image totalImage = new BufferedImage(getWidth(), getHeight(),
                            BufferedImage.TYPE_INT_ARGB);
View Full Code Here

Examples of javax.swing.plaf.TabbedPaneUI.tabForCoordinate()

            System.out.println("close plz!");
            if ((e.getModifiers() & MouseEvent.BUTTON2_MASK) != 0) {
                TabbedPane pane = TabbedPane.this;
                TabbedPaneUI paneUI = pane.getUI();
                // close tab
                int index = paneUI.tabForCoordinate(pane, e.getX(), e.getY());
                if (index < 0) {
                    return;
                }
                RoomPane room = (RoomPane) pane.getComponentAt(index);
                if (!room.isLobby()) {
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.