Changeset 2827


Ignore:
Timestamp:
05/25/07 16:04:09 (13 years ago)
Author:
sorber
Message:

Removed dependency on jgoodies.looks classes not in current looks jar.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/overlays/SpreadsheetLauncher.java

    r2826 r2827  
    2424package loci.visbio.overlays; 
    2525 
    26 import com.jgoodies.looks.LookUtils; 
     26//import com.jgoodies.looks.LookUtils; 
    2727import java.io.File; 
    2828import java.io.IOException; 
     29import java.util.Locale; 
    2930 
    3031public class SpreadsheetLauncher { 
     
    3839  protected static final String MAC_PATH = "/Applications/Microsoft Office 2004/Microsoft Excel"; 
    3940 
     41  // copied from LookUtils 
     42  // TODO can use LookUtils methods as soon as we update jgoodies.looks jar file 
     43  protected static final String OS_NAME = System.getProperty("os.name"); 
     44 
    4045  // --  Fields -- 
    4146   
     
    4853  public SpreadsheetLauncher() { 
    4954    // determine OS 
    50     if (LookUtils.IS_OS_WINDOWS) path = WIN_PATH; 
    51     if (LookUtils.IS_OS_LINUX) path = LIN_PATH;  
    52     if (LookUtils.IS_OS_MAC) path = MAC_PATH; 
     55    if (isWindows()) path = WIN_PATH; 
     56    else if (isLinux()) path = LIN_PATH;  
     57    else if (isMac()) path = MAC_PATH; 
     58    else path = ""; 
    5359  } 
    5460 
     
    7177  } 
    7278 
     79  // -- Helper methods -- 
     80 
     81  /** Whether the OS is windows */  
     82  protected boolean isWindows() {  
     83    // return LookUtils.IS_OS_WINDOWS_MODERN; 
     84    // copied from LookUtils: 
     85    return OS_NAME.startsWith("Windows"); 
     86  } 
     87   
     88  /** Whether the OS is mac */  
     89  protected boolean isMac() { 
     90    // return LookUtils.IS_OS_MAC; 
     91    // Copied from LookUtils 
     92    return OS_NAME.startsWith("Mac"); 
     93  } 
     94 
     95  /** Whether OS is Linux */ 
     96  protected boolean isLinux() { 
     97    // return LookUtils.IS_OS_LINUX; 
     98    return OS_NAME.toUpperCase(Locale.ENGLISH).startsWith("LINUX"); // copied from LookUtils 
     99  } 
     100 
    73101  /** Makes an error message from the given command */ 
    74102  protected String makeCommandErrorMessage(String command) { 
    75     return "Could not launch spreadsheet using the following command:\n\t" + command; 
     103    String msg = "Could not launch spreadsheet using the following command:\n\t"  
     104      + command + "\nYou may wish to specify the spreadsheet application path" 
     105      + " yourself in the Options menu."; 
     106    return msg; 
    76107  } 
    77108 
Note: See TracChangeset for help on using the changeset viewer.