• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ObjectType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: actionPerformed

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
	vPathway.resetHighlight();
		for(PathwayElement pe : vPathway.getPathwayModel().getDataObjects()) {
			if(pe.getObjectType() == ObjectType.LINE) {
				Line vl = (Line)vPathway.getPathwayElementView(pe);
				String grs = pe.getStartGraphRef();
				String gre = pe.getEndGraphRef();
				if(grs == null || "".equals(grs)) {
					vl.getStart().highlight();
				}
				if(gre == null || "".equals(gre)) {
					vl.getEnd().highlight();
				}
			}
		}
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:17,代码来源:ViewActions.java


示例2: getVPosition

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
protected Point2D getVPosition() {
	PathwayElement mParent = parent.getPathwayElement();

	Point2D vp = null;
	//Check for mappinfo object, needs a special treatment,
	//since it has no bounds in the model
	if(mParent.getObjectType() == ObjectType.MAPPINFO) {
		Rectangle2D vb = parent.getVBounds();
		double x = rPosition.getX();
		double y = rPosition.getY();
		if(vb.getWidth() != 0) x *= vb.getWidth() / 2;
		if(vb.getHeight() != 0) y *= vb.getHeight() / 2;
		x += vb.getCenterX();
		y += vb.getCenterY();
		vp = new Point2D.Double(x, y);
	} else { //For other objects, use the model bounds
		Point2D mp = mParent.toAbsoluteCoordinate(rPosition);
		vp = new Point2D.Double(vFromM(mp.getX()), vFromM(mp.getY()));
	}
	return vp;
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:22,代码来源:Citation.java


示例3: generateNewIds

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
/**
 * Generate new id's for a bunch of elements to be pasted, but do not actually set them.
 * Instead, store these new ids in a map, so that we can later update
 * both the graphIds and graphReferences,
 * as well as groupIds and groupReferences.
 *
 * idMap and newIds should be an empty map / set.
 * It will be filled by this method.
 */
private void generateNewIds(List<PathwayElement> elements,
		Map<String, String> idmap, Set<String> newids)
{
	for (PathwayElement o : elements)
	{
		String id = o.getGraphId();
		String groupId = o.getGroupId();
		generatePasteId(id, data.getGraphIds(), idmap, newids);
		generatePasteId(groupId, data.getGroupIds(), idmap, newids);

		//For a line, also process the point ids
		if(o.getObjectType() == ObjectType.LINE || o.getObjectType() == ObjectType.GRAPHLINE) {
			for(MPoint mp : o.getMPoints())
				generatePasteId(mp.getGraphId(), data.getGraphIds(), idmap, newids);
			for(MAnchor ma : o.getMAnchors())
				generatePasteId(ma.getGraphId(), data.getGraphIds(), idmap, newids);
		}
	}
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:29,代码来源:VPathway.java


示例4: addElements

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
public PathwayElement[] addElements(Pathway p, double mx, double my) {
			PathwayElement e = PathwayElement.createPathwayElement(ObjectType.SHAPE);
			e.setShapeType(type);
			e.setMCenterX(mx);
			e.setMCenterY(my);
			e.setMWidth(1);
			e.setMHeight(1);
			e.setRotation(0);
			e.setGraphId(p.getUniqueGraphId());
			addElement(e, p);

			//brace
//			gdata.setOrientation(OrientationType.RIGHT);

			return new PathwayElement[] { e };
		}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:17,代码来源:DefaultTemplates.java


示例5: getTopLeftCorner

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
/**
 * Returns the top left corner of the bounding box around the elements
 * @param elements = list of PathwayElement objects
 * @return
 */
private Point2D.Double getTopLeftCorner(List<PathwayElement> elements) {
	
	Rectangle2D vr = null;
	for (PathwayElement o : elements)
	{
		if (o.getObjectType() == ObjectType.INFOBOX) continue;
		if (o.getObjectType() == ObjectType.BIOPAX) continue;
		else {
			if (vr == null) vr = o.getMBounds();
			else vr.add(o.getMBounds());
		}
	}
	
	return new Point2D.Double(vr.getX(), vr.getY());
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:21,代码来源:PathwayImportHandler.java


示例6: getBackpageHTML

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
/**
 * generates html for a given PathwayElement. Combines the base
 * header with fragments from all BackpageHooks into one html String.
 */
public String getBackpageHTML(PathwayElement e)
{
	if (e == null) {
		return "<p>No pathway element is selected.</p>";
	} else if (e.getObjectType() != ObjectType.DATANODE && e.getObjectType() != ObjectType.LINE) {
		return "<p>Backpage is not available for this type of element.<BR>Only DataNodes or Interactions can have a backpage.</p>";
	} else if (e.getDataSource() == null || e.getXref().getId().equals("")) {
		return "<p>There is no annotation for this pathway element defined.</p>";
	}
	StringBuilder builder = new StringBuilder(backpagePanelHeader);
	for (BackpageHook h : hooks)
	{
		builder.append(h.getHtml(e));
	}
	builder.append ("</body></html>");
	return builder.toString();
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:22,代码来源:BackpageTextProvider.java


示例7: usesOldEnsembl

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
private boolean usesOldEnsembl(Pathway pwy)
{
	Organism org = Organism.fromLatinName(pwy.getMappInfo().getOrganism());
	if (!ensSpecies.containsKey(org))
		return false; // this pwy is not one of the species to be converted

	for (PathwayElement elt : pwy.getDataObjects())
	{
		if (elt.getObjectType() == ObjectType.DATANODE &&
				elt.getDataSource() == BioDataSource.ENSEMBL)
		{
			return true;
		}
	}
	return false;
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:17,代码来源:Compat.java


示例8: convertEnsembl

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
/**
 * Ensembl considers each species database as separate,
 * and thus they should have separate system codes as well.
 * This method will convert generic Ensembl datanodes
 * to species specific datanodes if possible.
 */
private void convertEnsembl(Pathway pwy)
{
	Organism org = Organism.fromLatinName(pwy.getMappInfo().getOrganism());
	if (!ensSpecies.containsKey(org))
		return; // this pwy is not one of the species to be converted

	for (PathwayElement elt : pwy.getDataObjects())
	{
		if (elt.getObjectType() == ObjectType.DATANODE &&
				elt.getDataSource() == BioDataSource.ENSEMBL)
		{
			elt.setDataSource (ensSpecies.get (org));
		}
	}

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


示例9: getAnnotationHTML

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
/**
 * generates html for a given PathwayElement. Combines the base header with
 * fragments from all BackpageHooks into one html String.
 */
public String getAnnotationHTML(PathwayElement e) {
	if (e == null) {
		return "<p>No pathway element is selected.</p>";
	} else if (e.getObjectType() != ObjectType.DATANODE
			&& e.getObjectType() != ObjectType.LINE) {
		return "<p>It is currently not possible to annotate this type of pathway element." +
				"<BR>Only DataNodes and Interactions can be annotated.</p>";
	} else if (e.getDataSource() == null || e.getXref().getId().equals("")) {
		return "<p>This pathway element has not yet been annotated.</p>";
	}
	StringBuilder builder = new StringBuilder(backpagePanelHeader);
	for (DataHook h : hooks) {
		builder.append(h.getHtml(e));
	}
	builder.append("</body></html>");
	return builder.toString();
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:22,代码来源:DataPaneTextProvider.java


示例10: convertGpml

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
public static void convertGpml(Pathway p, String wpId, String revision, Model pathwayModel) {
	Resource pathwayRes = PathwayConverter.parsePathwayInfoGpml(p, wpId, revision, pathwayModel);
	DataHandlerGpml data = new DataHandlerGpml(p, pathwayRes);
	
	for(PathwayElement e : p.getDataObjects()) {
		if(e.getObjectType().equals(ObjectType.DATANODE)) {
			DataNodeConverter.parseDataNodesGpml(e, pathwayModel, data);
		} else if(e.getObjectType().equals(ObjectType.STATE)) {
			StateConverter.parseStateGpml(e, pathwayModel, data);
		} else if(e.getObjectType().equals(ObjectType.LINE)) {
			InteractionConverter.parseInteractionGpml((MLine) e, pathwayModel, data);
		} else if(e.getObjectType().equals(ObjectType.GRAPHLINE)) {
			GraphicalLineConverter.parseInteractionGpml((MLine) e, pathwayModel, data);
		} else if(e.getObjectType().equals(ObjectType.LABEL)) {
			LabelConverter.parseLabelGpml(e, pathwayModel, data);
		} else if(e.getObjectType().equals(ObjectType.SHAPE)) {
			ShapeConverter.parseShapeGpml(e, pathwayModel, data);
		} else if(e.getObjectType().equals(ObjectType.GROUP)) {
			GroupConverter.parseGroupGpml((MGroup) e, pathwayModel, data);
		} else if(e.getObjectType().equals(ObjectType.INFOBOX)) {
			InfoBoxConverter.parseInfoBoxGpml(e, pathwayModel, data);
		}
	}
}
 
开发者ID:wikipathways,项目名称:GPML2RDF,代码行数:25,代码来源:GpmlConverter.java


示例11: test

import org.pathvisio.core.model.ObjectType; //导入依赖的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


示例12: scanPathway

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
protected Result scanPathway(File pathwayFile) throws BotException {
	try {
		ConnectorBotResult report = new ConnectorBotResult(
				getCache().getPathwayInfo(pathwayFile));
		Pathway pathway = new Pathway();
		pathway.readFromXml(pathwayFile, true);

		String orgName = pathway.getMappInfo().getOrganism();
		Organism org = Organism.fromLatinName(orgName);
		if(org == null) org = Organism.fromShortName(orgName);

		for(PathwayElement pwe : pathway.getDataObjects()) {
			if(pwe.getObjectType() == ObjectType.LINE) {
				boolean valid =
					pwe.getMStart().isLinked() &&
					pwe.getMEnd().isLinked();

				report.addLine(pwe, valid);
			}
		}

		return report;
	} catch(Exception e) {
		throw new BotException(e);
	}
}
 
开发者ID:wikipathways,项目名称:org.wikipathways.client,代码行数:27,代码来源:ConnectorBot.java


示例13: BiopaxElement

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
/**
 * Constructor for this class. Builds a map of all biopax
 * elements and their references
 */
public BiopaxElement()
{
	super(ObjectType.BIOPAX);
	biopax = new HashMap<String, BiopaxNode>();
	ordinal = new HashMap<Class<? extends BiopaxNode>, Map<String, Integer>>();
	refresh();
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:12,代码来源:BiopaxElement.java


示例14: selectObjectsByObjectType

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
public void selectObjectsByObjectType(ObjectType ot) {
	clearSelection();
	selection.startSelecting();
	for(PathwayElement pe : getPathwayModel().getDataObjects()) {
		if(pe.getObjectType() == ot) {
			selection.addToSelection(getPathwayElementView(pe));
		}
	}
	selection.stopSelecting();
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:11,代码来源:VPathway.java


示例15: addElement

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
Set<PathwayElement> addElement(PathwayElement pwe, Set<PathwayElement> set) {
	Set<PathwayElement> added = new HashSet<PathwayElement>();
	
	if(pwe != null) {
		//If it's a group, add all subelements
		if(pwe.getObjectType() == ObjectType.GROUP) {
			for(PathwayElement ge : pwe.getParent().getGroupElements(pwe.getGroupId())) {
				added.addAll(addElement(ge, set));
			}
		}
		set.add(pwe);
		added.add(pwe);
	}
	return added;
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:16,代码来源:Relation.java


示例16: doHighlight

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
/**
 * Highlight all object but DataNodes and Groups. Only the first color
 * from the hashmap will be used.
 */
private void doHighlight() {
	for(VPathwayElement vpe : vPathway.getDrawingObjects()) {
		if(vpe instanceof Graphics) {
			PathwayElement pwe = ((Graphics)vpe).getPathwayElement();
			List<Color> elmColors = colors.get(pwe);
			if(elmColors != null && elmColors.size() > 0) {
				ObjectType ot = pwe.getObjectType();
				if(ot != ObjectType.DATANODE && ot != ObjectType.GROUP) {
					vpe.highlight(elmColors.get(0));
				}
			}
		}
	}
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:19,代码来源:ColorExporter.java


示例17: pathwayFromTransferable

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
/**
 * Creates a pathway from the data in the provided {@link Transferable}.
 * @param t
 * @return
 * @throws ConverterException
 * @throws MalformedURLException
 * @throws UnsupportedFlavorException
 * @throws IOException
 */
public static Pathway pathwayFromTransferable(Transferable t) throws ConverterException, MalformedURLException, UnsupportedFlavorException, IOException {
	Pathway pnew = new Pathway();

	String xml = getText(t);
	if(xml != null) {
		GpmlFormat.readFromXml(pnew, new StringReader(xml), true);

		List<PathwayElement> elements = new ArrayList<PathwayElement>();
		for(PathwayElement elm : pnew.getDataObjects()) {
			if(elm.getObjectType() != ObjectType.MAPPINFO) {
				elements.add(elm);
			} else {
				//Only add mappinfo if it's not generated by the transferable
				String source = elm.getMapInfoDataSource();
				if(!PathwayTransferable.INFO_DATASOURCE.equals(source)) {
					elements.add(elm);
				}
			}
		}
		return pnew;
	}

	URL url = getFileURL(t);
	if(url != null) {
		File file = new File(url.getFile());
		pnew.readFromXml(file, true);
		return pnew;
	}
	return null;
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:40,代码来源:PathwayTransferable.java


示例18: setUp

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
public void setUp()
{
	data = new Pathway();
	PathwayElement o = PathwayElement.createPathwayElement(ObjectType.DATANODE);
	data.add (o);

	elementManager = data.getBiopax();
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:9,代码来源:Test.java


示例19: testEmpty

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
public void testEmpty()
{
	data = new Pathway();
	PathwayElement o = PathwayElement.createPathwayElement(ObjectType.DATANODE);
	data.add (o);
	elementManager = data.getBiopax();

	assertNotNull (elementManager);
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:10,代码来源:Test.java


示例20: setUp

import org.pathvisio.core.model.ObjectType; //导入依赖的package包/类
public void setUp()
{
	PreferenceManager.init();
	vpwy = new VPathway(null);
	pwy = new Pathway();
	vpwy.fromModel(pwy);

	for (int i = 0; i < DATANODE_COUNT; ++i)
	{
		dn[i] = PathwayElement.createPathwayElement(ObjectType.DATANODE);
		dn[i].setMCenterX(i * 1000);
		dn[i].setMCenterY(3000);
		dn[i].setMWidth(500);
		dn[i].setMHeight(500);
		vDn[i] = (GeneProduct)addElement (vpwy, dn[i]);
		dn[i].setGeneratedGraphId();
	}
	vLn[0] = (Line)addConnector (vpwy, dn[0], dn[1]);
	vLn[1] = (Line)addConnector (vpwy, dn[0], dn[2]);

	vpwy.clearSelection();
	assertNull (dn[0].getGroupRef());
	assertNull (dn[1].getGroupRef());
	vDn[0].select();
	vDn[1].select();
	vLn[0].select();
	// create a group
	vpwy.toggleGroup(vpwy.getSelectedGraphics());
	String ref1 = dn[0].getGroupRef();
	assertNotNull(ref1);
	assertEquals (ref1, dn[1].getGroupRef());
	grp1 = vpwy.getPathwayModel().getGroupById(ref1);
	vGrp1 = (Group)vpwy.getPathwayElementView(grp1);
	grp1.setGeneratedGraphId();
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:36,代码来源:TestGroups.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ToNativeContext类代码示例发布时间:2022-05-22
下一篇:
Java JIArray类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap