类javax.swing.plaf.TabbedPaneUI源码实例Demo

下面列出了怎么用javax.swing.plaf.TabbedPaneUI的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: keystore-explorer   文件: KseFrame.java
private void maybeShowKeyStoreTabPopup(MouseEvent evt) {
	if (evt.isPopupTrigger()) {
		int tabCount = jkstpKeyStores.getTabCount();
		TabbedPaneUI tpu = jkstpKeyStores.getUI();

		for (int i = 0; i < tabCount; i++) {
			Rectangle rect = tpu.getTabBounds(jkstpKeyStores, i);

			int x = evt.getX();
			int y = evt.getY();

			if (x < rect.x || x > rect.x + rect.width || y < rect.y || y > rect.y + rect.height) {
				continue;
			}

			jpmKeyStoreTab.show(evt.getComponent(), evt.getX(), evt.getY());
			break;
		}
	}
}
 
源代码2 项目: pentaho-reporting   文件: ReportDesignerFrame.java
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 );
  closeChildsAction.setReportDesignerContext( getContext() );
  final CloseOtherReportsAction closeOthersAction = new CloseOtherReportsAction( tabIndex );
  closeOthersAction.setReportDesignerContext( getContext() );
  final CloseAllReportsAction closeAllAction = new CloseAllReportsAction();
  closeAllAction.setReportDesignerContext( getContext() );
  final CloseUnmodifiedReportsAction closeUnmodifiedReportsAction = new CloseUnmodifiedReportsAction();
  closeUnmodifiedReportsAction.setReportDesignerContext( getContext() );

  popupMenu.add( new JMenuItem( closeThisAction ) );
  popupMenu.addSeparator();
  popupMenu.add( new JMenuItem( closeChildsAction ) );
  popupMenu.add( new JMenuItem( closeUnmodifiedReportsAction ) );
  popupMenu.add( new JMenuItem( closeOthersAction ) );
  popupMenu.add( new JMenuItem( closeAllAction ) );
  popupMenu.show( reportEditorPane, e.getX(), e.getY() );
}
 
源代码3 项目: weblaf   文件: WTabbedPaneInputListener.java
/**
 * Moves {@link JTabbedPane} scrollable tabs view according to scroll amount.
 *
 * @param tabbedPane   {@link JTabbedPane}
 * @param scrollAmount either positive or negative blocks scroll amount
 */
protected void scroll ( final T tabbedPane, final int scrollAmount )
{
    final TabbedPaneUI ui = tabbedPane.getUI ();
    if ( ui instanceof WTabbedPaneUI )
    {
        final TabContainer tabContainer = ( ( WTabbedPaneUI ) ui ).getTabContainer ();
        if ( tabContainer != null )
        {
            final boolean horizontal = tabbedPane.getTabPlacement () == JTabbedPane.TOP ||
                    tabbedPane.getTabPlacement () == JTabbedPane.BOTTOM;
            final Rectangle vr = tabContainer.getVisibleRect ();
            final Rectangle bounds = new Rectangle ( tabContainer.getSize () );
            if ( horizontal )
            {
                vr.x += scrollAmount * vr.width;
            }
            else
            {
                vr.y += scrollAmount * vr.height;
            }
            tabContainer.scrollRectToVisible ( bounds.intersection ( vr ) );
        }
    }
}
 
源代码4 项目: darklaf   文件: TabbedPaneTransferHandler.java
private DarkTabbedPaneUI supportsIndicator(final Component c) {
    if (c instanceof JTabbedPane) {
        TabbedPaneUI ui = ((JTabbedPane) c).getUI();
        if (ui instanceof DarkTabbedPaneUI) {
            return ((DarkTabbedPaneUI) ui);
        }
    }
    return null;
}
 
