• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DataNodeType类的典型用法和代码示例

java 1次浏览

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

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

示例1: addElements

点赞 3

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
public PathwayElement[] addElements(Pathway p, double mx, double my) {
	//Add two datanodes, connected by a line
	Template dnt = new DataNodeTemplate(DataNodeType.GENEPRODUCT);
	lastStartNode = dnt.addElements(p, mx, my)[0];

	lastStartNode.setInitialSize();

	lastEndNode = dnt.addElements(p, mx + 2 * lastStartNode.getMWidth(), my)[0];

	lastEndNode.setInitialSize();

	Template lnt = new LineTemplate("defaultline", lineStyle, startType, endType, ConnectorType.STRAIGHT);
	lastLine = lnt.addElements(p, mx, my)[0];
	lastLine.getMStart().linkTo(lastStartNode, 1, 0);
	lastLine.getMEnd().linkTo(lastEndNode, -1, 0);

	return new PathwayElement[] { lastLine, lastStartNode, lastEndNode };
}
 

开发者ID:PathVisio,
项目名称:pathvisio,
代码行数:19,
代码来源:DefaultTemplates.java

示例2: applyAutoFill

点赞 3

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
private void applyAutoFill(XrefWithSymbol ref)
{
	String sym = ref.getSymbol();
	if (sym == null || sym.equals ("")) sym = ref.getId();
	symText.setText(sym);
	idText.setText(ref.getId());
	String type = ref.getDataSource().getType();
	if ("metabolite".equals(type))
		typeCombo.setSelectedItem(DataNodeType.METABOLITE);
	else if ("gene".equals(type))
		typeCombo.setSelectedItem(DataNodeType.GENEPRODUCT);
	else if ("protein".equals(type))
		typeCombo.setSelectedItem(DataNodeType.PROTEIN);
	else if ("pathway".equals(type))
		typeCombo.setSelectedItem(DataNodeType.PATHWAY);
	dsm.setSelectedItem(ref.getDataSource());
}
 

开发者ID:PathVisio,
项目名称:pathvisio,
代码行数:18,
代码来源:DataNodeDialog.java

示例3: test

点赞 3

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
@Test
public void test() throws ConverterException, IOException {
	client.login(props.getProperty("username"), props.getProperty("password"));
	
	String id = "WP4";
	WSPathway p = client.getPathway(id);
	Pathway pathway = new Pathway();
	pathway.readFromXml(IOUtils.toInputStream(p.getGpml(), "UTF-8"), true);
	
	PathwayElement pel = PathwayElement.createPathwayElement(ObjectType.DATANODE);
	pel.setGraphId(pathway.getUniqueGraphId());
	pel.setDataNodeType(DataNodeType.GENEPRODUCT);
	pel.setMCenterX(65);
	pel.setMCenterY(65);
	pel.setMHeight(20);
	pel.setMWidth(80);
	pel.setTextLabel("Test");
	pel.setElementID("12334");
	
	pathway.add(pel);
	
	String newRevision = client.updatePathway(p.getId(), pathway, "add data node test", Integer.parseInt(p.getRevision()));
	assertTrue(Integer.parseInt(newRevision) > Integer.parseInt(p.getRevision()));
}
 

开发者ID:wikipathways,
项目名称:wikipathways-api-client-java
代码行数:25,
代码来源:TestUpdatePathway.java

示例4: refresh

点赞 2

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
public void refresh() {
	super.refresh();
	symText.setText(getInput().getTextLabel());
	idText.setText(getInput().getElementID());
	dsm.setSelectedItem(input.getDataSource());
	String dnType = getInput().getDataNodeType();
	typeCombo.setSelectedItem(DataNodeType.byName(dnType));
	String[] dsType = null; // null is default: no filtering
	if (DataSourceHandler.DSTYPE_BY_DNTYPE.containsKey(dnType)) dsType = 
		DataSourceHandler.DSTYPE_BY_DNTYPE.get(dnType);
	dsm.setTypeFilter(dsType);
	pack();
}
 

开发者ID:PathVisio,
项目名称:pathvisio,
代码行数:14,
代码来源:DataNodeDialog.java

示例5: actionPerformed

