/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
*/
/**
* This is the class that displays a splash screen and in the background it will
* create QuickSetup object.
*
* The main method of this class is directly called by the Java Web Start
* mechanism to launch the JWS setup.
*
* This class tries to minimize the time to be displayed. So it does the loading
* of the setup class in runtime once we already have displayed the splash
* screen. This is why the quickSetup variable is of type Object.
*
* This class can be reused by simply overwriting the methods
* constructApplication() and displayApplication().
*/
{
// Constant for the display of the splash screen
/**
* The main method for this class.
* It can be called from the event thread and outside the event thread.
* @param args arguments to be passed to the method QuickSetup.initialize
*/
{
}
/**
* {@inheritDoc}
*/
{
paint(g);
}
/**
* {@inheritDoc}
*/
{
}
/**
* Protected constructor to force to use the main method.
*
*/
protected SplashScreen()
{
super(new Frame());
try
{
image = getSplashImage();
Utilities.centerOnScreen(this);
{
}
}
/**
* The method used to display the splash screen. It will also call create
* the application associated with this SplashScreen and display it.
* It can be called from the event thread and outside the event thread.
* @param args arguments to be passed to the method QuickSetup.initialize
*/
{
{
{
public void run()
{
}
});
t.start();
} else
{
}
}
/**
* This method creates the image directly instead of using UIFactory to reduce
* class loading.
* @return the splash image.
*/
{
}
/**
* This is basically the method that is execute in SplashScreen.main but it
* it assumes that is being called outside the event thread.
*
* @param args arguments to be passed to the method QuickSetup.initialize.
*/
{
}
/**
* This methods displays the splash screen.
* This method assumes that is being called outside the event thread.
*/
private void displaySplashScreen()
{
try
{
{
public void run()
{
setVisible(true);
}
});
{
}
}
/**
* This methods constructs the objects before displaying them.
* This method assumes that is being called outside the event thread.
* This method can be overwritten by subclasses to construct other objects
* different than the Quick Setup.
* @param args arguments passed in the main of this class.
*/
{
try
{
{ args });
} catch (Exception e)
{
new InternalError("Failed to invoke initialize method");
throw error;
}
}
/**
* This method displays the QuickSetup dialog.
* @see org.opends.quicksetup.ui.QuickSetup#display
* This method assumes that is being called outside the event thread.
* This method can be overwritten by subclasses to construct other objects
* different than the Quick Setup.
*/
protected void displayApplication()
{
try
{
{
public void run()
{
try
{
} catch (Exception e)
{
new InternalError("Failed to invoke display method");
throw error;
}
}
});
{
// do nothing;
}
}
/**
* Disposes the splash screen.
* This method assumes that is being called outside the event thread.
*/
private void disposeSplashScreen()
{
try
{
{
public void run()
{
setVisible(false);
dispose();
}
});
{
// do nothing;
}
}
/**
* This method just executes an sleep depending on how long the splash
* screen has been displayed. The idea of calling this method is to have the
* splash screen displayed a minimum time (specified by
* MIN_SPLASH_DISPLAY).
* @param splashDisplayStartTime the time in milliseconds when the splash
* screen started displaying.
*/
{
if (sleepTime > 0)
{
try
{
{
// do nothing;
}
}
}
}