本文整理汇总了Java中org.openide.windows.TopComponent.getIcon方法的典型用法代码示例。如果您正苦于以下问题:Java TopComponent.getIcon方法的具体用法?Java TopComponent.getIcon怎么用?Java TopComponent.getIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.windows.TopComponent
的用法示例。
在下文中一共展示了TopComponent.getIcon方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTopComponents
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
@Override
public void setTopComponents(TopComponent[] tcs, TopComponent selected) {
TabData[] data = new TabData[tcs.length];
int toSelect=-1;
for(int i = 0; i < tcs.length; i++) {
TopComponent tc = tcs[i];
Image icon = tc.getIcon();
String displayName = WindowManagerImpl.getInstance().getTopComponentDisplayName(tc);
data[i] = new TabData(
tc,
icon == null ? null : new ImageIcon(icon),
displayName == null ? "" : displayName, // NOI18N
tc.getToolTipText());
if (selected == tcs[i]) {
toSelect = i;
}
}
dataModel.setTabs(data);
setSelectedComponent(selected);
}
示例2: addTCIntoTab
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
/** Adds TopComponent into specified tab. */
private void addTCIntoTab(TopComponent tc, int kind) {
if(containsTC(tabbed, tc)) {
return;
}
Image icon = tc.getIcon();
try {
ignoreChange = true;
String title = WindowManagerImpl.getInstance().getTopComponentDisplayName(tc);
if(title == null) {
title = ""; // NOI18N
}
tabbed.addTopComponent(
title,
icon == null ? null : new ImageIcon(icon),
tc, tc.getToolTipText());
} finally {
ignoreChange = false;
}
}
示例3: topComponentIconChanged
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
/** Called when icon of some component in this multi frame has changed */
public void topComponentIconChanged(TopComponent tc) {
int index = tabbed.indexOf(tc);
if (index < 0) {
return;
}
Image icon = tc.getIcon();
if( null != icon ) {
tabbed.setIconAt(index, new ImageIcon(tc.getIcon()));
} else {
Logger.getLogger(TabbedHandler.class.getName()).log(Level.INFO, "TopComponent has no icon: " + tc);
tabbed.setIconAt(index, null);
}
}
示例4: extractIcon
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
private static Icon extractIcon( TopComponent tc ) {
Image img = tc.getIcon();
if( null != img )
return ImageUtilities.image2Icon( img );
return null;
}