當前位置: 首頁>>代碼示例>>Java>>正文


Java RendererService.getName方法代碼示例

本文整理匯總了Java中com.rapidminer.gui.renderer.RendererService.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java RendererService.getName方法的具體用法?Java RendererService.getName怎麽用?Java RendererService.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.rapidminer.gui.renderer.RendererService的用法示例。


在下文中一共展示了RendererService.getName方法的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: 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

示例6: 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

示例7: 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

示例8: 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

示例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 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

示例10: 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

示例11: 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:rapidminer,項目名稱:rapidminer-5,代碼行數:25,代碼來源:OperatorDocToHtmlConverter.java

示例12: createComponent

import com.rapidminer.gui.renderer.RendererService; //導入方法依賴的package包/類
private JPanel createComponent(ResultObject resultObject, IOContainer resultContainer) {
	final String resultName = RendererService.getName(resultObject.getClass());
	String usedResultName = resultObject.getName();
	if (usedResultName == null) {
		usedResultName = resultName;
	}
	synchronized (currentResultNames) {
		Integer oldCount = currentResultNames.get(usedResultName);
		int myIndex;
		if (oldCount == null) {
			myIndex = 1;			
		} else {
			myIndex = oldCount+1;						
		}
		currentResultNames.put(usedResultName, myIndex);
		if (myIndex > 1) {
			usedResultName += "(" + myIndex + ")";
		}
	}
	return ResultDisplayTools.createVisualizationComponent(resultObject, resultContainer, usedResultName);
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:22,代碼來源:TabbedResultDisplay.java

示例13: doWork

import com.rapidminer.gui.renderer.RendererService; //導入方法依賴的package包/類
@Override
public void doWork() throws OperatorException {
	// The old and new random forest model implementations are not related (class hierarchy).
	// Thus, Port#getData() would fail for one or the other. For this reason, the implementation
	// below request the common super-type Model and performs the compatibility check manually.
	Model forest = forestInput.getData(Model.class);
	if (!(forest instanceof MetaModel)
			|| !(forest instanceof ConfigurableRandomForestModel || forest instanceof RandomForestModel)) {
		PortUserError error = new PortUserError(forestInput, 156, RendererService.getName(forest.getClass()),
				forestInput.getName(), RendererService.getName(ConfigurableRandomForestModel.class));
		error.setExpectedType(ConfigurableRandomForestModel.class);
		error.setActualType(forest.getClass());
		throw error;
	}

	String[] labelValues = forest.getTrainingHeader().getAttributes().getLabel().getMapping().getValues()
			.toArray(new String[0]);

	// now start measuring weights
	Criterion criterion = AbstractCriterion.createCriterion(this, 0);
	HashMap<String, Double> attributeBenefitMap = new HashMap<>();
	for (Model model : ((MetaModel) forest).getModels()) {
		TreeModel treeModel = (TreeModel) model;
		extractWeights(attributeBenefitMap, criterion, treeModel.getRoot(), labelValues);
	}

	AttributeWeights weights = new AttributeWeights();
	int numberOfModels = ((MetaModel) forest).getModels().size();
	for (Entry<String, Double> entry : attributeBenefitMap.entrySet()) {
		weights.setWeight(entry.getKey(), entry.getValue() / numberOfModels);
	}

	if (getParameterAsBoolean(PARAMETER_NORMALIZE_WEIGHTS)) {
		weights.normalize();
	}

	weightsOutput.deliver(weights);
	forestOutput.deliver(forest);
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:40,代碼來源:ForestBasedWeighting.java

示例14: getData

import com.rapidminer.gui.renderer.RendererService; //導入方法依賴的package包/類
@Override
public <T extends IOObject> T getData(Class<T> desiredClass) throws UserError {
	IOObject data = getAnyDataOrNull();
	if (data == null) {
		throw new PortUserError(this, 149, getSpec() + (isConnected() ? " (connected)" : " (disconnected)"));
	} else if (desiredClass.isAssignableFrom(data.getClass())) {
		return desiredClass.cast(data);
	} else {
		PortUserError error = new PortUserError(this, 156, RendererService.getName(data.getClass()), this.getName(),
				RendererService.getName(desiredClass));
		error.setExpectedType(desiredClass);
		error.setActualType(data.getClass());
		throw error;
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:16,代碼來源:AbstractPort.java

示例15: getDataOrNull

import com.rapidminer.gui.renderer.RendererService; //導入方法依賴的package包/類
@Override
public <T extends IOObject> T getDataOrNull(Class<T> desiredClass) throws UserError {
	IOObject data = getAnyDataOrNull();
	if (data == null) {
		return null;
	} else if (desiredClass.isAssignableFrom(data.getClass())) {
		return desiredClass.cast(data);
	} else {
		PortUserError error = new PortUserError(this, 156, RendererService.getName(data.getClass()), this.getName(),
				RendererService.getName(desiredClass));
		error.setExpectedType(desiredClass);
		error.setActualType(data.getClass());
		throw error;
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:16,代碼來源:AbstractPort.java


注:本文中的com.rapidminer.gui.renderer.RendererService.getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。