点赞 2

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent arg0) {
	if (element instanceof GeneProduct) {
		PathwayElement orig = element.getPathwayElement();
		PathwayElement elt = PathwayElement.createPathwayElement(ObjectType.DATANODE);
		
		for (Object key : orig.getPropertyKeys()) {
			if (elt.getPropertyKeys().contains(key))
				elt.setPropertyEx(key, orig.getPropertyEx(key));
		}
		VPathway vPathway = element.getDrawing();
		Pathway pwy = vPathway.getPathwayModel();
		elt.setDataNodeType(dnType);
		if(dnType.equals(DataNodeType.PATHWAY)) {
			elt.setColor(DefaultTemplates.COLOR_PATHWAY);
			elt.setBold(true);
		} else if (dnType.equals(DataNodeType.METABOLITE)) {
			elt.setColor(DefaultTemplates.COLOR_METABOLITE);
		} else {
			elt.setColor(Color.BLACK);
		}

		elt.setShapeType(ShapeType.RECTANGLE);
		elt.setGraphId(pwy.getUniqueGraphId());

		vPathway.getUndoManager().newAction("Change element type");
		pwy.add(elt);
		for (GraphRefContainer r : pwy.getReferringObjects(orig.getGraphId())) {
			r.linkTo(elt, r.getRelX(), r.getRelY());
		}
		vPathway.removeDrawingObjects(Arrays.asList((VPathwayElement)element), true);
		
	}
}
 

开发者ID:PathVisio,
项目名称:org.pathvisio.typeconverter,
代码行数:35,
代码来源:DataNodeToDataNode.java

示例6: actionPerformed

点赞 2

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent arg0) {
	if (element instanceof Label) {
		PathwayElement orig = ((Label) element).getPathwayElement();
		PathwayElement elt = PathwayElement.createPathwayElement(ObjectType.DATANODE);
		
		for (Object key : orig.getPropertyKeys()) {
			if (elt.getPropertyKeys().contains(key))
				elt.setPropertyEx(key, orig.getPropertyEx(key));
		}
		VPathway vPathway = element.getDrawing();
		Pathway pwy = vPathway.getPathwayModel();
		elt.setDataNodeType(dnType);
		if(dnType.equals(DataNodeType.PATHWAY)) {
			elt.setColor(DefaultTemplates.COLOR_PATHWAY);
			elt.setBold(true);
		} else if (dnType.equals(DataNodeType.METABOLITE)) {
			elt.setColor(DefaultTemplates.COLOR_METABOLITE);
		} 

		elt.setShapeType(ShapeType.RECTANGLE);
		elt.setGraphId(pwy.getUniqueGraphId());

		vPathway.getUndoManager().newAction("Change element type");
		pwy.add(elt);
		for (GraphRefContainer r : pwy.getReferringObjects(orig.getGraphId())) {
			r.linkTo(elt, r.getRelX(), r.getRelY());
		}
		vPathway.removeDrawingObjects(Arrays.asList((VPathwayElement)element), true);
	}
}
 

开发者ID:PathVisio,
项目名称:org.pathvisio.typeconverter,
代码行数:32,
代码来源:LabelToDataNode.java

示例7: DataNodeTemplate

点赞 2

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
public DataNodeTemplate(DataNodeType type) {
	this.type = type;
}
 

开发者ID:PathVisio,
项目名称:pathvisio,
代码行数:4,
代码来源:DefaultTemplates.java

示例8: actionPerformed

点赞 2

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent arg0) {
	if (element instanceof GeneProduct) {
		PathwayElement orig = ((GeneProduct) element).getPathwayElement();
		PathwayElement elt = PathwayElement.createPathwayElement(ObjectType.LABEL);
		boolean convert = true;
		for (Object key : orig.getPropertyKeys()) {
			if (key.toString().equals("GENEID") && (!orig.getPropertyEx(key).equals(""))){
					int dialogButton = JOptionPane.YES_NO_OPTION;
					int dialogResult = JOptionPane.showConfirmDialog(null,
							"During the convertion, you will lose your identifier annotation.\n"
							+ "Are you sure you want to continue?",
							"Confirm",
							dialogButton);
					if(dialogResult!=0)
						convert = false;	
			}
			if (elt.getPropertyKeys().contains(key))
				elt.setPropertyEx(key, orig.getPropertyEx(key));
		}
		if (convert){
			VPathway vPathway = element.getDrawing();
			Pathway pwy = vPathway.getPathwayModel();

			elt.setGraphId(pwy.getUniqueGraphId());

			if(orig.getDataNodeType().equals(DataNodeType.PATHWAY.toString())) {
				elt.setColor(Color.BLACK);
				elt.setBold(false);
			} else if (orig.getDataNodeType().equals(DataNodeType.METABOLITE.toString())) {
				elt.setColor(Color.BLACK);
			} 

			elt.setShapeType(ShapeType.RECTANGLE);
			elt.setGraphId(pwy.getUniqueGraphId());

			vPathway.getUndoManager().newAction("Change element type");
			pwy.add(elt);
			for (GraphRefContainer r : pwy.getReferringObjects(orig.getGraphId())) {
				r.linkTo(elt, r.getRelX(), r.getRelY());
			}
			vPathway.removeDrawingObjects(Arrays.asList((VPathwayElement)element), true);
		}
	}
}
 

