Please refer to astah* API JavaDoc for details of each Interface and method.
Creating/editing/Deleting diagrams are supported in astah* UML and professional.
public IDiagram createClassDiagram(IModel project, String diagramName) throws InvalidUsingException, ClassNotFoundException { ProjectAccessor projectAccessor = AstahAPI.getAstahAPI().getProjectAccessor(); ClassDiagramEditor cde = projectAccessor.getDiagramEditorFactory().getClassDiagramEditor(); try { TransactionManager.beginTransaction(); IDiagram iClassDiagram = cde.createClassDiagram(project, diagramName); TransactionManager.endTransaction(); return iClassDiagram; } catch (InvalidEditingException e) { e.printStackTrace(); TransactionManager.abortTransaction(); } } |
public void deleteDiagram(IDiagram diagram) throws ClassNotFoundException, InvalidUsingException { ProjectAccessor projectAccessor = AstahAPI.getAstahAPI().getProjectAccessor(); ClassDiagramEditor cde = projectAccessor.getDiagramEditorFactory().getClassDiagramEditor(); try { TransactionManager.beginTransaction(); cde.setDiagram(diagram); cde.deleteDiagram(); TransactionManager.endTransaction(); } catch (InvalidEditingException e) { e.printStackTrace(); TransactionManager.abortTransaction(); } } |
public void deleteDiagram(IDiagram diagram) throws ClassNotFoundException, InvalidUsingException { ProjectAccessor projectAccessor = AstahAPI.getAstahAPI().getProjectAccessor(); ClassDiagramEditor cde = projectAccessor.getDiagramEditorFactory().getClassDiagramEditor(); try { TransactionManager.beginTransaction(); cde.delete(diagram); TransactionManager.endTransaction(); } catch (InvalidEditingException e) { e.printStackTrace(); TransactionManager.abortTransaction(); } } |