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


Java Node.getColumnIndex方法代码示例

本文整理汇总了Java中prefuse.data.Node.getColumnIndex方法的典型用法代码示例。如果您正苦于以下问题:Java Node.getColumnIndex方法的具体用法?Java Node.getColumnIndex怎么用?Java Node.getColumnIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在prefuse.data.Node的用法示例。


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

示例1: addInstanceToClass

import prefuse.data.Node; //导入方法依赖的package包/类
/**
 * Add [howManyToAdd] instances to a given class [className].
 * Individuals, enumerations (e.g. owl:oneOf)
 *
 * @param className    the class name
 * @param howManyToAdd the count of instances that will be added
 */
public void addInstanceToClass(String className, int howManyToAdd) {
	for (int i = 0; i < GraphStorage.getGraph(viewManagerID).getNodeCount(); i++) {
		Node n = GraphStorage.getGraph(viewManagerID).getNode(i);
		int nameIndex = n.getColumnIndex(ColumnNames.FULL_NAME);
		try {
			String name = (String) n.get(nameIndex);
			if (name.equals(className)) {
				helperIncreaseClassSizeAfterAddingInstances(n, howManyToAdd);
				helperUpdateShortName(n);
			}
		} catch (NullPointerException npe) {
			// no class name? -> nothing to do
			logger.warn("possible mistake found: node without full name");
		}
	}
}
 
开发者ID:VisualDataWeb,项目名称:ProtegeVOWL,代码行数:24,代码来源:GraphDataModifier.java

示例2: removeInstanceFromClass

import prefuse.data.Node; //导入方法依赖的package包/类
/**
 * Removes [howManyToRemove] instances from a given class [classID].
 * Individuals, enumerations (e.g. owl:oneOf)
 *
 * @param id              the id of the class
 * @param howManyToRemove the cound if instances that will be removed
 */
public void removeInstanceFromClass(int id, int howManyToRemove) {
	for (int i = 0; i < GraphStorage.getGraph(viewManagerID).getNodeCount(); i++) {
		Node n = GraphStorage.getGraph(viewManagerID).getNode(i);
		int idIndex = n.getColumnIndex(ColumnNames.ID);
		try {
			int idOfNode = (Integer) n.get(idIndex);
			if (idOfNode == id) {
				// node(class) found
				helperDecreaseClassSizeAfterRemovingInstances(n, howManyToRemove);
				helperUpdateShortName(n);
			}
		} catch (NullPointerException npe) {
			// no class name? -> nothing to do
			logger.warn("possible mistake found: node without an id");
		}
	}
}
 
开发者ID:VisualDataWeb,项目名称:ProtegeVOWL,代码行数:25,代码来源:GraphDataModifier.java

示例3: findClass

import prefuse.data.Node; //导入方法依赖的package包/类
/**
 * Finds a class with a given class name and class type.
 *
 * @param className the class name
 * @param classType the class type
 * @return classID the id of the found class
 */
public int findClass(String className, String classType) {
	for (int i = 0; i < GraphStorage.getGraph(viewManagerID).getNodeCount(); i++) {
		Node n = GraphStorage.getGraph(viewManagerID).getNode(i);
		int nameIndex = n.getColumnIndex(ColumnNames.FULL_NAME);
		int vowlTypeIndex = n.getColumnIndex(ColumnNames.NODE_VOWL_TYPE);
		int idIndex = n.getColumnIndex(ColumnNames.ID);
		try {
			String name = (String) n.get(nameIndex);
			String vowlType = (String) n.get(vowlTypeIndex);
			if (className.equals(name) && classType.equals(vowlType)) {
				return (Integer) n.get(idIndex);
			}
		} catch (NullPointerException npe) {
			// no class name? -> nothing to do
			logger.warn("possible mistake found: node without name or id or vowl type attribute");
			logger.error("findClass SearchCriterias : ClassName: " + className + " ClassType: " + classType);
		}
	}
	return -1;
}
 
开发者ID:VisualDataWeb,项目名称:ProtegeVOWL,代码行数:28,代码来源:GraphDataModifier.java

示例4: findNode

