Skip to content

Commit

Permalink
Add support for more common commands in Chen EER diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-Davies committed Apr 15, 2024
1 parent 91e87b9 commit 494c0c9
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import net.sourceforge.plantuml.cheneer.command.CommandMultiSubclass;
import net.sourceforge.plantuml.cheneer.command.CommandSimpleSubclass;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandRankDir;
import net.sourceforge.plantuml.command.CommonCommands;
import net.sourceforge.plantuml.command.PSystemCommandFactory;
import net.sourceforge.plantuml.core.DiagramType;
Expand All @@ -59,8 +60,8 @@ public ChenEerDiagramFactory() {

@Override
protected void initCommandsList(List<Command> cmds) {
CommonCommands.addTitleCommands(cmds);
CommonCommands.addCommonCommands2(cmds);
CommonCommands.addCommonCommands1(cmds);
cmds.add(new CommandRankDir());

cmds.add(new CommandCreateEntity());
cmds.add(new CommandCreateAttribute());
Expand Down
38 changes: 38 additions & 0 deletions test/nonreg/simple/ChenRankDir_Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package nonreg.simple;

import java.io.IOException;

import org.junit.jupiter.api.Test;

import nonreg.BasicTest;

/*
Test diagram MUST be put between triple quotes
"""
@startchen
left to right direction
entity Person {
}
entity Location {
}
relationship Birthplace {
}
Person -N- Birthplace
Birthplace -1- Location
@endchen
"""
*/
public class ChenRankDir_Test extends BasicTest {

@Test
void testSimple() throws IOException {
checkImage("(3 entities)");
}

}
119 changes: 119 additions & 0 deletions test/nonreg/simple/ChenRankDir_TestResult.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
package nonreg.simple;

public class ChenRankDir_TestResult {
}
/*
"""
DPI: 96
dimension: [ 644.3264 ; 111.8193 ]
scaleFactor: 1.0000
seed: -4308824771398432496
svgLinkTarget: _top
hoverPathColorRGB: null
preserveAspectRatio: none
RECTANGLE:
pt1: [ 6.0000 ; 42.0000 ]
pt2: [ 119.9805 ; 76.0000 ]
xCorner: 0
yCorner: 0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Person
position: [ 16.0000 ; 62.8889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
RECTANGLE:
pt1: [ 480.0000 ; 42.0000 ]
pt2: [ 639.3264 ; 76.0000 ]
xCorner: 0
yCorner: 0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Location
position: [ 490.0000 ; 62.8889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
POLYGON:
points:
- [ 206.0000 ; 58.9096 ]
- [ 299.8193 ; 12.0000 ]
- [ 393.6386 ; 58.9096 ]
- [ 299.8193 ; 105.8193 ]
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Birthplace
position: [ 231.1803 ; 62.7985 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 114.2884 ; 53.0000 ]
- type: SEG_CUBICTO
pt1: [ 139.8162 ; 53.0000 ]
pt2: [ 170.6921 ; 53.0000 ]
pt3: [ 199.5468 ; 53.0000 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
EMPTY:
pt1: [ 157.0000 ; 46.0000 ]
pt2: [ 169.5088 ; 59.0000 ]
TEXT:
text: N
position: [ 158.0000 ; 55.5556 ]
orientation: 0
font: SansSerif.plain/11 []
color: ff000000
extendedColor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 388.3275 ; 53.0000 ]
- type: SEG_CUBICTO
pt1: [ 416.3938 ; 53.0000 ]
pt2: [ 446.8953 ; 53.0000 ]
pt3: [ 473.9060 ; 53.0000 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
EMPTY:
pt1: [ 431.0000 ; 46.0000 ]
pt2: [ 443.3969 ; 59.0000 ]
TEXT:
text: 1
position: [ 432.0000 ; 55.5556 ]
orientation: 0
font: SansSerif.plain/11 []
color: ff000000
extendedColor: NULL_COLOR
"""
*/

0 comments on commit 494c0c9

Please sign in to comment.