本文整理汇总了Java中com.intellij.ui.tabs.impl.JBTabsImpl.getTabsPosition方法的典型用法代码示例。如果您正苦于以下问题:Java JBTabsImpl.getTabsPosition方法的具体用法?Java JBTabsImpl.getTabsPosition怎么用?Java JBTabsImpl.getTabsPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.tabs.impl.JBTabsImpl
的用法示例。
在下文中一共展示了JBTabsImpl.getTabsPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addHeaderSize
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入方法依赖的package包/类
protected void addHeaderSize(JBTabsImpl tabs, Dimension size, final int tabsCount) {
Dimension header = computeHeaderPreferredSize(tabs, tabsCount);
final boolean horizontal = tabs.getTabsPosition() == JBTabsPosition.top || tabs.getTabsPosition() == JBTabsPosition.bottom;
if (horizontal) {
size.height += header.height;
size.width = Math.max(size.width, header.width);
}
else {
size.height += Math.max(size.height, header.height);
size.width += header.width;
}
final Insets insets = tabs.getLayoutInsets();
size.width += insets.left + insets.right + 1;
size.height += insets.top + insets.bottom + 1;
}
示例2: computeHeaderPreferredSize
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入方法依赖的package包/类
protected Dimension computeHeaderPreferredSize(JBTabsImpl tabs, int tabsCount) {
final Iterator<TabInfo> infos = tabs.myInfo2Label.keySet().iterator();
Dimension size = new Dimension();
int currentTab = 0;
final boolean horizontal = tabs.getTabsPosition() == JBTabsPosition.top || tabs.getTabsPosition() == JBTabsPosition.bottom;
while (infos.hasNext()) {
final boolean canGrow = currentTab < tabsCount;
TabInfo eachInfo = infos.next();
final TabLabel eachLabel = tabs.myInfo2Label.get(eachInfo);
final Dimension eachPrefSize = eachLabel.getPreferredSize();
if (horizontal) {
if (canGrow) {
size.width += eachPrefSize.width;
}
size.height = Math.max(size.height, eachPrefSize.height);
}
else {
size.width = Math.max(size.width, eachPrefSize.width);
if (canGrow) {
size.height += eachPrefSize.height;
}
}
currentTab++;
}
if (horizontal) {
size.height += tabs.getTabsBorder().getTabBorderSize();
}
else {
size.width += tabs.getTabsBorder().getTabBorderSize();
}
return size;
}
示例3: doPaintInactive
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入方法依赖的package包/类
protected void doPaintInactive(JBTabsImpl t,
Graphics2D g2d,
boolean leftGhostExists,
TabLabel label,
Rectangle effectiveBounds,
boolean rightGhostExists,
int row,
int column) {
Insets insets = t.getTabsBorder().getEffectiveBorder();
int _x = effectiveBounds.x + insets.left;
int _y = effectiveBounds.y + insets.top;
int _width = effectiveBounds.width - insets.left - insets.right + (t.getTabsPosition() == JBTabsPosition.right ? 1 : 0);
int _height = effectiveBounds.height - insets.top - insets.bottom;
if ((!t.isSingleRow() /* for multiline */) || (t.isSingleRow() && t.isHorizontalTabs())) {
if (t.isSingleRow() && t.getPosition() == JBTabsPosition.bottom) {
_y += t.getActiveTabUnderlineHeight();
}
else {
if (t.isSingleRow()) {
_height -= t.getActiveTabUnderlineHeight();
}
else {
TabInfo info = label.getInfo();
if (((TableLayout)t.getEffectiveLayout()).isLastRow(info)) {
_height -= t.getActiveTabUnderlineHeight();
}
}
}
}
final boolean vertical = t.getTabsPosition() == JBTabsPosition.left || t.getTabsPosition() == JBTabsPosition.right;
final Color tabColor = label.getInfo().getTabColor();
doPaintInactive(g2d, effectiveBounds, _x, _y, _width, _height, tabColor, row, column, vertical);
}
示例4: doPaintAdditionalBackgroundIfFirstOffsetSet
import com.intellij.ui.tabs.impl.JBTabsImpl; //导入方法依赖的package包/类
protected void doPaintAdditionalBackgroundIfFirstOffsetSet(JBTabsImpl tabs, Graphics2D g2d, Rectangle clip) {
if (tabs.getTabsPosition() == JBTabsPosition.top && tabs.isSingleRow() && tabs.getFirstTabOffset() > 0) {
int maxOffset = 0;
int maxLength = 0;
for (int i = tabs.getVisibleInfos().size() - 1; i >= 0; i--) {
TabInfo visibleInfo = tabs.getVisibleInfos().get(i);
TabLabel tabLabel = tabs.myInfo2Label.get(visibleInfo);
Rectangle r = tabLabel.getBounds();
if (r.width == 0 || r.height == 0) continue;
maxOffset = r.x + r.width;
maxLength = r.height;
break;
}
maxOffset++;
g2d.setPaint(UIUtil.getPanelBackground());
if (tabs.getFirstTabOffset() > 0) {
g2d.fillRect(clip.x, clip.y, clip.x + JBUI.scale(tabs.getFirstTabOffset() - 1), clip.y + maxLength - tabs.getActiveTabUnderlineHeight());
}
g2d.fillRect(clip.x + maxOffset, clip.y, clip.width - maxOffset, clip.y + maxLength - tabs.getActiveTabUnderlineHeight());
g2d.setPaint(new JBColor(Gray._181, UIUtil.getPanelBackground()));
g2d.drawLine(clip.x + maxOffset, clip.y + maxLength - tabs.getActiveTabUnderlineHeight(), clip.x + clip.width,
clip.y + maxLength - tabs.getActiveTabUnderlineHeight());
g2d.setPaint(UIUtil.getPanelBackground());
g2d.drawLine(clip.x, clip.y + maxLength, clip.width, clip.y + maxLength);
}
}