本文整理匯總了Java中com.rapidminer.gui.tools.SwingTools.createIcon方法的典型用法代碼示例。如果您正苦於以下問題:Java SwingTools.createIcon方法的具體用法?Java SwingTools.createIcon怎麽用?Java SwingTools.createIcon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.rapidminer.gui.tools.SwingTools
的用法示例。
在下文中一共展示了SwingTools.createIcon方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setConnectionEntry
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
public void setConnectionEntry(ConnectionEntry entry, boolean showErrorMessage) {
if(entry == null) {
this.databaseHandler = null;
if(!"false".equals(ParameterService.getParameterValue("rapidminer.gui.fetch_data_base_table_names"))) {
this.connectionStatus.setText(I18N.getMessage(I18N.getGUIBundle(), "gui.dialog.error.db_connection_failed_short.message", new Object[0]));
ImageIcon e = SwingTools.createIcon("16/" + I18N.getMessage(I18N.getGUIBundle(), "gui.dialog.error.db_connection_failed_short.icon", new Object[0]));
this.connectionStatus.setIcon(e);
}
} else if(!"false".equals(ParameterService.getParameterValue("rapidminer.gui.fetch_data_base_table_names"))) {
try {
this.databaseHandler = DatabaseHandler.getConnectedDatabaseHandler(entry);
this.retrieveTableNames();
} catch (SQLException var5) {
if(showErrorMessage) {
SwingTools.showSimpleErrorMessage("db_connection_failed_url", var5, new Object[]{entry.getURL()});
}
this.connectionStatus.setText(I18N.getMessage(I18N.getGUIBundle(), "gui.dialog.error.db_connection_failed_short.message", new Object[]{entry.getURL()}));
ImageIcon connectionErrorIcon = SwingTools.createIcon("16/" + I18N.getMessage(I18N.getGUIBundle(), "gui.dialog.error.db_connection_failed_short.icon", new Object[0]));
this.connectionStatus.setIcon(connectionErrorIcon);
this.databaseHandler = null;
}
}
}
示例2: updateIcons
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
/**
* Update the icons. Icons may change when a license changes.
*/
private void updateIcons() {
if (iconName != null) {
icons = new ImageIcon[3];
icons[0] = SwingTools.createIcon("16/" + iconName);
icons[1] = SwingTools.createIcon("24/" + iconName);
icons[2] = SwingTools.createIcon("48/" + iconName);
if (!isSupportedByLicense()) {
icons[0] = SwingTools.createOverlayIcon(icons[0], UNSUPPORTED_ICON_SMALL);
icons[1] = SwingTools.createOverlayIcon(icons[1], UNSUPPORTED_ICON);
icons[2] = SwingTools.createOverlayIcon(icons[2], UNSUPPORTED_ICON_LARGE);
}
} else {
icons = EMPTY_ICONS;
}
}
示例3: adaptPlotConfigurationCell
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
private void adaptPlotConfigurationCell(JTree tree, PlotConfigurationTreeNode node, boolean selected,
boolean expanded, boolean leaf, int row, boolean hasFocus) {
String i18nKey = "plotter.configuration_dialog.global_configuration";
// set label font
Font fontValue = TREE_FONT;
if (fontValue == null) {
fontValue = nameLabel.getFont();
}
// fontValue = new Font(fontValue.getFamily(), Font.BOLD, fontValue.getSize());
// nameLabel.setFont(fontValue);
// set label icon
String icon = I18N.getMessageOrNull(I18N.getGUIBundle(), "gui.label." + i18nKey + ".icon");
if (icon != null) {
ImageIcon iicon = SwingTools.createIcon("16/" + icon);
nameLabel.setIcon(iicon);
}
// set label text
nameLabel.setText(I18N.getMessage(I18N.getGUIBundle(), "gui.label." + i18nKey + ".label"));
errorIconLabel.setIcon(null);
}
示例4: updatePerspectives
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
private void updatePerspectives(List<Perspective> perspectives) {
removeAll();
perspectiveMap.clear();
workspaceMenuGroup = new ButtonGroup();
for (Perspective p : perspectives) {
String name = p.getName();
Action action = new WorkspaceAction(PerspectiveMenu.this.perspectiveController, p, name);
if (p.isUserDefined()) {
action.putValue(Action.ACTION_COMMAND_KEY, "perspective-" + name);
action.putValue(Action.NAME, name);
ImageIcon createIcon = SwingTools
.createIcon("16/" + I18N.getMessage(I18N.getGUIBundle(), "gui.action.workspace_user.icon"));
action.putValue(Action.LARGE_ICON_KEY, createIcon);
action.putValue(Action.SMALL_ICON, createIcon);
action.putValue(Action.SHORT_DESCRIPTION,
I18N.getMessage(I18N.getGUIBundle(), "gui.action.workspace_user.tip", name));
}
JMenuItem menuItem = new JRadioButtonMenuItem(action);
add(menuItem);
perspectiveMap.put(p.getName(), menuItem);
workspaceMenuGroup.add(menuItem);
}
if (perspectiveMap.containsKey(perspectiveName)) {
perspectiveMap.get(perspectiveName).setSelected(true);
}
}
示例5: Template
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
/**
* Private constructor for special blank process template only.
*/
private Template() {
this.title = I18N.getGUILabel("getting_started.new.empty.title");
this.shortDescription = I18N.getGUILabel("getting_started.new.empty.description");
this.icon = SwingTools.createIcon("64/" + I18N.getGUILabel("getting_started.new.empty.icon"));
this.demoData = new LinkedList<>();
this.name = this.title;
this.processName = null;
this.path = null;
}
示例6: loadIcons
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
/**
* Loads the icons if defined.
*/
private void loadIcons() {
if (iconName == null) {
icons = null;
return;
}
icons = new ImageIcon[3];
icons[0] = SwingTools.createIcon("16/" + iconName);
icons[1] = SwingTools.createIcon("24/" + iconName);
icons[2] = SwingTools.createIcon("48/" + iconName);
}
示例7: getListCellRendererComponent
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
JLabel listCellRendererComponent = (JLabel) defaultRenderer.getListCellRendererComponent(list, value, index,
isSelected, cellHasFocus);
String text = textCache.get(value);
ImageIcon icon = iconCache.get(value);
if (text == null) {
// get enum text
text = I18N.getMessageOrNull(I18N.getGUIBundle(), "gui.label." + i18nKeyPrefix + "." + value + ".label");
if (text != null) {
textCache.put(value, text);
} else {
text = i18nKeyPrefix + "." + value;
}
// create label icon
String iconId = I18N.getMessageOrNull(I18N.getGUIBundle(), "gui.label." + i18nKeyPrefix + "." + value + ".icon");
if (iconId != null) {
icon = SwingTools.createIcon("16/" + iconId);
iconCache.put(value, icon);
}
}
// set text and icon
listCellRendererComponent.setText(text);
listCellRendererComponent.setIcon(icon);
return listCellRendererComponent;
}
示例8: PlotConfigurationTreeCellRenderer
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
public PlotConfigurationTreeCellRenderer(DataTableColumnListTransferHandler aTH) {
aTH.addDragListener(this);
ERROR_ICON = SwingTools.createIcon("16/"
+ I18N.getMessageOrNull(I18N.getGUIBundle(), "gui.label.plotter.configuratiom_dialog.error_icon"));
WARNING_ICON = SwingTools.createIcon("16/"
+ I18N.getMessageOrNull(I18N.getGUIBundle(), "gui.label.plotter.configuratiom_dialog.warning_icon"));
focusBorder = BorderFactory.createLineBorder(BORDER_SELECTION_COLOR);
nonFocusBorder = BorderFactory.createLineBorder(Color.white);
draggingNotFocusedBorder = BorderFactory.createLineBorder(ProcessDrawer.INNER_DRAG_COLOR);
dimensionAndRangeAxisRenderPanel = new DimensionAndRangeAxisTreeCellPanel();
globalAndValueSourceRenderPanel = new GlobalAndValueSourceTreeCellPanel();
}
示例9: getInfoIcon
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
@Override
protected Icon getInfoIcon() {
String configuredIcon = I18N.getMessageOrNull(I18N.getGUIBundle(), getKey() + ".icon");
if (configuredIcon != null) {
return super.getInfoIcon();
}
return SwingTools.createIcon("48/" + I18N.getMessage(I18N.getGUIBundle(), "gui.dialog.error.icon"));
}
示例10: getInfoIcon
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
@Override
protected Icon getInfoIcon() {
String iconName = I18N.getMessageOrNull(I18N.getGUIBundle(), getKey() + ".icon");
if (iconName == null || "".equals(iconName)) {
return SwingTools.createIcon("48/" + I18N.getMessage(I18N.getGUIBundle(), "gui.dialog.message.icon"));
} else {
return SwingTools.createIcon("48/" + iconName);
}
}
示例11: getInfoIcon
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
@Override
protected Icon getInfoIcon() {
String iconKey = I18N.getMessageOrNull(I18N.getGUIBundle(), getKey() + ".icon");
if (iconKey == null) {
return SwingTools.createIcon("48/" + I18N.getMessage(I18N.getGUIBundle(), "gui.dialog.confirm.icon"));
} else {
return SwingTools.createIcon("48/" + iconKey);
}
}
示例12: getInfoIcon
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
@Override
protected Icon getInfoIcon() {
// constants not possible because this class is referenced too early
if (type == DialogType.CONFIRM) {
return SwingTools.createIcon("48/" + I18N.getGUIMessage("gui.dialog.confirm.icon"));
} else if (type == DialogType.ACKNOWLEDGE) {
return SwingTools.createIcon("48/" + I18N.getGUIMessage("gui.dialog.ack.icon"));
}
return null;
}
示例13: getIcon
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
/**
* Creates image icon from the i18n; static since called from within the constructor.
*/
private static ImageIcon getIcon(String i18n) {
String iconName = I18N.getGUIMessageOrNull(i18n + ".icon");
if (iconName == null) {
return null;
}
return SwingTools.createIcon("16/" + iconName);
}
示例14: ResourceCard
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
public ResourceCard(String key, String i18nKey) {
this.key = key;
String titleName = I18N.getGUIMessageOrNull("gui.cards." + i18nKey + ".title");
if (titleName != null) {
this.title = "<html><div style=\"text-align: center;\"><body>" + titleName.replaceFirst(" ", "<br>")
+ "</html></body>";
this.tip = I18N.getGUIMessage("gui.cards." + i18nKey + ".tip");
} else {
// default case if no name and icon are defined:
key = key.replace("_", " ");
char[] stringArray = key.toCharArray();
stringArray[0] = Character.toUpperCase(stringArray[0]);
String defaultName = new String(stringArray);
this.title = "<html><div style=\"text-align: center;\"><body>" + defaultName.replaceFirst(" ", "<br>")
+ "</html></body>";
this.tip = defaultName;
}
String iconName = I18N.getGUIMessageOrNull("gui.cards." + i18nKey + ".icon");
if (iconName != null) {
this.icon = SwingTools.createIcon("32/" + iconName);
} else {
this.icon = SwingTools.createIcon("32/data_information.png"); // default icon
}
}
示例15: getListCellRendererComponent
import com.rapidminer.gui.tools.SwingTools; //導入方法依賴的package包/類
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
String text;
if (value == null) {
text = "##ERROR## Empty";
} else {
text = value.toString();
}
DataTableColumn column = (DataTableColumn) value;
tableColumnLabel.setText(text);
String i18nKey;
ValueType valueType = column.getValueType();
if (valueType == ValueType.DATE_TIME) {
tableColumnLabel.setForeground(TreeNodeColors.getDateColor());
i18nKey = "plotter.configuration_dialog.table_column_date_time";
} else if (valueType == ValueType.NOMINAL) {
tableColumnLabel.setForeground(TreeNodeColors.getNominalColor());
i18nKey = "plotter.configuration_dialog.table_column_nominal";
} else {
tableColumnLabel.setForeground(TreeNodeColors.getNumericalColor());
i18nKey = "plotter.configuration_dialog.table_column_numerical";
}
// set label icon
String icon = I18N.getMessageOrNull(I18N.getGUIBundle(), "gui.label." + i18nKey + ".icon");
if (icon != null) {
ImageIcon iicon = SwingTools.createIcon("16/" + icon, true);
tableColumnLabel.setIcon(iicon);
}
container.setBackground(list.getBackground());
if (isSelected || cellHasFocus) {
container.setBackground(list.getSelectionBackground());
container.setForeground(list.getSelectionForeground());
} else {
container.setForeground(list.getForeground());
container.setBackground(list.getBackground());
}
if (cellHasFocus) {
container.setBorder(focusBorder);
} else {
container.setBorder(noFocusBorder);
}
return container;
}