/* * Copyright (c) 2007 BUSINESS OBJECTS SOFTWARE LIMITED * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Business Objects nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * CALIDESplashScreen.java * Creation date: (4/14/01 5:21:21 PM) * By: Luke Evans */ package org.openquark.gems.client.caleditor.editorapp; import java.awt.BorderLayout; import java.awt.Frame; import java.awt.Insets; import java.awt.Window; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JWindow; import javax.swing.border.EtchedBorder; /** * This type was generated by a SmartGuide. */ public class CALIDESplashScreen extends JWindow { private static final long serialVersionUID = -459246445597694110L; class IvjEventHandler implements WindowListener { public void windowActivated(WindowEvent e) { } public void windowClosed(WindowEvent e) { } public void windowClosing(WindowEvent e) { if (e.getSource() == CALIDESplashScreen.this) { connEtoC1(); } } public void windowDeactivated(WindowEvent e) { } public void windowDeiconified(WindowEvent e) { } public void windowIconified(WindowEvent e) { } public void windowOpened(WindowEvent e) { } } private final IvjEventHandler ivjEventHandler = new IvjEventHandler(); private JLabel ivjJLabel1 = null; private JPanel ivjJWindowContentPane = null; /** * CALIDESplashScreen constructor comment. */ public CALIDESplashScreen() { super(); initialize(); } /** * CALIDESplashScreen constructor comment. * @param owner Frame */ public CALIDESplashScreen(Frame owner) { super(owner); } /** * CALIDESplashScreen constructor comment. * @param owner Window */ public CALIDESplashScreen(Window owner) { super(owner); } /** * connEtoC1: (CALIDESplashScreen.window.windowClosing(WindowEvent) --> CALIDESplashScreen.dispose()V) */ private void connEtoC1() { try { this.dispose(); } catch (Throwable ivjExc) { handleException(ivjExc); } } /** * Return the JLabel1 property value. * @return JLabel */ private JLabel getJLabel1() { if (ivjJLabel1 == null) { try { ivjJLabel1 = new JLabel(); ivjJLabel1.setName("JLabel1"); //$NON-NLS-1$ ivjJLabel1.setIcon(new ImageIcon(getClass().getResource("/Resources/GemsSplash.gif"))); //$NON-NLS-1$ ivjJLabel1.setText(""); //$NON-NLS-1$ } catch (Throwable ivjExc) { handleException(ivjExc); } } return ivjJLabel1; } /** * Return the JWindowContentPane property value. * @return JPanel */ private JPanel getJWindowContentPane() { if (ivjJWindowContentPane == null) { try { ivjJWindowContentPane = new JPanel(); ivjJWindowContentPane.setName("JWindowContentPane"); //$NON-NLS-1$ ivjJWindowContentPane.setBorder(new EtchedBorder()); ivjJWindowContentPane.setLayout(new BorderLayout()); getJWindowContentPane().add(getJLabel1(), "Center"); //$NON-NLS-1$ } catch (Throwable ivjExc) { handleException(ivjExc); } } return ivjJWindowContentPane; } /** * Called whenever the part throws an exception. * @param exception Throwable */ private void handleException(Throwable exception) { /* Uncomment the following lines to print uncaught exceptions to stdout */ System.out.println("--------- UNCAUGHT EXCEPTION ---------"); //$NON-NLS-1$ exception.printStackTrace(System.out); } /** * Initializes connections * @exception Exception The exception description. */ private void initConnections() throws Exception { this.addWindowListener(ivjEventHandler); } /** * Initialize the class. */ private void initialize() { try { setName("CALIDESplashScreen"); //$NON-NLS-1$ setSize(300, 220); setContentPane(getJWindowContentPane()); initConnections(); } catch (Throwable ivjExc) { handleException(ivjExc); } } /** * main entrypoint - starts the part when it is run as an application * @param args String[] */ public static void main(String[] args) { try { CALIDESplashScreen aCALIDESplashScreen; aCALIDESplashScreen = new CALIDESplashScreen(); aCALIDESplashScreen.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); aCALIDESplashScreen.setVisible(true); Insets insets = aCALIDESplashScreen.getInsets(); aCALIDESplashScreen.setSize(aCALIDESplashScreen.getWidth() + insets.left + insets.right, aCALIDESplashScreen.getHeight() + insets.top + insets.bottom); aCALIDESplashScreen.setVisible(true); } catch (Throwable exception) { System.err.println("Exception occurred in main() of JWindow"); //$NON-NLS-1$ exception.printStackTrace(System.out); } } }