• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LearnLib / automatalib / 13138848026

04 Feb 2025 02:53PM UTC coverage: 92.108% (+2.2%) from 89.877%
13138848026

push

github

mtf90
[maven-release-plugin] prepare release automatalib-0.12.0

16609 of 18032 relevant lines covered (92.11%)

1.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

16.67
/api/src/main/java/net/automatalib/visualization/VisualizationHelper.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of AutomataLib <https://automatalib.net>.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package net.automatalib.visualization;
17

18
import java.util.Map;
19

20
/**
21
 * Helper interface for providing additional styling properties for plotting graphs.
22
 *
23
 * @param <N>
24
 *         node class
25
 * @param <E>
26
 *         edge class
27
 */
28
public interface VisualizationHelper<N, E> {
29

30
    default void getGlobalNodeProperties(Map<String, String> properties) {}
1✔
31

32
    default void getGlobalEdgeProperties(Map<String, String> properties) {}
1✔
33

34
    /**
35
     * Retrieves the properties for rendering a single node. Additionally, the return value allows to control whether to
36
     * omit this node from rendering. If {@code false} is returned, the node will not be rendered. Consequently, any
37
     * modifications to the properties map will have no effect.
38
     * <p>
39
     * The properties are stored in the {@link Map} argument. Note that if an implementation of a base class is
40
     * overridden, it is probably a good idea to call {@code super.getNodeProperties(node, properties);} at the
41
     * beginning of the method.
42
     *
43
     * @param node
44
     *         the node to be rendered
45
     * @param properties
46
     *         the property map
47
     *
48
     * @return whether this node should be rendered
49
     */
50
    boolean getNodeProperties(N node, Map<String, String> properties);
51

52
    /**
53
     * Retrieves the properties for rendering a single edge. Additionally, the return value allows to control whether to
54
     * omit this edge from rendering. If {@code false} is returned, the edge will not be rendered. Consequently, any
55
     * modifications to the properties map will have no effect.
56
     * <p>
57
     * The properties are stored in the {@link Map} argument. Note that if an implementation of a base class is
58
     * overridden, it is probably a good idea to call {@code super.getEdgeProperties(node, properties);} at the
59
     * beginning of the method.
60
     *
61
     * @param src
62
     *         the source node of the edge
63
     * @param edge
64
     *         the edge to be rendered
65
     * @param tgt
66
     *         the target node of the edge
67
     * @param properties
68
     *         the property map
69
     *
70
     * @return whether this edge should be rendered
71
     */
72
    boolean getEdgeProperties(N src, E edge, N tgt, Map<String, String> properties);
73

74
    class CommonAttrs {
75

76
        public static final String LABEL = "label";
77
        public static final String COLOR = "color";
78
        public static final String TEXLBL = "texlbl";
79
        public static final String STYLE = "style";
80

81
        private CommonAttrs() {
82
            // prevent instantiation
83
        }
84
    }
85

86
    final class NodeAttrs extends CommonAttrs {
87

88
        public static final String SHAPE = "shape";
89
        public static final String WIDTH = "width";
90
        public static final String HEIGHT = "height";
91
        public static final String FIXEDSIZE = "fixedsize";
92

93
        public static final String INITIAL = "initial";
94

95
        private NodeAttrs() {
×
96
            // prevent instantiation
97
        }
×
98
    }
99

100
    class EdgeAttrs extends CommonAttrs {
101

102
        public static final String PENWIDTH = "penwidth";
103
        public static final String ARROWHEAD = "arrowhead";
104

105
        private EdgeAttrs() {
×
106
            // prevent instantiation
107
        }
×
108
    }
109

110
    final class NodeShapes {
111

112
        public static final String NONE = "none";
113

114
        public static final String OVAL = "oval";
115
        public static final String DOUBLEOVAL = "doubleoval";
116

117
        public static final String CIRCLE = "circle";
118
        public static final String DOUBLECIRCLE = "doublecircle";
119

120
        public static final String OCTAGON = "octagon";
121
        public static final String DOUBLEOCTAGON = "doubleoctagon";
122

123
        public static final String BOX = "box";
124

125
        private NodeShapes() {
126
            // prevent instantiation
127
        }
128
    }
129

130
    class CommonStyles {
131

132
        public static final String DASHED = "dashed";
133
        public static final String DOTTED = "dotted";
134
        public static final String SOLID = "solid";
135
        public static final String BOLD = "bold";
136

137
        private CommonStyles() {
138
            // prevent instantiation
139
        }
140
    }
141

142
    final class NodeStyles extends CommonStyles {
143

144
        public static final String FILLED = "filled";
145
        public static final String INVISIBLE = "invisible";
146
        public static final String DIAGONALS = "diagonals";
147
        public static final String ROUNDED = "rounded";
148

149
        private NodeStyles() {
×
150
            // prevent instantiation
151
        }
×
152
    }
153

154
    final class EdgeStyles extends CommonStyles {
155

156
        private EdgeStyles() {
×
157
            // prevent instantiation
158
        }
×
159
    }
160

161
    final class MTSEdgeAttrs extends EdgeAttrs {
162

163
        public static final String MODALITY = "modality";
164

165
        private MTSEdgeAttrs() {
×
166
            // prevent instantiation
167
        }
×
168
    }
169
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc