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

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

java 1次浏览

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

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

示例1: loadDefaultArdublockProgram

点赞 2

import edu.mit.blocks.renderable.FactoryRenderableBlock; //导入依赖的package包/类
private void loadDefaultArdublockProgram()
{
	/*
	InputStream defaultArdublockProgram = this.getClass().getResourceAsStream(DEFAULT_ARDUBLOCK_PROGRAM_PATH);
	
	final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
       factory.setNamespaceAware(true);
       final DocumentBuilder builder;
       final Document doc;
	try
	{
		builder = factory.newDocumentBuilder();
		doc = builder.parse(defaultArdublockProgram);
		final Element projectRoot = doc.getDocumentElement();
		workspaceController.resetWorkspace();
		workspaceController.loadProjectFromElement(projectRoot);
	}
	catch (ParserConfigurationException e)
	{
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	catch (SAXException e)
	{
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	catch (IllegalArgumentException e)
	{
		// TODO Auto-generated catch block
		e.printStackTrace();
		workspaceController.loadFreshWorkspace();
	}
	catch (IOException e)
	{
		// TODO Auto-generated catch block
		e.printStackTrace();
		workspaceController.loadFreshWorkspace();
	}
       */
	
	Workspace workspace = workspaceController.getWorkspace();
	Page page = workspace.getPageNamed("Main");
	
	FactoryManager manager = workspace.getFactoryManager();
	Block newBlock;
       newBlock = new Block(workspace, "loop", false);
       FactoryRenderableBlock factoryRenderableBlock = new FactoryRenderableBlock(workspace, manager, newBlock.getBlockID());
       RenderableBlock renderableBlock = factoryRenderableBlock.createNewInstance();
       renderableBlock.setLocation(100, 100);
       page.addBlock(renderableBlock);
       
       
}
 

开发者ID:tairo,
项目名称:STEMDu_Ardublock,
代码行数:55,
代码来源:Context.java


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