• 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

66.67
/visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOTUtil.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.dot;
17

18
import java.awt.Window;
19
import java.awt.event.ActionEvent;
20
import java.awt.event.KeyAdapter;
21
import java.awt.event.KeyEvent;
22
import java.awt.event.WindowEvent;
23

24
import javax.swing.AbstractAction;
25
import javax.swing.filechooser.FileFilter;
26
import javax.swing.filechooser.FileNameExtensionFilter;
27

28
final class DOTUtil {
29

30
    static final FileFilter DOT_FILTER = new FileNameExtensionFilter("GraphVIZ file (*.dot)", "dot");
2✔
31

32
    static final FileFilter PNG_FILTER = new FileNameExtensionFilter("Portable Network Graphics (*.png)", "png");
2✔
33

34
    static final int DEFAULT_WIDTH = 800;
35

36
    static final int DEFAULT_HEIGHT = 600;
37

38
    private DOTUtil() {}
39

40
    static AbstractAction getCloseAction(Window w) {
41
        return new AbstractAction("Close") {
2✔
42

43
            @Override
44
            public void actionPerformed(ActionEvent e) {
45
                w.dispatchEvent(new WindowEvent(w, WindowEvent.WINDOW_CLOSING));
2✔
46
            }
2✔
47
        };
48
    }
49

50
    static KeyAdapter closeOnEscapeAdapter(Window w) {
51
        return new KeyAdapter() {
2✔
52

53
            @Override
54
            public void keyTyped(KeyEvent e) {
55
                if (e.getKeyChar() == KeyEvent.VK_ESCAPE) {
×
56
                    w.dispatchEvent(new WindowEvent(w, WindowEvent.WINDOW_CLOSING));
×
57
                }
58
            }
×
59
        };
60
    }
61
}
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