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

LearnLib / automatalib / 6673214172

27 Oct 2023 11:30PM UTC coverage: 89.166% (-0.6%) from 89.796%
6673214172

push

github

mtf90
cleanup release configuration

15399 of 17270 relevant lines covered (89.17%)

1.67 hits per line

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

0.0
/adapters/brics/src/main/java/net/automatalib/brics/BricsVisualizationHelper.java
1
/* Copyright (C) 2013-2023 TU Dortmund
2
 * This file is part of AutomataLib, http://www.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.brics;
17

18
import java.util.Collection;
19
import java.util.Map;
20

21
import dk.brics.automaton.State;
22
import dk.brics.automaton.Transition;
23
import net.automatalib.visualization.DefaultVisualizationHelper;
24

25
/**
26
 * Rendering helper for Brics automaton adapters.
27
 */
28
final class BricsVisualizationHelper extends DefaultVisualizationHelper<State, Transition> {
29

30
    private final AbstractBricsAutomaton automaton;
31

32
    /**
33
     * Constructor.
34
     *
35
     * @param automaton
36
     *         the automaton to render
37
     */
38
    BricsVisualizationHelper(AbstractBricsAutomaton automaton) {
×
39
        this.automaton = automaton;
×
40
    }
×
41

42
    @Override
43
    protected Collection<State> initialNodes() {
44
        return automaton.getInitialStates();
×
45
    }
46

47
    @Override
48
    public boolean getNodeProperties(State node, Map<String, String> properties) {
49
        super.getNodeProperties(node, properties);
×
50

51
        String str = node.toString();
×
52
        int wsIdx1 = str.indexOf(' ');
×
53
        int wsIdx2 = str.indexOf(' ', wsIdx1 + 1);
×
54
        properties.put(NodeAttrs.LABEL, "s" + str.substring(wsIdx1 + 1, wsIdx2));
×
55
        if (node.isAccept()) {
×
56
            properties.put(NodeAttrs.SHAPE, NodeShapes.DOUBLECIRCLE);
×
57
        }
58

59
        return true;
×
60
    }
61

62
    @Override
63
    public boolean getEdgeProperties(State src, Transition edge, State tgt, Map<String, String> properties) {
64
        super.getEdgeProperties(src, edge, tgt, properties);
×
65

66
        String label = BricsTransitionProperty.toString(edge.getMin(), edge.getMax());
×
67
        properties.put(NodeAttrs.LABEL, label);
×
68

69
        return true;
×
70
    }
71

72
}
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