當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。