*/
public void aboutMenuItem_actionPerformed(ActionEvent e)
{
- StringBuffer message = getAboutMessage(false);
- JOptionPane.showInternalMessageDialog(Desktop.desktop,
-
- message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
+// StringBuffer message = getAboutMessage(false);
+// JOptionPane.showInternalMessageDialog(Desktop.desktop,
+//
+// message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
+ new Thread(new Runnable() { public void run() {new SplashScreen(true);}}).start();
}
public StringBuffer getAboutMessage(boolean shortv)
import java.awt.event.*;
import javax.swing.*;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
/**
* DOCUMENT ME!
* @author $author$
* @version $Revision$
*/
-public class SplashScreen extends JPanel implements Runnable
+public class SplashScreen extends JPanel implements Runnable, HyperlinkListener
{
boolean visible = true;
*/
public SplashScreen()
{
+ this(false);
+ }
+ private boolean interactiveDialog=false;
+ /**
+ *
+ * @param interactive if true - an internal dialog is opened rather than a free-floating splash screen
+ */
+ public SplashScreen(boolean interactive)
+ {
+ this.interactiveDialog=interactive;
+ // show a splashscreen that will disapper
Thread t = new Thread(this);
t.start();
}
+
MouseAdapter closer = new MouseAdapter()
{
public void mousePressed(MouseEvent evt)
{
try
{
- visible = false;
- closeSplash();
+ if (!interactiveDialog)
+ {
+ visible = false;
+ closeSplash();
+ }
} catch (Exception ex)
{
}
iframe = new JInternalFrame();
iframe.setFrameIcon(null);
- iframe.setClosable(false);
+ iframe.setClosable(interactiveDialog);
this.setLayout(new BorderLayout());
iframe.setContentPane(this);
iframe.setLayer(JLayeredPane.PALETTE_LAYER);
authlist=new JTextPane();
authlist.setEditable(false);
authlist.addMouseListener(closer);
+ authlist.addHyperlinkListener(this);
authlist.setContentType("text/html");
authlist.setText(newtext);
authlist.setVisible(true);
add(authlist, BorderLayout.CENTER);
- iframe.pack();
- iframe.setVisible(true);
iframe.setBounds((int) ((Desktop.instance.getWidth() - 750) / 2),
(int) ((Desktop.instance.getHeight() - 160) / 2), 750,
iframe.getPreferredSize().height);
//System.err.println("New preferred size: "+iframe.getPreferredSize().height);
+ iframe.validate();
+ iframe.setVisible(true);
return true;
}
while (visible)
{
+ iframe.repaint();
try
{
Thread.sleep(500);
} catch (Exception ex)
{
}
-
- if (((System.currentTimeMillis() / 1000) - startTime) > 5)
+
+ if (!interactiveDialog && ((System.currentTimeMillis() / 1000) - startTime) > 5)
{
visible = false;
}
if (visible && refreshText())
{
- repaint();
+// if (interactiveDialog) {
+ iframe.repaint();
+// } else {
+// iframe.repaint();
+// };
+ }
+ if (interactiveDialog)
+ {
+ return;
}
}
* += fontSize + 4); }
*/
}
+ @Override
+ public void hyperlinkUpdate(HyperlinkEvent e)
+ {
+ Desktop.hyperlinkUpdate(e);
+
+ }
}
\ No newline at end of file