//*-- generate the splash screen
final Display display = new Display();
final int[] numProgIncr = {3};
//final Image image = new Image(display, 300, 300);
final Image image = new Image(display, Constants.MUSTRU_HOME + File.separator + "icons" + File.separator + "mustruSplash.png");
final Shell splash = new Shell(SWT.ON_TOP);
final ProgressBar bar = new ProgressBar(splash, SWT.NONE);
bar.setMaximum(numProgIncr[0]);
Label label = new Label(splash, SWT.NONE);
label.setImage(image);
FormLayout layout = new FormLayout();
splash.setLayout(layout);
FormData labelData = new FormData();
labelData.right = new FormAttachment(100, 0);
labelData.bottom = new FormAttachment(100, 0);
label.setLayoutData(labelData);
FormData progressData = new FormData();
progressData.left = new FormAttachment(0, 5);
progressData.right = new FormAttachment(100, -5);
progressData.bottom = new FormAttachment(100, -5);
bar.setLayoutData(progressData);
splash.pack();
Rectangle splashRect = splash.getBounds();
Rectangle displayRect = display.getBounds();
int x = (displayRect.width - splashRect.width) / 2;
int y = (displayRect.height - splashRect.height) / 2;
splash.setLocation(x, y);
splash.open();
//*-- start the Online Index application
display.asyncExec(
new Runnable()
{
public void run()
{
int i = 0;
PropertyConfigurator.configure (Constants.LOG4J_FILE); bar.setSelection(i + 1); numProgIncr[0]--;
OnlineIndex oi = new OnlineIndex(null); oi.copyArgs(args); bar.setSelection(i + 1); numProgIncr[0]--;
ApplicationWindow viewer = oi; bar.setSelection(i + 1); numProgIncr[0]--;
splash.close(); image.dispose();
viewer.setBlockOnOpen(true);
viewer.open();
}
}