45a46,47 > import org.greenstone.gatherer.greenstone.LocalGreenstone; > import org.greenstone.gatherer.greenstone.LocalLibraryServer; 46a49 > import org.greenstone.gatherer.greenstone3.ServletConfiguration; 70c73 < static final public String PROGRAM_VERSION = "v2.72"; --- > static final public String PROGRAM_VERSION = "v2.74"; 402,404d404 < // Get a list of the core Greenstone classifiers and plugins < Classifiers.loadClassifiersList(null); < Plugins.loadPluginsList(null); 408,459c408,481 < public void openGUI() < { < // Size and place the frame on the screen < Rectangle bounds = Configuration.getBounds("general.bounds", true); < if (bounds == null) { < // Choose a sensible default value < bounds = new Rectangle(0, 0, 640, 480); < } < < // Ensure width and height are reasonable < size = bounds.getSize(); < if (size.width < 640) { < size.width = 640; < } < else if (size.width > Configuration.screen_size.width && Configuration.screen_size.width > 0) { < size.width = Configuration.screen_size.width; < } < if (size.height < 480) { < size.height = 480; < } < else if (size.height > Configuration.screen_size.height && Configuration.screen_size.height > 0) { < size.height = Configuration.screen_size.height; < } < < if (!g_man_built) { < < g_man.display(); < < // Place the window in the desired location on the screen, if this is do-able (not under most linux window managers apparently. In fact you're lucky if they listen to any of your screen size requests). < g_man.setLocation(bounds.x, bounds.y); < g_man.setVisible(true); < < // After the window has been made visible, check that it is in the correct place < // sometimes java places a window not in the correct place, < // but with an offset. If so, we work out what the offset is < // and change the desired location to take that into account < Point location = g_man.getLocation(); < int x_offset = bounds.x - location.x; < int y_offset = bounds.y - location.y; < // If not, offset the window to move it into the correct location < if (x_offset > 0 || y_offset > 0) { < ///ystem.err.println("changing the location to "+(bounds.x + x_offset)+" "+ (bounds.y + y_offset)); < g_man.setLocation(bounds.x + x_offset, bounds.y + y_offset); < } < < // The 'after-display' triggers several events which don't occur until after the visual components are actually available on screen. Examples of these would be the various html renderings, as they can't happen offscreen. < g_man.afterDisplay(); < g_man_built = true; < } < else { < g_man.setVisible(true); < } --- > public void openGUI() { > // Size and place the frame on the screen > Rectangle bounds = Configuration.getBounds("general.bounds", true); > if (bounds == null) { > // Choose a sensible default value > bounds = new Rectangle(0, 0, 640, 480); > } > > // Ensure width and height are reasonable > size = bounds.getSize(); > if (size.width < 640) { > size.width = 640; > } else if (size.width > Configuration.screen_size.width && Configuration.screen_size.width > 0) { > size.width = Configuration.screen_size.width; > } > if (size.height < 480) { > size.height = 480; > } else if (size.height > Configuration.screen_size.height && Configuration.screen_size.height > 0) { > size.height = Configuration.screen_size.height; > } > > if (!g_man_built) { > > g_man.display(); > > // Place the window in the desired location on the screen, if this is do-able (not under most linux window managers apparently. In fact you're lucky if they listen to any of your screen size requests). > g_man.setLocation(bounds.x, bounds.y); > g_man.setVisible(true); > > // After the window has been made visible, check that it is in the correct place > // sometimes java places a window not in the correct place, > // but with an offset. If so, we work out what the offset is > // and change the desired location to take that into account > Point location = g_man.getLocation(); > int x_offset = bounds.x - location.x; > int y_offset = bounds.y - location.y; > // If not, offset the window to move it into the correct location > if (x_offset > 0 || y_offset > 0) { > ///ystem.err.println("changing the location to "+(bounds.x + x_offset)+" "+ (bounds.y + y_offset)); > g_man.setLocation(bounds.x + x_offset, bounds.y + y_offset); > } > > // The 'after-display' triggers several events which don't occur until after the visual components are actually available on screen. Examples of these would be the various html renderings, as they can't happen offscreen. > g_man.afterDisplay(); > g_man_built = true; > } else { > g_man.setVisible(true); > } > // Get a list of the core Greenstone classifiers and plugins > Classifiers.loadClassifiersList(null); > Plugins.loadPluginsList(null); > > // If using a remote Greenstone we need to download the collection configurations now > if (Gatherer.isGsdlRemote) { > if (RemoteGreenstoneServer.downloadCollectionConfigurations().equals("")) { > // !! Something went wrong downloading the collection configurations > System.err.println("Error: Could not download collection configurations."); > System.exit(0); > } > } > > if (open_collection_file_path == null) { > > //the menu bar items, file and edit, are disabled from the moment of their creation. if there is no left-over collection from the last session, enable them; otherwise it is untill the collection finishes loading, will they be enabled in collectionManager.java > setMenuBarEnabled(true); > } else { > > // If there was a collection left open last time, reopen it > c_man.openCollectionFromLastTime(); > } > } > public static void setMenuBarEnabled(boolean enabled) { > g_man.menu_bar.file.setEnabled(enabled); > g_man.menu_bar.edit.setEnabled(enabled); 462d483 < 610a632 > 620a643,645 > if (Configuration.library_url == null){ > System.out.println("Error: you have not provide the Greenstone Library address."); > return; 621a647,648 > } > 637c664 < catch (Exception exception) { --- > catch (Exception exception) { 954c981,992 < return (image_magick_process.exitValue() == 0); --- > > //new way of detection of ImageMagick > InputStreamReader isr = new InputStreamReader(image_magick_process.getInputStream()); > BufferedReader br = new BufferedReader(isr); > // Capture the standard output stream and seach for two particular occurances: Version and ImageMagick. > String line = br.readLine().toLowerCase(); > if (line.indexOf("version") != -1 || line.indexOf("imagemagick") != -1) { > return true; > } else { > return false; > } > //return (image_magick_process.exitValue() == 0);