Skip to content

Package: Main

Main

nameinstructionbranchcomplexitylinemethod
Main()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createMainWindow()
M: 20 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
lambda$createMainWindow$0(ViewerPanel)
M: 39 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
main(String[])
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * *********************************************************************************************************************
3: *
4: * Mistral: open source imaging engine
5: * http://tidalwave.it/projects/mistral
6: *
7: * Copyright (C) 2003 - 2023 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *********************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
12: * the License. You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
17: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations under the License.
19: *
20: * *********************************************************************************************************************
21: *
22: * git clone https://bitbucket.org/tidalwave/mistral-src
23: * git clone https://github.com/tidalwave-it/mistral-src
24: *
25: * *********************************************************************************************************************
26: */
27: package it.tidalwave.mistral.example.viewer;
28:
29: import java.lang.reflect.InvocationTargetException;
30: import java.security.AccessControlException;
31: import java.io.IOException;
32: import java.awt.Dimension;
33: import java.awt.HeadlessException;
34: import java.awt.Toolkit;
35: import javax.swing.JFrame;
36: import javax.swing.SwingUtilities;
37: import it.tidalwave.image.util.Platform;
38:
39: /***********************************************************************************************************************
40: *
41: * @author Fabrizio Giudici
42: *
43: **********************************************************************************************************************/
44: public class Main
45: {
46: private static final Dimension WINDOW_SIZE = new Dimension(800, 600);
47:
48: public static void main (final String[] args)
49: throws Exception
50: {
51: createMainWindow();
52: }
53:
54: private static void createMainWindow()
55: throws InvocationTargetException, HeadlessException, InterruptedException, IOException
56: {
57:• if (!Platform.isMacOSX())
58: {
59: try
60: {
61: System.setProperty("swing.aatext", "true");
62: }
63: catch (AccessControlException e)
64: {
65: System.err.println("Can't set anti-aliased text because of: " + e);
66: }
67: }
68:
69: final var viewerPanel = new ViewerPanel();
70: SwingUtilities.invokeAndWait(() ->
71: {
72: final var frame = new JFrame("Mistral Viewer example");
73: frame.getContentPane().add(viewerPanel);
74: frame.setSize(WINDOW_SIZE);
75:
76: final var screenSize = Toolkit.getDefaultToolkit().getScreenSize();
77: frame.setLocation((screenSize.width - frame.getWidth()) / 2,
78: (screenSize.height - frame.getHeight()) / 2);
79: frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
80: frame.setVisible(true);
81: });
82: }
83: }