本文整理汇总了Java中com.intellij.ide.navigationToolbar.NavBarItem类的典型用法代码示例。如果您正苦于以下问题:Java NavBarItem类的具体用法?Java NavBarItem怎么用?Java NavBarItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NavBarItem类属于com.intellij.ide.navigationToolbar包,在下文中一共展示了NavBarItem类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doPaintNavBarItem
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
@Override
public void doPaintNavBarItem(Graphics2D g, NavBarItem item, NavBarPanel navbar) {
final boolean floating = navbar.isInFloatingMode();
boolean toolbarVisible = UISettings.getInstance().SHOW_MAIN_TOOLBAR;
final boolean selected = item.isSelected() && item.isFocused();
boolean nextSelected = item.isNextSelected() && navbar.hasFocus();
Map<ImageType, BufferedImage> cached = myCache.get(item);
ImageType type;
if (floating) {
type = selected ? ImageType.ACTIVE_FLOATING : nextSelected ? ImageType.NEXT_ACTIVE_FLOATING : ImageType.INACTIVE_FLOATING;
} else {
if (toolbarVisible) {
type = selected ? ImageType.ACTIVE : nextSelected ? ImageType.NEXT_ACTIVE : ImageType.INACTIVE;
} else {
type = selected ? ImageType.ACTIVE_NO_TOOLBAR : nextSelected ? ImageType.NEXT_ACTIVE_NO_TOOLBAR : ImageType.INACTIVE_NO_TOOLBAR;
}
}
if (cached == null) {
cached = new HashMap<ImageType, BufferedImage>();
myCache.put(item, cached);
}
BufferedImage image = cached.get(type);
if (image == null) {
image = drawToBuffer(item, floating, toolbarVisible, selected, navbar);
cached.put(type, image);
}
UIUtil.drawImage(g, image, 0, 0, null);
Icon icon = item.getIcon();
final int offset = item.isFirstElement() ? getFirstElementLeftOffset() : 0;
final int iconOffset = getElementPadding().left + offset;
icon.paintIcon(item, g, iconOffset, (item.getHeight() - icon.getIconHeight()) / 2);
final int textOffset = icon.getIconWidth() + getElementPadding().width() + offset;
item.doPaintText(g, textOffset);
}
示例2: getOffsets
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
@Override
public Dimension getOffsets(NavBarItem item) {
final Dimension size = new Dimension();
if (! item.isPopupElement()) {
size.width += getDecorationOffset() + getElementPadding().width() + (item.isFirstElement() ? getFirstElementLeftOffset() : 0);
size.height += getElementPadding().height();
}
return size;
}
示例3: getElementFont
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
@Override
public Font getElementFont(NavBarItem navBarItem) {
return SystemInfo.isMac ? UIUtil.getLabelFont(UIUtil.FontSize.SMALL) : UIUtil.getLabelFont();
}
示例4: getPopupOffset
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
@Override
public int getPopupOffset(@NotNull NavBarItem item) {
return item.isFirstElement() ? 0 : JBUI.scale(5);
}
示例5: getElementFont
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
@Override
public Font getElementFont(NavBarItem navBarItem) {
return UIUtil.getLabelFont(UIUtil.FontSize.SMALL);
}
示例6: getPopupOffset
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
@Override
public int getPopupOffset(@NotNull NavBarItem item) {
return item.isFirstElement() ? 0 : 5;
}
示例7: getPopupOffset
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
@Override
public int getPopupOffset(@Nonnull NavBarItem item) {
return item.isFirstElement() ? 0 : 5;
}
示例8: getElementFont
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
@Override
public Font getElementFont(NavBarItem navBarItem) {
return UIUtil.getLabelFont().deriveFont(11.0f);
}
示例9: getPopupOffset
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
/**
* Returns offset for NavBarPopup
*
* @param item nav bar item
* @return offset for NavBarPopup
*/
int getPopupOffset(@NotNull NavBarItem item);
示例10: getOffsets
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
/**
* NavBarItem offsets
* @param item NavBar element
* @return offsets
*/
Dimension getOffsets(NavBarItem item);
示例11: getPopupOffset
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
/**
* Returns offset for NavBarPopup
*
* @param item nav bar item
* @return offset for NavBarPopup
*/
int getPopupOffset(@Nonnull NavBarItem item);
示例12: getElementFont
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
Font getElementFont(NavBarItem navBarItem);
示例13: doPaintNavBarItem
import com.intellij.ide.navigationToolbar.NavBarItem; //导入依赖的package包/类
void doPaintNavBarItem(Graphics2D g, NavBarItem item, NavBarPanel navbar);