long getMemorySetting(String file) { String path = file.startsWith("/")?file:Prefs.getImageJDir()+file; if (IJ.debugMode) IJ.log("getMemorySetting: "+path); f = new File(path);
private void loadCursors() { Toolkit toolkit = Toolkit.getDefaultToolkit(); String path = Prefs.getImageJDir()+"images/crosshair-cursor.gif"; File f = new File(path); if (!f.exists()) return; //Image image = toolkit.getImage(path); ImageIcon icon = new ImageIcon(path); Image image = icon.getImage(); if (image==null) return; int width = icon.getIconWidth(); int height = icon.getIconHeight(); Point hotSpot = new Point(width/2, height/2); Cursor crosshairCursor = toolkit.createCustomCursor(image, hotSpot, "crosshair-cursor.gif"); ImageCanvas.setCursor(crosshairCursor, 0); }
private void loadCursors() { Toolkit toolkit = Toolkit.getDefaultToolkit(); String path = Prefs.getImageJDir()+"images/crosshair-cursor.gif"; File f = new File(path); if (!f.exists()) return; //Image image = toolkit.getImage(path); ImageIcon icon = new ImageIcon(path); Image image = icon.getImage(); if (image==null) return; int width = icon.getIconWidth(); int height = icon.getIconHeight(); Point hotSpot = new Point(width/2, height/2); Cursor crosshairCursor = toolkit.createCustomCursor(image, hotSpot, "crosshair-cursor.gif"); ImageCanvas.setCursor(crosshairCursor, 0); }
long getMemorySetting(String file) { String path = file.startsWith("/")?file:Prefs.getImageJDir()+file; if (IJ.debugMode) IJ.log("getMemorySetting: "+path); f = new File(path);
public DicomDecoder(String directory, String fileName) { this.directory = directory; this.fileName = fileName; String path = null; if (dictionary==null && IJ.getApplet()==null) { path = Prefs.getImageJDir()+"DICOM_Dictionary.txt"; File f = new File(path); if (f.exists()) try { dictionary = new Properties(); InputStream is = new BufferedInputStream(new FileInputStream(f)); dictionary.load(is); is.close(); if (IJ.debugMode) IJ.log("DicomDecoder: using "+dictionary.size()+" tag dictionary at "+path); } catch (Exception e) { dictionary = null; } } if (dictionary==null) { DicomDictionary d = new DicomDictionary(); dictionary = d.getDictionary(); if (IJ.debugMode) IJ.log("DicomDecoder: "+path+" not found; using "+dictionary.size()+" tag built in dictionary"); } }
public DicomDecoder(String directory, String fileName) { this.directory = directory; this.fileName = fileName; String path = null; if (dictionary==null && IJ.getApplet()==null) { path = Prefs.getImageJDir()+"DICOM_Dictionary.txt"; File f = new File(path); if (f.exists()) try { dictionary = new Properties(); InputStream is = new BufferedInputStream(new FileInputStream(f)); dictionary.load(is); is.close(); if (IJ.debugMode) IJ.log("DicomDecoder: using "+dictionary.size()+" tag dictionary at "+path); } catch (Exception e) { dictionary = null; } } if (dictionary==null) { DicomDictionary d = new DicomDictionary(); dictionary = d.getDictionary(); if (IJ.debugMode) IJ.log("DicomDecoder: "+path+" not found; using "+dictionary.size()+" tag built in dictionary"); } }
private void checkForUpdate(String plugin, String currentVersion) { int slashIndex = plugin.lastIndexOf("/"); if (slashIndex==-1 || !plugin.endsWith(".jar")) return; String className = plugin.substring(slashIndex+1, plugin.length()-4); File f = new File(Prefs.getImageJDir()+"plugins"+File.separator+"jars"+File.separator+className+".jar"); if (!f.exists() || !f.canWrite()) { if (IJ.debugMode) IJ.log("checkForUpdate: jar not found ("+plugin+")"); return; } String version = null; try { Class c = IJ.getClassLoader().loadClass("Compiler"); version = "0.00a"; Method m = c.getDeclaredMethod("getVersion", new Class[0]); version = (String)m.invoke(null, new Object[0]); } catch (Exception e) {} if (version==null) { if (IJ.debugMode) IJ.log("checkForUpdate: class not found ("+className+")"); return; } if (version.compareTo(currentVersion)>=0) { if (IJ.debugMode) IJ.log("checkForUpdate: up to date ("+className+" "+version+")"); return; } boolean ok = Macro_Runner.downloadJar(plugin); if (IJ.debugMode) IJ.log("checkForUpdate: "+className+" "+version+" "+ok); }
private void checkForUpdate(String plugin, String currentVersion) { int slashIndex = plugin.lastIndexOf("/"); if (slashIndex==-1 || !plugin.endsWith(".jar")) return; String className = plugin.substring(slashIndex+1, plugin.length()-4); File f = new File(Prefs.getImageJDir()+"plugins"+File.separator+"jars"+File.separator+className+".jar"); if (!f.exists() || !f.canWrite()) { if (IJ.debugMode) IJ.log("checkForUpdate: jar not found ("+plugin+")"); return; } String version = null; try { Class c = IJ.getClassLoader().loadClass("Compiler"); version = "0.00a"; Method m = c.getDeclaredMethod("getVersion", new Class[0]); version = (String)m.invoke(null, new Object[0]); } catch (Exception e) {} if (version==null) { if (IJ.debugMode) IJ.log("checkForUpdate: class not found ("+className+")"); return; } if (version.compareTo(currentVersion)>=0) { if (IJ.debugMode) IJ.log("checkForUpdate: up to date ("+className+" "+version+")"); return; } boolean ok = Macro_Runner.downloadJar(plugin); if (IJ.debugMode) IJ.log("checkForUpdate: "+className+" "+version+" "+ok); }
return Menus.getMacrosPath(); else if (title2.equals("luts")) { String ijdir = Prefs.getImageJDir(); if (ijdir!=null) return ijdir + "luts" + File.separator; return System.getProperty("user.home") + File.separator; else if (title2.equals("startup")) return Prefs.getImageJDir(); else if (title2.equals("imagej")) return Prefs.getImageJDir(); else if (title2.equals("current") || title2.equals("default")) return OpenDialog.getDefaultDirectory();
return Menus.getMacrosPath(); else if (title2.equals("luts")) { String ijdir = Prefs.getImageJDir(); if (ijdir!=null) return ijdir + "luts" + File.separator; return System.getProperty("user.home") + File.separator; else if (title2.equals("startup")) return Prefs.getImageJDir(); else if (title2.equals("imagej")) return Prefs.getImageJDir(); else if (title2.equals("current") || title2.equals("default")) return OpenDialog.getDefaultDirectory();
list.add(" Menus.getPlugInsPath: "+Menus.getPlugInsPath()); list.add(" Menus.getMacrosPath: "+Menus.getMacrosPath()); list.add(" Prefs.getImageJDir: "+Prefs.getImageJDir()); list.add(" Prefs.getThreads: "+Prefs.getThreads()+cores()); list.add(" Prefs.open100Percent: "+Prefs.open100Percent);
list.add(" Menus.getPlugInsPath: "+Menus.getPlugInsPath()); list.add(" Menus.getMacrosPath: "+Menus.getMacrosPath()); list.add(" Prefs.getImageJDir: "+Prefs.getImageJDir()); list.add(" Prefs.getThreads: "+Prefs.getThreads()+cores()); list.add(" Prefs.open100Percent: "+Prefs.open100Percent);