(String[] args)
| 1881 | } |
| 1882 | |
| 1883 | public static void main(String[] args) { |
| 1884 | String selectedPath; |
| 1885 | |
| 1886 | if (args.length <= 0) { |
| 1887 | FileDialog fileDialog = new FileDialog((Frame)null, "MuPDF Open File", FileDialog.LOAD); |
| 1888 | fileDialog.setDirectory(System.getProperty("user.dir")); |
| 1889 | fileDialog.setFilenameFilter(new FilenameFilter() { |
| 1890 | public boolean accept(File dir, String name) { |
| 1891 | return Document.recognize(name); |
| 1892 | } |
| 1893 | }); |
| 1894 | fileDialog.setVisible(true); |
| 1895 | if (fileDialog.getFile() == null) |
| 1896 | System.exit(0); |
| 1897 | selectedPath = new StringBuffer(fileDialog.getDirectory()).append(File.separatorChar).append(fileDialog.getFile()).toString(); |
| 1898 | fileDialog.dispose(); |
| 1899 | } else { |
| 1900 | selectedPath = args[0]; |
| 1901 | } |
| 1902 | |
| 1903 | try { |
| 1904 | Viewer app = new Viewer(selectedPath); |
| 1905 | app.setVisible(true); |
| 1906 | } catch (Exception e) { |
| 1907 | messageBox(null, "MuPDF Error", "Cannot open \"" + selectedPath + "\": " + e.getMessage() + "."); |
| 1908 | System.exit(1); |
| 1909 | } |
| 1910 | } |
| 1911 | |
| 1912 | public float getRetinaScale() { |
| 1913 | // first try Oracle's VM (we should also test for 1.7.0_40 or higher) |
no test coverage detected