/**
 * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int tabForCoordinate(JTabbedPane a, int b, int c) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
    }
    return returnValue;
}
 
/**
 * Invokes the <code>getTabBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getTabBounds(JTabbedPane a, int b) {
    Rectangle returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabBounds(a,b);
    }
    return returnValue;
}
 
/**
 * Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getTabRunCount(JTabbedPane a) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
    }
    return returnValue;
}
 
源代码8 项目: dragonwell8_jdk   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int tabForCoordinate(JTabbedPane a, int b, int c) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
    }
    return returnValue;
}
 
源代码9 项目: dragonwell8_jdk   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getTabBounds(JTabbedPane a, int b) {
    Rectangle returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabBounds(a,b);
    }
    return returnValue;
}
 
源代码10 项目: dragonwell8_jdk   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getTabRunCount(JTabbedPane a) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
    }
    return returnValue;
}
 
源代码11 项目: TencentKona-8   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int tabForCoordinate(JTabbedPane a, int b, int c) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
    }
    return returnValue;
}
 
源代码12 项目: TencentKona-8   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getTabBounds(JTabbedPane a, int b) {
    Rectangle returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabBounds(a,b);
    }
    return returnValue;
}
 
源代码13 项目: TencentKona-8   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getTabRunCount(JTabbedPane a) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
    }
    return returnValue;
}
 
源代码14 项目: jdk8u60   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int tabForCoordinate(JTabbedPane a, int b, int c) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
    }
    return returnValue;
}
 
源代码15 项目: jdk8u60   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getTabBounds(JTabbedPane a, int b) {
    Rectangle returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabBounds(a,b);
    }
    return returnValue;
}
 
源代码16 项目: jdk8u60   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getTabRunCount(JTabbedPane a) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
    }
    return returnValue;
}
 
源代码17 项目: JDKSourceCode1.8   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int tabForCoordinate(JTabbedPane a, int b, int c) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
    }
    return returnValue;
}
 
源代码18 项目: JDKSourceCode1.8   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getTabBounds(JTabbedPane a, int b) {
    Rectangle returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabBounds(a,b);
    }
    return returnValue;
}
 
源代码19 项目: JDKSourceCode1.8   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getTabRunCount(JTabbedPane a) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
    }
    return returnValue;
}
 
源代码20 项目: openjdk-jdk8u   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int tabForCoordinate(JTabbedPane a, int b, int c) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
    }
    return returnValue;
}
 
源代码21 项目: openjdk-jdk8u   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getTabBounds(JTabbedPane a, int b) {
    Rectangle returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabBounds(a,b);
    }
    return returnValue;
}
 
源代码22 项目: openjdk-jdk8u   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getTabRunCount(JTabbedPane a) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
    }
    return returnValue;
}
 
源代码23 项目: netbeans   文件: MergeDialogComponent.java
/** Called when the seqeunce of mouse events should lead to actual
 *  showing of the popup menu. */
@Override
protected void showPopup(java.awt.event.MouseEvent mouseEvent) {
    TabbedPaneUI tabUI = mergeTabbedPane.getUI();
    int clickTab = tabUI.tabForCoordinate(mergeTabbedPane, mouseEvent.getX(), mouseEvent.getY());
    MergePanel panel = getSelectedMergePanel();
    if (panel == null) {
        return;
    }
    if (clickTab != -1) {
        //Click is on valid tab, not on empty area in tab
        showPopupMenu(createPopupMenu(panel), mouseEvent.getPoint(), mergeTabbedPane);
    }
}
 
源代码24 项目: openjdk-jdk8u-backup   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int tabForCoordinate(JTabbedPane a, int b, int c) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
    }
    return returnValue;
}
 
源代码25 项目: openjdk-jdk8u-backup   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getTabBounds(JTabbedPane a, int b) {
    Rectangle returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabBounds(a,b);
    }
    return returnValue;
}
 
源代码26 项目: openjdk-jdk8u-backup   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getTabRunCount(JTabbedPane a) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
    }
    return returnValue;
}
 
源代码27 项目: Bytecoder   文件: JTabbedPane.java
/**
 * Sets the UI object which implements the L&amp;F for this component.
 *
 * @param ui the new UI object
 * @see UIDefaults#getUI
 */
@BeanProperty(hidden = true, visualUpdate = true, description
        = "The UI object that implements the tabbedpane's LookAndFeel")
public void setUI(TabbedPaneUI ui) {
    super.setUI(ui);
    // disabled icons are generated by LF so they should be unset here
    for (int i = 0; i < getTabCount(); i++) {
        Icon icon = pages.get(i).disabledIcon;
        if (icon instanceof UIResource) {
            setDisabledIconAt(i, null);
        }
    }
}
 
源代码28 项目: Bytecoder   文件: JTabbedPane.java
/**
 * Returns the tooltip text for the component determined by the
 * mouse event location.
 *
 * @param event  the <code>MouseEvent</code> that tells where the
 *          cursor is lingering
 * @return the <code>String</code> containing the tooltip text
 */
public String getToolTipText(MouseEvent event) {
    if (ui != null) {
        int index = ((TabbedPaneUI)ui).tabForCoordinate(this, event.getX(), event.getY());

        if (index != -1) {
            return pages.get(index).tip;
        }
    }
    return super.getToolTipText(event);
}
 
源代码29 项目: Bytecoder   文件: JTabbedPane.java
/**
 * Returns the <code>Accessible</code> child contained at
 * the local coordinate <code>Point</code>, if one exists.
 * Otherwise returns the currently selected tab.
 *
 * @return the <code>Accessible</code> at the specified
 *    location, if it exists
 */
public Accessible getAccessibleAt(Point p) {
    int tab = ((TabbedPaneUI) ui).tabForCoordinate(JTabbedPane.this,
                                                   p.x, p.y);
    if (tab == -1) {
        tab = getSelectedIndex();
    }
    return getAccessibleChild(tab);
}
 
源代码30 项目: Bytecoder   文件: MultiTabbedPaneUI.java
/**
 * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int tabForCoordinate(JTabbedPane a, int b, int c) {
    int returnValue =
        ((TabbedPaneUI) (uis.elementAt(0))).tabForCoordinate(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TabbedPaneUI) (uis.elementAt(i))).tabForCoordinate(a,b,c);
    }
    return returnValue;
}
 
 类所在包
 同包方法