当前位置: 首页>>代码示例>>Java>>正文


Java TabbedPaneUI.tabForCoordinate方法代码示例

本文整理汇总了Java中javax.swing.plaf.TabbedPaneUI.tabForCoordinate方法的典型用法代码示例。如果您正苦于以下问题:Java TabbedPaneUI.tabForCoordinate方法的具体用法?Java TabbedPaneUI.tabForCoordinate怎么用?Java TabbedPaneUI.tabForCoordinate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.plaf.TabbedPaneUI的用法示例。


在下文中一共展示了TabbedPaneUI.tabForCoordinate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showPopup

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
/** 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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:MergeDialogComponent.java

示例2: closeTabAt

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
private void closeTabAt(int x, int y) {
  TabbedPaneUI ui = getUI();
  int index = ui.tabForCoordinate(this, x, y);
  if (index < 0 || !myManager.canCloseContents()) {
    return;
  }
  final Content content = myManager.getContent(index);
  if (content != null && content.isCloseable()) {
    myManager.removeContent(content, true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:TabbedPaneContentUI.java

示例3: processMouseEvent

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
protected void processMouseEvent(MouseEvent e) {
  if (e.isPopupTrigger()) { // Popup doesn't activate clicked tab.
    showPopup(e.getX(), e.getY());
    return;
  }

  if (!e.isShiftDown() && (MouseEvent.BUTTON1_MASK & e.getModifiers()) > 0) { // RightClick without Shift modifiers just select tab
    if (MouseEvent.MOUSE_RELEASED == e.getID()) {
      TabbedPaneUI ui = getUI();
      int index = ui.tabForCoordinate(this, e.getX(), e.getY());
      if (index != -1) {
        setSelectedIndex(index);
      }
      hideMenu();
    }
  }
  else if (e.isShiftDown() && (MouseEvent.BUTTON1_MASK & e.getModifiers()) > 0) { // Shift+LeftClick closes the tab
    if (MouseEvent.MOUSE_RELEASED == e.getID()) {
      closeTabAt(e.getX(), e.getY());
      hideMenu();
    }
  }
  else if ((MouseEvent.BUTTON2_MASK & e.getModifiers()) > 0) { // MouseWheelClick closes the tab
    if (MouseEvent.MOUSE_RELEASED == e.getID()) {
      closeTabAt(e.getX(), e.getY());
      hideMenu();
    }
  }
  else if ((MouseEvent.BUTTON3_MASK & e.getModifiers()) > 0 && SystemInfo.isWindows) { // Right mouse button doesn't activate tab
  }
  else {
    super.processMouseEvent(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:TabbedPaneContentUI.java

示例4: getContentAt

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
/**
 * @return content at the specified location.  <code>x</code> and <code>y</code> are in
 *         tabbed pane coordinate system. The method returns <code>null</code> if there is no contnt at the
 *         specified location.
 */
private Content getContentAt(int x, int y) {
  TabbedPaneUI ui = getUI();
  int index = ui.tabForCoordinate(this, x, y);
  if (index < 0) {
    return null;
  }
  return myManager.getContent(index);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:TabbedPaneContentUI.java

示例5: getInplaceProperty

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
/**
 * @return inplace property for editing of the title of the clicked tab
 */
public Property getInplaceProperty(final int x, final int y) {
  final JTabbedPane tabbedPane = getTabbedPane();
  final TabbedPaneUI ui = tabbedPane.getUI();
  LOG.assertTrue(ui != null);
  final int index = ui.tabForCoordinate(tabbedPane, x, y);
  return index != -1 ? new MyTitleProperty(null, index) : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:RadTabbedPane.java

示例6: getInplaceEditorBounds

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
public Rectangle getInplaceEditorBounds(final Property property, final int x, final int y) {
  final JTabbedPane tabbedPane = getTabbedPane();
  final TabbedPaneUI ui = tabbedPane.getUI();
  LOG.assertTrue(ui != null);
  final int index = ui.tabForCoordinate(tabbedPane, x, y);
  LOG.assertTrue(index != -1);
  return ui.getTabBounds(tabbedPane, index);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:RadTabbedPane.java


注:本文中的javax.swing.plaf.TabbedPaneUI.tabForCoordinate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。