private ZNode createNewZNode(Point point, ZNodeType type, String name) { if (name == null) { return null; } final Point2D.Float zp = translateToZNodePoint(point); final ZNode zNode = new ZNode(zp.x, zp.y, name.trim()); zNode.setNodeType(type); zNode.setParentFile(selectedNode.getParentFile()); if (type == ZNodeType.DEPENDENCY) { zNode.setCode(asList("artifactId=" + name, "groupId=" + name)); } synchronized (zNodes) { zNodes.add(zNode); } if (type == ZNodeType.METHOD) { zNode.setParentFile( new File( selectedNode.getParentFile(), selectedNode.getName() + "." + selectedNode.getExtension())); int end = selectedNode.getEndLineNumber(apiFactory.getLanguageParser()); for (ZNode method : selectedNode.getSubmodules()) { end += method.getCodeLineSize(); } zNode.setExtension(String.valueOf(end)); System.err.println("ext=" + zNode.getExtension()); } else if (type == ZNodeType.CALLEE) { selectedNode.addCodeLine(zNode.getName()); } new ZCodeSaver(apiFactory).save(zNode); return zNode; }
public void compile(ZNode zNode) { // TODO do something with errors apiFactory .getCompiler() .compile( zNode, new ProgressListener() { @Override public void update(int progress) { mon.setProgress(progress); } }); mon.setProgress(100); }