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


Java MLine.getMPoints方法代码示例

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


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

示例1: addWaypoint

import org.pathvisio.core.model.MLine; //导入方法依赖的package包/类
private void addWaypoint(FreeConnectorShape s, MLine l) {
	//TODO: It would be nice to have access to the mouse position here, so
	//we can add the waypoint to where the user clicked
	//Point2D mp = new Point2D.Double(vPathway.mFromV(p.getX()), vPathway.mFromV(p.getY()));
	//WayPoint nwp = new WayPoint(mp);
	//double c = s.toLineCoordinate(p);
	
	//We don't have the mouse position, just add the waypoint in the center
	//with an offset if needed
	List<MPoint> oldPoints = l.getMPoints();
	List<MPoint> newPoints = new ArrayList<MPoint>(oldPoints);
	
	int i = oldPoints.size() - 1; //MPoints size always >= 2
	MPoint mp = oldPoints.get(i);
	MPoint mp2 = oldPoints.get(i - 1);
	double mc = s.toLineCoordinate(mp.toPoint2D());
	double mc2 = s.toLineCoordinate(mp2.toPoint2D());
	double c = mc2 + (mc - mc2) / 2.0; //Add new waypoint on center of last segment
	Point2D p = s.fromLineCoordinate(c);
	newPoints.add(i, l.new MPoint(p.getX(), p.getY()));
	l.setMPoints(newPoints);
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:23,代码来源:ViewActions.java

示例2: removeWaypoint

import org.pathvisio.core.model.MLine; //导入方法依赖的package包/类
private void removeWaypoint(MLine l) {
	//TODO: Instead of removing the last point, it would be better to adjust the context
	//menu to remove a specific point (like with anchors). This could be done by making 
	//VPoint extend VPathwayElement so we can directly get the selected waypoint here.
	List<MPoint> newPoints = new ArrayList<MPoint>(l.getMPoints());
	newPoints.remove(newPoints.size() - 2);
	l.setMPoints(newPoints);
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:9,代码来源:ViewActions.java

示例3: parseInteractionGpml

import org.pathvisio.core.model.MLine; //导入方法依赖的package包/类
/**
 * conversion only GPML vocabulary
 */
public static void parseInteractionGpml(MLine e, Model model, DataHandlerGpml data) {
	Resource intRes = model.createResource(data.getPathwayRes().getURI() + "/Interaction/" + e.getGraphId());
	
	intRes.addProperty(RDF.type, Gpml.INTERACTION);
	data.getPathwayRes().addProperty(Gpml.HAS_INTERACTION, intRes);
	intRes.addProperty(DCTerms.isPartOf, data.getPathwayRes());
	
	intRes.addLiteral(Gpml.LINE_THICKNESS, e.getLineThickness());
	intRes.addLiteral(Gpml.GRAPH_ID, e.getGraphId());
	intRes.addLiteral(Gpml.COLOR, Utils.colorToHex(e.getColor()));
	intRes.addLiteral(Gpml.LINE_STYLE, e.getLineStyle() != LineStyle.DASHED ? "Solid" : "Broken");
	intRes.addLiteral(Gpml.ZORDER, e.getZOrder());
	intRes.addLiteral(Gpml.CONNECTOR_TYPE, e.getConnectorType().getName());
	
	if(e.getXref() != null && e.getXref().getId() != null && e.getXref().getDataSource() != null) {
		intRes.addLiteral(Gpml.XREF_ID, e.getXref().getId());
		intRes.addLiteral(Gpml.XREF_DATASOURCE, e.getXref().getDataSource().getFullName());
	}
	
	if(e.getGroupRef() != null) intRes.addLiteral(Gpml.GROUP_REF, e.getGroupRef());
	
	// TODO: in schema there is an interaction type but that's not in the data model. 
	
	for(MAnchor a : e.getMAnchors()) {
		if(a.getGraphId() != null) AnchorConverter.parseAnchorGpml(a, model, intRes, data);
	}
	
	for(MPoint p : e.getMPoints()) {
		if(p.equals(e.getStartPoint())) {
			PointConverter.parsePointGpml(p, model, intRes, data, e.getStartLineType().getName());
		} else if (p.equals(e.getEndPoint())) {
			PointConverter.parsePointGpml(p, model, intRes, data, e.getEndLineType().getName());
		} else {
			PointConverter.parsePointGpml(p, model, intRes, data, null);
		}
	}

	for(String s : e.getBiopaxRefs()) {
		intRes.addLiteral(Gpml.BIOPAX_REF, s);
	}
	
	for(Comment c : e.getComments()) {
		CommentConverter.parseCommentGpml(c, model, intRes, data);
	}
	
	for(PublicationXref xref : e.getBiopaxReferenceManager().getPublicationXRefs()) {
		PublicationXrefConverter.parsePublicationXrefGpml(xref, intRes, model, data);
	}
		
	data.getPathwayElements().put(e, intRes);
}
 
开发者ID:wikipathways,项目名称:GPML2RDF,代码行数:55,代码来源:InteractionConverter.java

示例4: parseInteractionGpml

import org.pathvisio.core.model.MLine; //导入方法依赖的package包/类
/**
 * conversion only GPML vocabulary
 */
public static void parseInteractionGpml(MLine e, Model model, DataHandlerGpml data) {
	Resource intRes = model.createResource(data.getPathwayRes().getURI() + "/GraphicalLine/" + e.getGraphId());
	
	intRes.addProperty(RDF.type, Gpml.GRAPHICAL_LINE);
	data.getPathwayRes().addProperty(Gpml.HAS_GRAPHICAL_LINE, intRes);
	intRes.addProperty(DCTerms.isPartOf, data.getPathwayRes());
	
	intRes.addLiteral(Gpml.LINE_THICKNESS, e.getLineThickness());
	intRes.addLiteral(Gpml.GRAPH_ID, e.getGraphId());
	intRes.addLiteral(Gpml.COLOR, Utils.colorToHex(e.getColor()));
	intRes.addLiteral(Gpml.LINE_STYLE, e.getLineStyle() != LineStyle.DASHED ? "Solid" : "Broken");
	intRes.addLiteral(Gpml.ZORDER, e.getZOrder());
	intRes.addLiteral(Gpml.CONNECTOR_TYPE, e.getConnectorType().getName());
	
	if(e.getGroupRef() != null) intRes.addLiteral(Gpml.GROUP_REF, e.getGroupRef());
	
	// TODO: in schema there is an interaction type but that's not in the data model. 
	
	for(MAnchor a : e.getMAnchors()) {
		if(a.getGraphId() != null) AnchorConverter.parseAnchorGpml(a, model, intRes, data);
	}
	
	for(MPoint p : e.getMPoints()) {
		if(p.equals(e.getStartPoint())) {
			PointConverter.parsePointGpml(p, model, intRes, data, e.getStartLineType().getName());
		} else if (p.equals(e.getEndPoint())) {
			PointConverter.parsePointGpml(p, model, intRes, data, e.getEndLineType().getName());
		} else {
			PointConverter.parsePointGpml(p, model, intRes, data, null);
		}
	}

	for(String s : e.getBiopaxRefs()) {
		intRes.addLiteral(Gpml.BIOPAX_REF, s);
	}
	
	for(Comment c : e.getComments()) {
		CommentConverter.parseCommentGpml(c, model, intRes, data);
	}
	
	for(PublicationXref xref : e.getBiopaxReferenceManager().getPublicationXRefs()) {
		PublicationXrefConverter.parsePublicationXrefGpml(xref, intRes, model, data);
	}
		
	data.getPathwayElements().put(e, intRes);
}
 
开发者ID:wikipathways,项目名称:GPML2RDF,代码行数:50,代码来源:GraphicalLineConverter.java


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