public static void main(String[] args) throws Exception { if (!new ImageFaker().fakeScreen(args)) { System.exit(1); } }
public boolean fakeScreen(String[] args) { DebugTools.enableLogging("INFO"); boolean validArgs = parseArgs(args); if (!validArgs || targetDirectoryPath == null) { printUsage(); return false; } // make sure that we don't end up with just a ".fake" directory if (new Location(targetDirectoryPath).exists()) { Location p = new Location(targetDirectoryPath, "screen.fake"); int index = 1; while (p.exists()) { p = new Location(targetDirectoryPath, "screen" + index + ".fake"); index++; } targetDirectoryPath = p.getAbsolutePath(); } Location directoryRoot; if (!FormatHandler.checkSuffix(targetDirectoryPath, ResourceNamer.FAKE_EXT)) { directoryRoot = new Location(targetDirectoryPath + ResourceNamer.DOT + ResourceNamer.FAKE_EXT); } else { directoryRoot = new Location(targetDirectoryPath); } FakeImage fake = new FakeImage(directoryRoot); fake.generateScreen(plates, plateAcquisitions, rows, columns, fields); return true; }