本文整理汇总了Java中com.intellij.ide.navigationToolbar.NavBarPanel类的典型用法代码示例。如果您正苦于以下问题:Java NavBarPanel类的具体用法?Java NavBarPanel怎么用?Java NavBarPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NavBarPanel类属于com.intellij.ide.navigationToolbar包,在下文中一共展示了NavBarPanel类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doPaintNavBarItem
import com.intellij.ide.navigationToolbar.NavBarPanel; //导入依赖的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: doPaintNavBarItem
import com.intellij.ide.navigationToolbar.NavBarPanel; //导入依赖的package包/类
void doPaintNavBarItem(Graphics2D g, NavBarItem item, NavBarPanel navbar);