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


Java TabbedPaneUI.getTabBounds方法代码示例

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


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

示例1: placeFeedback

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
public void placeFeedback(FeedbackLayer feedbackLayer, ComponentDragObject dragObject) {
  final String tooltipText = UIDesignerBundle.message("insert.feedback.add.tab", getDisplayName(), myInsertIndex);
  if (myInsertIndex < getTabbedPane().getTabCount()) {
    feedbackLayer.putFeedback(getDelegee(), myFeedbackRect, VertInsertFeedbackPainter.INSTANCE, tooltipText);
  }
  else {
    Rectangle rcFeedback;
    final JTabbedPane tabbedPane = getTabbedPane();
    final TabbedPaneUI ui = tabbedPane.getUI();
    if (tabbedPane.getTabCount() > 0) {
      Rectangle rc = ui.getTabBounds(tabbedPane, tabbedPane.getTabCount()-1);
      rcFeedback = new Rectangle(rc.x+rc.width, rc.y, 50, rc.height);
    }
    else {
      // approximate
      rcFeedback = new Rectangle(0, 0, 50, tabbedPane.getFontMetrics(tabbedPane.getFont()).getHeight() + 8);
    }
    feedbackLayer.putFeedback(getDelegee(), rcFeedback, tooltipText);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:RadTabbedPane.java

示例2: maybeShowKeyStoreTabPopup

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
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;
		}
	}
}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:21,代码来源:KseFrame.java

示例3: getTabIndexAt

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
protected final int getTabIndexAt(final int x,final int y){
  final TabbedPaneUI ui=getUI();
  for (int i = 0; i < getTabCount(); i++) {
    final Rectangle bounds = ui.getTabBounds(this, i);
    if (bounds.contains(x, y)) {
      return i;
    }
  }
  return -1;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:TabbedPaneImpl.java

示例4: 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

示例5: getDropLocation

import javax.swing.plaf.TabbedPaneUI; //导入方法依赖的package包/类
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  final JTabbedPane tabbedPane = getTabbedPane();
  final TabbedPaneUI ui = tabbedPane.getUI();
  if (location != null && tabbedPane.getTabCount() > 0) {
    for(int i=0; i<tabbedPane.getTabCount(); i++) {
      Rectangle rc = ui.getTabBounds(tabbedPane, i);
      if (location.x < rc.getCenterX()) {
        return new InsertTabDropLocation(i, new Rectangle(rc.x-4, rc.y, 8, rc.height));
      }
    }
  }
  return new InsertTabDropLocation(tabbedPane.getTabCount(), null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:RadTabbedPane.java


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