Skip to content

Commit 0be71e6

Browse files
committed
add (M)record shape with javadoc link to Records.java
Signed-off-by: Stefan Niederhauser <[email protected]>
1 parent 6303fc3 commit 0be71e6

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

graphviz-java/src/main/java/guru/nidi/graphviz/attribute/Records.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public final class Records {
2222
private static final String
2323
SHAPE = "shape",
2424
RECORD = "record",
25+
M_RECORD = "Mrecord",
2526
LABEL = "label";
2627

2728
private Records() {
@@ -32,15 +33,15 @@ public static Attributes<ForNode> label(String label) {
3233
}
3334

3435
public static Attributes<ForNode> mLabel(String label) {
35-
return attrs(attr(SHAPE, "Mrecord"), attr(LABEL, label));
36+
return attrs(attr(SHAPE, M_RECORD), attr(LABEL, label));
3637
}
3738

3839
public static Attributes<ForNode> of(String... recs) {
3940
return attrs(attr(SHAPE, RECORD), attr(LABEL, String.join("|", recs)));
4041
}
4142

4243
public static Attributes<ForNode> mOf(String... recs) {
43-
return attrs(attr(SHAPE, "Mrecord"), attr(LABEL, String.join("|", recs)));
44+
return attrs(attr(SHAPE, M_RECORD), attr(LABEL, String.join("|", recs)));
4445
}
4546

4647
public static String rec(String tag, String label) {

graphviz-java/src/main/java/guru/nidi/graphviz/attribute/Shape.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
public final class Shape extends SingleAttributes<String, ForNode> {
2323
private static final String SHAPE = "shape";
2424

25+
/**
26+
* Records are better supported by the {@link Records} class.
27+
*/
28+
public static final Shape
29+
RECORD = new Shape("record"),
30+
M_RECORD = new Shape("Mrecord");
31+
2532
public static final Shape
2633
BOX = new Shape("box"),
2734
ELLIPSE = new Shape("ellipse"),
@@ -48,7 +55,6 @@ public final class Shape extends SingleAttributes<String, ForNode> {
4855
INV_HOUSE = new Shape("invhouse"),
4956
M_DIAMOND = new Shape("Mdiamond"),
5057
M_SQUARE = new Shape("Msquare"),
51-
M_RECORD = new Shape("Mrecord"),
5258
M_CIRCLE = new Shape("Mcircle"),
5359
RECT = new Shape("rect"),
5460
RECTANGLE = new Shape("rectangle"),

0 commit comments

Comments
 (0)