-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUMLGenerator.java
More file actions
54 lines (41 loc) · 1.47 KB
/
UMLGenerator.java
File metadata and controls
54 lines (41 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import net.sourceforge.plantuml.SourceStringReader;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.Collection;
/**
* Created by jhan on 9/28/15.
*/
public class UMLGenerator {
public static void umlGenerator(Collection<String> classStrUML, Collection<String> associationStrUML, Collection<String> extendStrUML, Collection<String> ballsocketStrUML) throws Exception {
OutputStream png = new FileOutputStream("test.png");
String source = "@startuml\n";
source +="title UML Diagram CMPE202\n";
source +="skinparam classAttributeIconSize 0\n";
source +="skinparam usecaseBackgroundColor #A80036\n";
source +="skinparam usecaseBorderColor Transparent\n";
source +="skinparam usecaseFontSize 1\n";
source +="skinparam usecaseFontColor #A80036\n";
for(String item:classStrUML)
{
source += item;
}
for(String item:associationStrUML)
{
source += item;
}
for(String item:extendStrUML)
{
source += item;
}
for(String item: ballsocketStrUML)
{
source += item;
}
source += "@enduml\n";
// System.out.print(source);//print test
SourceStringReader reader = new SourceStringReader(source);
// Write the first image to "png"
String desc = reader.generateImage(png);
// Return a null string if no generation
}
}