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