本文整理匯總了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);