1 26 27 package com.opensugar.cube; 28 29 import com.opensugar.cube.simple.CubeWithoutPermissions; 30 31 import java.io.File ; 32 import java.util.Observer ; 33 34 public class Launcher { 35 36 public static void main( String [] args ) { 37 main( args, null ); 38 } 39 40 public static void main( String [] args, Object splashScreen ) { 41 new Launcher( null, splashScreen ); 42 } 43 44 public Launcher( File baseDirectory, Object splashScreen ) { 45 AbstractCube cube = newCube( baseDirectory ); 46 47 Observer progressListener = null; 48 if ( splashScreen instanceof Observer ) { 49 progressListener = (Observer )splashScreen; 50 } 51 52 cube.startup( progressListener ); 53 54 if ( splashScreen != null ) { 55 try { 56 Thread.sleep( 500 ); 57 } 58 catch ( InterruptedException ignore ) {} 59 ( (java.awt.Window )splashScreen ).dispose(); 60 splashScreen = null; 61 } 62 63 Object obj = new Object (); 64 synchronized( obj ) { 65 try { 66 obj.wait(); 67 } 68 catch ( InterruptedException ignore ) {} 69 } 70 } 71 72 protected AbstractCube newCube( File baseDirectory ) { 76 return newCubeWithoutPermissions( baseDirectory ); 77 } 78 79 private AbstractCube newCubeWithoutPermissions( File baseDirectory ) { 80 return new CubeWithoutPermissions( baseDirectory ); 81 } 82 83 } 84 | Popular Tags |