本文整理汇总了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);
}
}
示例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;
}
}
}
示例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;
}
示例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);
}
示例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);
}