import prefuse.data.Node; //导入方法依赖的package包/类
/**
 * Finds a node with the given id.
 *
 * @param id the id of the node
 * @return the found node or null
 */
public Node findNode(int id) {
	for (int i = 0; i < GraphStorage.getGraph(viewManagerID).getNodeCount(); i++) {
		Node n = GraphStorage.getGraph(viewManagerID).getNode(i);
		int nodeIDIndex = n.getColumnIndex(ColumnNames.ID);
		try {
			int nodeID = (Integer) n.get(nodeIDIndex);
			if (id == nodeID) {
				return n;
			}
		} catch (NullPointerException npe) {
			logger.warn("possible error found: node without id attribute");
		}
	}
	return null;
}
 
开发者ID:VisualDataWeb,项目名称:ProtegeVOWL,代码行数:22,代码来源:GraphDataModifier.java

示例5: helperDecreaseClassSizeAfterRemovingInstances

import prefuse.data.Node; //导入方法依赖的package包/类
/**
 * Decreases the visual size of a node after instances have been removed.
 *
 * @param n               the node
 * @param howManyToRemove the count of instances that will be removed
 */
private void helperDecreaseClassSizeAfterRemovingInstances(Node n, int howManyToRemove) {
	try {
		int instancesIndex = n.getColumnIndex(ColumnNames.CLASS_INSTANCE_COUNT);
		int instanceCount = (Integer) n.get(instancesIndex);
		int heightIndex = n.getColumnIndex(ColumnNames.NODE_HEIGHT);
		int widhtIndex = n.getColumnIndex(ColumnNames.NODE_WIDTH);
		int height = (Integer) n.get(heightIndex);
		int width = (Integer) n.get(widhtIndex);
		instanceCount = instanceCount - howManyToRemove;
		n.set(ColumnNames.CLASS_INSTANCE_COUNT, instanceCount);
		n.set(ColumnNames.NODE_HEIGHT, height - (int) Math.log(CLASS_INSTANCES_STEPS * howManyToRemove));
		n.set(ColumnNames.NODE_WIDTH, width - (int) Math.log(CLASS_INSTANCES_STEPS * howManyToRemove));
	} catch (NullPointerException npe) {
		logger.error("missing important data, wrong class : " + n.toString());
	}
}
 
开发者ID:VisualDataWeb,项目名称:ProtegeVOWL,代码行数:23,代码来源:GraphDataModifier.java

示例6: helperIncreaseClassSizeAfterAddingInstances

import prefuse.data.Node; //导入方法依赖的package包/类
/**
 * Increases the visual size of a node after instances have been removed.
 *
 * @param n            the node
 * @param howManyToAdd the count of instances that will be added
 */
private void helperIncreaseClassSizeAfterAddingInstances(Node n, int howManyToAdd) {
	try {
		int instancesIndex = n.getColumnIndex(ColumnNames.CLASS_INSTANCE_COUNT);
		int instanceCount = (Integer) n.get(instancesIndex);
		int heightIndex = n.getColumnIndex(ColumnNames.NODE_HEIGHT);
		int widhtIndex = n.getColumnIndex(ColumnNames.NODE_WIDTH);
		int height = (Integer) n.get(heightIndex);
		int width = (Integer) n.get(widhtIndex);
		instanceCount = instanceCount + howManyToAdd;
		n.set(ColumnNames.CLASS_INSTANCE_COUNT, instanceCount);
		// n.set(ColumnNames.NODE_HEIGHT, height + (int) Math.log(howManyToAdd * CLASS_INSTANCES_STEPS));
		// n.set(ColumnNames.NODE_WIDTH, width + (int) Math.log(howManyToAdd * CLASS_INSTANCES_STEPS));
		n.set(ColumnNames.NODE_HEIGHT, height + (howManyToAdd * CLASS_INSTANCES_STEPS));
		n.set(ColumnNames.NODE_WIDTH, width + (howManyToAdd * CLASS_INSTANCES_STEPS));
	} catch (NullPointerException npe) {
		logger.error("missing important data, wrong class : " + n.toString());
	}
}
 
开发者ID:VisualDataWeb,项目名称:ProtegeVOWL,代码行数:25,代码来源:GraphDataModifier.java


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