MCPcopy Create free account
hub / github.com/ArtifexSoftware/mupdf / main

Method main

platform/java/example/Viewer.java:1883–1910  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

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)

Callers 1

mupdfwrap.pyFile · 0.45

Calls 3

messageBoxMethod · 0.95
disposeMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected