(ArrayList<File> fileList, ArrayList<String> nameList, RocPlotSettings settings, final boolean hideSidePanel)
| 944 | } |
| 945 | |
| 946 | private static void createGui(ArrayList<File> fileList, ArrayList<String> nameList, RocPlotSettings settings, final boolean hideSidePanel) throws InterruptedException, InvocationTargetException { |
| 947 | UIManager.put("Slider.paintValue", Boolean.FALSE); // Make GTK theme more bearable, if used |
| 948 | final JFrame frame = new JFrame(); |
| 949 | final ImageIcon icon = createImageIcon("com/rtg/graph/resources/realtimegenomics_logo_sm.png", "rtg rocplot"); |
| 950 | if (icon != null) { |
| 951 | frame.setIconImage(icon.getImage()); |
| 952 | } |
| 953 | |
| 954 | final RocPlot rp = new RocPlot(settings) { |
| 955 | @Override |
| 956 | public void setTitle(final String title) { |
| 957 | super.setTitle(title); |
| 958 | frame.setTitle("rtg rocplot - " + title); |
| 959 | } |
| 960 | }; |
| 961 | frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
| 962 | frame.setLayout(new BorderLayout()); |
| 963 | frame.add(rp.mMainPanel, BorderLayout.CENTER); |
| 964 | final CountDownLatch lock = new CountDownLatch(1); |
| 965 | rp.mPopup.addSeparator(); |
| 966 | rp.mPopup.add(new AbstractAction("Exit", null) { |
| 967 | @Override |
| 968 | public void actionPerformed(ActionEvent e) { |
| 969 | frame.setVisible(false); |
| 970 | frame.dispose(); |
| 971 | lock.countDown(); |
| 972 | } |
| 973 | }); |
| 974 | SwingUtilities.invokeAndWait(() -> { |
| 975 | frame.pack(); |
| 976 | frame.setSize(1024, 768); |
| 977 | frame.setLocation(50, 50); |
| 978 | frame.setVisible(true); |
| 979 | rp.showCurrentGraph(); |
| 980 | if (hideSidePanel) { |
| 981 | try { // Put a pause, because fricken swing is a load of bollocks |
| 982 | Thread.sleep(200); |
| 983 | } catch (InterruptedException e) { |
| 984 | e.printStackTrace(); |
| 985 | } |
| 986 | rp.setSplitPaneDividerLocation(1.0); |
| 987 | } |
| 988 | }); |
| 989 | rp.loadData(fileList, nameList, settings.mInitialZoom); |
| 990 | SwingUtilities.invokeAndWait(rp::showCurrentGraph); |
| 991 | if (hideSidePanel) { // Redo, as fricken swing is a load of bollocks |
| 992 | SwingUtilities.invokeAndWait(() -> rp.setSplitPaneDividerLocation(1.0)); |
| 993 | } |
| 994 | lock.await(); |
| 995 | } |
| 996 | } |
no test coverage detected