aboutsummaryrefslogtreecommitdiffstats
path: root/test/jake2/qcommon/Q2TestDataUtil.java
blob: e27321521947162896a112cb22b7d27453842f58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package jake2.qcommon;

import jake2.Jake2;

import java.util.Locale;

/** @author Patrick Woodworth */
public class Q2TestDataUtil {

    private static final boolean USE_DATA_DIALOG = Boolean.getBoolean("jake.data.dialog");

    public static final void initQ2DataTool() {
        if (USE_DATA_DIALOG) {
            Q2DataDialogWrapper tmpq2DataTool = new Q2DataDialogWrapper();
            Locale.setDefault(Locale.US);
            tmpq2DataTool.setVisible(true);
            Jake2.q2DataTool = tmpq2DataTool;
        } else {
            Jake2.q2DataTool = new Q2DataTool();
            Locale.setDefault(Locale.US);
        }
    }

    public static class Q2DataDialogWrapper extends Q2DataTool {

        private final Q2DataDialog m_data = new Q2DataDialog();

        public Q2DataDialogWrapper() {
            super();
        }

        @Override
        public void testQ2Data() {
            m_data.testQ2Data();
        }

        @Override
        void dispose() {
            m_data.dispose();
        }

        @Override
        void setStatus(String text) {
            m_data.setStatus(text);
        }

        public void setVisible(boolean b) {
            m_data.setVisible(b);
        }
    }
}