final List warnings;
final Preferences prefs = getUserPrefs();
final double prefsVersion;
// final ObserverPalette frameObserver;
// final ControlRoomFrame paletteCtrlRoom;
final MainFrame mainFrame;
// final CacheManager cacheManager;
final OSCRoot oscServer;
final SuperColliderClient superCollider;
String lafName;
List openDoc = null;
// ---- init prefs ----
oscServer = new OSCRoot( prefs.node( OSCRoot.DEFAULT_NODE ), 0x4549 );
prefsVersion = prefs.getDouble( PrefsUtil.KEY_VERSION, 0.0 );
if( prefsVersion < APP_VERSION ) {
warnings = PrefsUtil.createDefaults( prefs, prefsVersion );
} else {
warnings = null;
}
// ---- check commandline options ----
// WebLookAndFeel.install();
// System.out.println(UIManager.getLookAndFeel().getName());
UIManager.installLookAndFeel("WebLookAndFeel", "com.alee.laf.WebLookAndFeel");
WebCheckBoxStyle .animated = false;
WebProgressBarStyle.progressTopColor = Color.lightGray;
WebProgressBarStyle.progressBottomColor = Color.gray;
// XXX TODO: how to really turn of animation?
WebProgressBarStyle.highlightWhite = new Color(255, 255, 255, 0); // 48)
WebProgressBarStyle.highlightDarkWhite = new Color(255, 255, 255, 0);
lafName = prefs.get( PrefsUtil.KEY_LOOKANDFEEL, null );
for( int i = 0; i < args.length; i++ ) {
if( args[ i ].startsWith( "-" )) {
if( args[ i ].equals( "-laf" )) {
if( (i + 2) < args.length ) {
UIManager.installLookAndFeel( args[ i + 1 ], args[ i + 2 ]);
if( lafName == null ) lafName = args[ i + 2 ];
i += 2;
} else {
System.err.println( "Option -laf requires two additional arguments (screen-name and class-name)." );
System.exit( 1 );
}
} else {
System.err.println( "Unknown option " + args[ i ]);
System.exit( 1 );
}
} else {
if( openDoc == null ) openDoc = new ArrayList();
openDoc.add( args[ i ]);
}
}
// ---- init look-and-feel ----
System.setProperty( "swing.aatext", "true" );
lookAndFeelUpdate( lafName );
// JFrame.setDefaultLookAndFeelDecorated( true );
// ---- init infrastructure ----
// warning : reihenfolge is crucial
// oscServer = new OSCRoot( prefs.node( OSCRoot.DEFAULT_NODE ), 0x4549 );
osc = new OSCRouterWrapper( oscServer, this );
final CacheManager cache = new PrefCacheManager( prefs.node( PrefCacheManager.DEFAULT_NODE ));
superCollider = new SuperColliderClient();
init();
// ---- listeners ----
quitAfterSaveListener = new ProcessingThread.Listener() {
public void processStarted( ProcessingThread.Event e ) { /* empty */ }
// if the saving was successfull, we will call closeAll again
public void processStopped( ProcessingThread.Event e )
{
if( e.isDone() ) {
quit();
}
}
};
try {
superCollider.init();
}
catch( IOException e1 ) {
BasicWindowHandler.showErrorDialog( null, e1, "SuperColliderClient Initialization" );
System.exit( 1 );
return;
}
// scPlugInManager = new SCPlugInManager( this );
// ---- component views ----
mainFrame = new MainFrame();
((BasicWindowHandler) getWindowHandler()).setDefaultBorrower( mainFrame );
final AppWindow ctrlRoom = new ControlRoomFrame();
final AppWindow observer = new ObserverPalette();
// means no preferences found, so