开发者ID:PathVisio,
项目名称:org.pathvisio.typeconverter,
代码行数:46,
代码来源:DataNodeToLabel.java

示例9: DataNodeToDataNode

点赞 2

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
public DataNodeToDataNode(Graphics element, DataNodeType dnType) {
	putValue(NAME, element.getPathwayElement().getDataNodeType() + " to " + dnType);
	this.element = element;
	this.dnType = dnType;
}
 

开发者ID:PathVisio,
项目名称:org.pathvisio.typeconverter,
代码行数:6,
代码来源:DataNodeToDataNode.java

示例10: LabelToDataNode

点赞 2

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
public LabelToDataNode(Graphics element, DataNodeType dnType) {
	putValue(NAME, "Label to " + dnType);
	this.element = element;
	this.dnType = dnType;
}
 

开发者ID:PathVisio,
项目名称:org.pathvisio.typeconverter,
代码行数:6,
代码来源:LabelToDataNode.java

示例11: drawComplexMembers

点赞 2

import org.pathvisio.core.model.DataNodeType; //导入依赖的package包/类
private void drawComplexMembers(ArrayList<String> complexComponentIDString,
		String parentComplexId, boolean isComplex) {
	GKInstance inst;
	try {
		// Creating Group Element for grouping complex components
		parentComplex = PathwayElement
				.createPathwayElement(ObjectType.GROUP);

		gpmlpathway.add(parentComplex);
		parentComplex.setGeneratedGraphId();
		parentComplex.setGroupId(gpmlpathway.getUniqueGroupId());
		if (isComplex) {
			parentComplex.setGroupStyle(GroupStyle.COMPLEX);
		} else {
			parentComplex.setGroupStyle(GroupStyle.NONE);
		}

		for (int count = 0; count < complexComponentIDString.size(); count++) {

			String identifier = complexComponentIDString.get(count);
			// System.out.println(identifier);
			inst = dbAdaptor.fetchInstance(Long.parseLong(identifier));
			pwyelement = PathwayElement
					.createPathwayElement(ObjectType.DATANODE);
			String nodeType = parseIdentifier(inst.getExtendedDisplayName())[0];

			// System.out.println("members : " + nodeType);

			if (nodeType.equalsIgnoreCase("EntityWithAccessionedSequence")) {
				pwyelement.setDataNodeType(DataNodeType.PROTEIN);
			} else if (nodeType.equalsIgnoreCase("SimpleEntity")) {
				pwyelement.setDataNodeType(DataNodeType.METABOLITE);
				pwyelement.setColor(Color.BLUE);
			}

			parentComplex.setDynamicProperty(COMPLEX_ID, parentComplexId);

			gpmlpathway.add(pwyelement);
			pwyelement.setGeneratedGraphId();
			pwyelement
					.setTextLabel(parseLocation(inst.getDisplayName())[0]);
			pwyelement.setGroupRef(parentComplex.getGroupId());
			/*
			 * Adding Dynamic properties COMPLEX_ID : for connecting complex
			 * and components COPIES_NUM : for counting copies of a complex
			 * component LOCATION : for cellular location
			 */
			pwyelement.setDynamicProperty(COMPLEX_ID,
					parentComplex.getDynamicProperty(COMPLEX_ID));
			pwyelement.setDynamicProperty(COPIES_NUM,
					String.valueOf(complexComponentIDMap.get(identifier)));
			pwyelement.setDynamicProperty(LOCATION,
					(parseLocation(inst.getDisplayName())[1]));

			addXref(pwyelement, Long.parseLong(identifier), inst);
			addComments(inst, pwyelement, false, false);
			addLitRef(inst, pwyelement);
			pwyEleList.add(pwyelement);
		}
	} catch (Exception e) {
		e.printStackTrace();
	}

}
 

开发者ID:wikipathways,
项目名称:reactome2gpml-converter,
代码行数:65,
代码来源:ReactometoGPML2013.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)