当前位置: 首页>>代码示例>>Java>>正文


Java RendererService类代码示例

本文整理汇总了Java中com.rapidminer.gui.renderer.RendererService的典型用法代码示例。如果您正苦于以下问题:Java RendererService类的具体用法?Java RendererService怎么用?Java RendererService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RendererService类属于com.rapidminer.gui.renderer包,在下文中一共展示了RendererService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getData

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 * Returns a list of non-null data of all input ports.
 * 
 * @param unfold
 *            If true, collections are added as individual objects rather than as a collection.
 *            The unfolding is done recursively.
 * @throws UserError
 * */
@SuppressWarnings("unchecked")
public <T extends IOObject> List<T> getData(Class<T> desiredClass, boolean unfold) throws UserError {
	List<T> results = new LinkedList<T>();
	for (InputPort port : getManagedPorts()) {
		IOObject data = port.getAnyDataOrNull();
		if (data != null) {
			if (unfold && (data instanceof IOObjectCollection)) {
				unfold((IOObjectCollection) data, results, desiredClass, port);
			} else {
				if (desiredClass.isInstance(data)) {
					results.add((T) data);
				} else {
					throw new UserError(getPorts().getOwner().getOperator(), 156, RendererService.getName(data
							.getClass()), port.getName(), RendererService.getName(desiredClass));
				}
			}
		}
	}
	return results;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:29,代码来源:InputPortExtender.java

示例2: unfold

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 * @param desiredClass
 *            method will throw unless all non-collection children are of type desired class
 * @param port
 *            Used for error message only
 */
@SuppressWarnings("unchecked")
private <T extends IOObject> void unfold(IOObjectCollection<?> collection, List<T> results, Class<T> desiredClass,
		Port port) throws UserError {
	for (IOObject obj : collection.getObjects()) {
		if (obj instanceof IOObjectCollection) {
			unfold((IOObjectCollection) obj, results, desiredClass, port);
		} else {
			if (desiredClass.isInstance(obj)) {
				results.add((T) obj);
			} else {
				throw new UserError(getPorts().getOwner().getOperator(), 156, RendererService.getName(obj.getClass()),
						port.getName(), RendererService.getName(desiredClass));
			}
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:23,代码来源:InputPortExtender.java

示例3: getDescription

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
public String getDescription() {
	String name = RendererService.getName(dataClass);
	if (name == null) {
		name = dataClass.getSimpleName();
	}
	StringBuilder desc = new StringBuilder(name);
	if (!keyValueMap.isEmpty()) {
		desc.append("; ");
		desc.append(keyValueMap);
	}
	if ((annotations != null) && !annotations.isEmpty()) {
		desc.append("<ul>");
		for (String key : annotations.getKeys()) {
			desc.append("<li><em>").append(key).append(":</em> ").append(annotations.get(key));
		}
		desc.append("</ul>");
	}
	return desc.toString();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:20,代码来源:MetaData.java

示例4: getTypeNameForType

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 * Returns the name of a type in exchange for its class' name.
 *
 * @param type
 *            the class' name as String
 * @return the short name of the class as String
 */
@SuppressWarnings("unchecked")
public static String getTypeNameForType(String type) {
	String typeName = null;
	if (type == null || type.isEmpty()) {
		typeName = "";
	} else {
		Class<? extends IOObject> typeClass;
		try {
			typeClass = (Class<? extends IOObject>) Class.forName(type);

			typeName = " (" + RendererService.getName(typeClass) + ")";
		} catch (ClassNotFoundException e) {
			LogService.getRoot().finer("Failed to lookup class '" + type + "'. Reason: " + e.getLocalizedMessage());
			typeName = "";
		}
	}
	return typeName;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:26,代码来源:OperatorDocToHtmlConverter.java

示例5: getIconNameForType

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 *
 * Searches for a class with the given name and returns the path of the resource.
 *
 * @param clazz
 *            the class as Class.
 * @return the path of the resource of the corresponding icon.
 */
private static String getIconNameForType(Class<? extends IOObject> clazz) {
	String iconName;
	String path = null;
	Class<? extends IOObject> typeClass;
	typeClass = clazz;
	iconName = RendererService.getIconName(typeClass);
	if (iconName == null) {
		iconName = "plug.png";
	}
	try {
		path = SwingTools.getIconPath("24/" + iconName);
	} catch (Exception e) {
		LogService.getRoot().finer("Error retrieving icon for type '" + clazz + "'! Reason: " + e.getLocalizedMessage());
	}
	return path;

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:26,代码来源:OperatorDocToHtmlConverter.java

示例6: displayInputPortWrongTypeInformation

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 * Displays an error bubble that alerts the user that an input port of an operator expected
 * input of a certain type but received the wrong type. The bubble is located at the port and
 * the process view will change to said port. This method is used after the error occurred
 * during process execution.
 *
 * @param port
 *            the port for which to display the error
 * @param expectedType
 *            the expected data type for the port
 * @param actualType
 *            the actually delivered type for the port
 * @return the {@link PortInfoBubble} instance, never {@code null}
 */
public static PortInfoBubble displayInputPortWrongTypeInformation(final Port port, final Class<?> expectedType,
		final Class<?> actualType) {
	if (port == null) {
		throw new IllegalArgumentException("port must not be null!");
	}
	if (expectedType == null) {
		throw new IllegalArgumentException("expectedType must not be null!");
	}
	if (actualType == null) {
		throw new IllegalArgumentException("actualType must not be null!");
	}

	String key = "process_mandatory_input_port_wrong_type";
	return displayMissingInputPortInformation(port, true, true, key, RendererService.getName(expectedType),
			RendererService.getName(actualType));
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:31,代码来源:ProcessGUITools.java

示例7: RendersPane

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
public RendersPane() {
	blackListTmp = RendererService.getBlackList();
	Map<String, Set<String>> OldBlackList = RendererService.getBlackList();

	this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

	Set<String> allNames = RendererService.getAllRenderableObjectNames();
	for (String name : allNames) {
		JLabel label = new JLabel(name);
		Font font = label.getFont();
		label.setFont(font.deriveFont(font.getStyle() | Font.BOLD));
		this.add(label);
		for (com.rapidminer.gui.renderer.Renderer render : RendererService.getRenderers(name)) {
			JCheckBox checkBox = new JCheckBox(render.getName());
			checkBox.addItemListener(new RendersChangeListener(name, render.getName(), checkBox));
			checkBox.setSelected(!inBlackList(name, render.getName()));
			this.add(checkBox);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:21,代码来源:RendersDialog.java

示例8: showResult

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 * Show result in a new tab.
 */
void showResult() {
    if (resultObjects == null) return;
    int i = 1;
    for(IOObject result: resultObjects) {
        if(result instanceof ResultObject) {
            String resultName = result instanceof ExampleSet ?
                    ((ResultObject) result).getName() :
                    RendererService.getName(result.getClass());
            String tabName = prunedProcessName + " - " + resultName;
            RapidMinerGUI.getMainFrame()
                    .getRemoteResultDisplay()
                    .showResultWithName((ResultObject) result, tabName);
            i ++;
        }
    }
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:20,代码来源:RemoteResultOverviewItem.java

示例9: getData

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 * Returns a list of non-null data of all input ports.
 * 
 * @param unfold
 *            If true, collections are added as individual objects rather than as a collection.
 *            The unfolding is done recursively.
 * @throws UserError
 */
@SuppressWarnings("unchecked")
public <T extends IOObject> List<T> getData(Class<T> desiredClass, boolean unfold) throws UserError {
	List<T> results = new ArrayList<T>();
	for (InputPort port : getManagedPorts()) {
		IOObject data = port.getAnyDataOrNull();
		if (data != null) {
			if (unfold && data instanceof IOObjectCollection) {
				unfold((IOObjectCollection<?>) data, results, desiredClass, port);
			} else {
				if (desiredClass.isInstance(data)) {
					results.add((T) data);
				} else {
					throw new UserError(getPorts().getOwner().getOperator(), 156,
							RendererService.getName(data.getClass()), port.getName(),
							RendererService.getName(desiredClass));
				}
			}
		}
	}
	return results;
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:30,代码来源:InputPortExtender.java

示例10: unfold

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 * @param desiredClass
 *            method will throw unless all non-collection children are of type desired class
 * @param port
 *            Used for error message only
 */
@SuppressWarnings("unchecked")
private <T extends IOObject> void unfold(IOObjectCollection<?> collection, List<T> results, Class<T> desiredClass,
		Port port) throws UserError {
	for (IOObject obj : collection.getObjects()) {
		if (obj instanceof IOObjectCollection) {
			unfold((IOObjectCollection<?>) obj, results, desiredClass, port);
		} else {
			if (desiredClass.isInstance(obj)) {
				results.add((T) obj);
			} else {
				throw new UserError(getPorts().getOwner().getOperator(), 156, RendererService.getName(obj.getClass()),
						port.getName(), RendererService.getName(desiredClass));
			}
		}
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:23,代码来源:InputPortExtender.java

示例11: getTypeNameForType

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
static String getTypeNameForType(Class<? extends IOObject> typeClass) {
	String typeName;
	if (typeClass != null) {
		typeName = RendererService.getName(typeClass);
		if (typeName != null && !typeName.isEmpty()) {
			typeName = " (" + typeName + ")";
		} else {
			LogService.getRoot().log(Level.FINER,
					"com.rapidminer.gui.OperatorDocToHtmlConverter.getTypeNameForTypeFromClass_no_name", typeClass);
			typeName = "";
		}
	} else {
		LogService.getRoot().log(Level.FINER,
				"com.rapidminer.gui.OperatorDocToHtmlConverter.getTypeNameForTypeFromClass_null", typeClass);
		typeName = "";
	}
	return typeName;
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:19,代码来源:OperatorDocToHtmlConverter.java

示例12: getIconNameForType

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 * Searches for a class with the given name and returns the path of the resource. Used for the
 * images of the ports' data types.
 *
 * @param type
 *            the class' name as String
 * @return the path of the resource of the corresponding icon.
 */
@SuppressWarnings("unchecked")
public static String getIconNameForType(String type) {
	String iconName;
	if (type == null || type.isEmpty()) {
		iconName = "plug.png";
	} else {
		Class<? extends IOObject> typeClass;
		try {
			typeClass = (Class<? extends IOObject>) Class.forName(type);
			iconName = RendererService.getIconName(typeClass);
			if (iconName == null) {
				iconName = "plug.png";
			}
		} catch (ClassNotFoundException e) {
			LogService.getRoot().finer("Failed to lookup class '" + type + "'. Reason: " + e.getLocalizedMessage());
			iconName = "plug.png";
		}
	}

	String path = SwingTools.getIconPath("24/" + iconName);
	return path;
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:31,代码来源:OperatorDocToHtmlConverter.java

示例13: getIconNameForType

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/**
 *
 * Searches for a class with the given name and returns the path of the resource.
 *
 * @param clazz
 *            the class as Class.
 * @return the path of the resource of the corresponding icon.
 */
private static String getIconNameForType(Class<? extends IOObject> clazz) {
	String path = null;
	String iconName;
	if (clazz == null) {
		iconName = "plug.png";
	} else {
		iconName = RendererService.getIconName(clazz);
	}
	try {
		path = SwingTools.getIconPath("24/" + iconName);
	} catch (Exception e) {
		LogService.getRoot().finer("Error retrieving icon for type '" + clazz + "'! Reason: " + e.getLocalizedMessage());
	}
	return path;

}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:25,代码来源:OperatorDocLoader.java

示例14: getData

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
/** Returns a list of non-null data of all input ports. 
 * @param unfold If true, collections are added as individual objects rather than as a collection. The unfolding is done recursively.  
 * @throws UserError 
 * */
@SuppressWarnings("unchecked")
public <T extends IOObject> List<T> getData(Class<T> desiredClass, boolean unfold) throws UserError {
	List<T> results = new LinkedList<T>();		
	for (InputPort port : getManagedPorts()) {
		IOObject data = port.getAnyDataOrNull();
		if (data != null) {
			if (unfold && (data instanceof IOObjectCollection)) {
				unfold((IOObjectCollection)data, results, desiredClass, port);
			} else {
				if (desiredClass.isInstance(data)) {
					results.add((T)data);
				} else {
					throw new UserError(getPorts().getOwner().getOperator(), 156, RendererService.getName(data.getClass()), port.getName(), RendererService.getName(desiredClass));
				}
			}
		}
	}
	return results;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:24,代码来源:InputPortExtender.java

示例15: getDescription

import com.rapidminer.gui.renderer.RendererService; //导入依赖的package包/类
public String getDescription() {
    String name = RendererService.getName(dataClass);
    if (name == null)
        name = dataClass.getSimpleName();
    StringBuilder desc = new StringBuilder(name);
    if (!keyValueMap.isEmpty()) {
        desc.append("; ");
        desc.append(keyValueMap);
    }
    if ((annotations != null) && !annotations.isEmpty()) {
        desc.append("<ul>");
        for (String key: annotations.getKeys()) {
            desc.append("<li><em>").append(key).append(":</em> ").append(annotations.get(key));
        }
        desc.append("</ul>");
    }
    return desc.toString();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:19,代码来源:MetaData.java


注:本文中的com.rapidminer.gui.renderer.RendererService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。