import java.awt.BorderLayout;
import java.awt.Color;
-import java.awt.Font;
+import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import javax.swing.JComponent;
import javax.swing.JEditorPane;
import javax.swing.JInternalFrame;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
}
AnimatedPanel ap = new AnimatedPanel();
- titlePanel.add(ap, BorderLayout.CENTER);
+ ap.setPreferredSize(new Dimension(60, 0));
+ titlePanel.add(ap, BorderLayout.LINE_START);
+ titlePanel.add(titleText, BorderLayout.CENTER);
Thread thread = new Thread(ap);
thread.start();
frame.addInternalFrameListener(
new javax.swing.event.InternalFrameAdapter()
{
- public void internalFrameClosed(
+ @Override
+ public void internalFrameClosed(
javax.swing.event.InternalFrameEvent evt)
{
// System.out.println("Shutting down webservice client");
public void setStatus(int status)
{
currentStatus = status;
+
+ String message = null;
+ switch (currentStatus)
+ {
+ case STATE_QUEUING:
+ message = MessageManager.getString("label.state_queueing");
+ break;
+
+ case STATE_RUNNING:
+ message = MessageManager.getString("label.state_running");
+ break;
+
+ case STATE_STOPPED_OK:
+ message = MessageManager.getString("label.state_completed");
+ break;
+
+ case STATE_CANCELLED_OK:
+ message = MessageManager.getString("label.state_job_cancelled");
+ break;
+
+ case STATE_STOPPED_ERROR:
+ message = MessageManager.getString("label.state_job_error");
+ break;
+
+ case STATE_STOPPED_SERVERERROR:
+ message = MessageManager.getString("label.server_error_try_later");
+ break;
+ }
+ titleText.setText(title + (message == null ? "" : " - " + message));
+ titleText.repaint();
}
/**
* @param e
* DOCUMENT ME!
*/
- protected void cancel_actionPerformed(ActionEvent e)
+ @Override
+protected void cancel_actionPerformed(ActionEvent e)
{
if (!serviceIsCancellable)
{
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
- public void run()
+ @Override
+ public void run()
{
JvOptionPane.showInternalMessageDialog(Desktop.desktop, message,
title, JvOptionPane.WARNING_MESSAGE);
BufferedImage offscreen;
- public void run()
+ @Override
+ public void run()
{
startTime = System.currentTimeMillis();
g.setColor(Color.white);
g.fillRect(0, 0, getWidth(), getHeight());
- g.setFont(new Font("Arial", Font.BOLD, 12));
- g.setColor(Color.black);
-
- switch (currentStatus)
- {
- case STATE_QUEUING:
- g.drawString(
- title.concat(" - ").concat(
- MessageManager.getString("label.state_queueing")),
- 60, 30);
-
- break;
-
- case STATE_RUNNING:
- g.drawString(
- title.concat(" - ").concat(
- MessageManager.getString("label.state_running")),
- 60, 30);
-
- break;
-
- case STATE_STOPPED_OK:
- g.drawString(
- title.concat(" - ").concat(
- MessageManager.getString("label.state_completed")),
- 60, 30);
-
- break;
-
- case STATE_CANCELLED_OK:
- g.drawString(
- title.concat(" - ")
- .concat(MessageManager
- .getString("label.state_job_cancelled")),
- 60, 30);
-
- break;
-
- case STATE_STOPPED_ERROR:
- g.drawString(
- title.concat(" - ").concat(
- MessageManager.getString("label.state_job_error")),
- 60, 30);
-
- break;
-
- case STATE_STOPPED_SERVERERROR:
- g.drawString(
- title.concat(" - ")
- .concat(MessageManager
- .getString("label.server_error_try_later")),
- 60, 30);
-
- break;
- }
-
if (image != null)
{
int x = image.getWidth(this) / 2, y = image.getHeight(this) / 2;
}
}
- public void paintComponent(Graphics g1)
+ @Override
+ public void paintComponent(Graphics g1)
{
drawPanel();
renderAsHtml = b;
}
- public void hyperlinkUpdate(HyperlinkEvent e)
+ @Override
+public void hyperlinkUpdate(HyperlinkEvent e)
{
Desktop.hyperlinkUpdate(e);
}
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
+import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
protected JPanel buttonPanel = new JPanel();
+ public JLabel titleText = new JLabel();
+
public JButton cancel = new JButton();
public JButton showResultsNewFrame = new JButton();
*/
private void jbInit() throws Exception
{
- infoText.setFont(new java.awt.Font("Verdana", 0, 10));
+ infoText.setFont(new Font("Verdana", 0, 10));
infoText.setBorder(null);
infoText.setEditable(false);
infoText.setText("");
titlePanel.setBackground(Color.white);
titlePanel.setPreferredSize(new Dimension(0, 60));
titlePanel.setLayout(borderLayout3);
+ titleText.setFont(new Font("Arial", Font.BOLD, 12));
+ titleText.setBorder(null);
+ titleText.setText("");
jScrollPane1.setBorder(null);
jScrollPane1.setPreferredSize(new Dimension(400, 70));
- cancel.setFont(new java.awt.Font("Verdana", 0, 11));
+ cancel.setFont(new Font("Verdana", 0, 11));
cancel.setText(MessageManager.getString("action.cancel"));
cancel.addActionListener(new java.awt.event.ActionListener()
{
- public void actionPerformed(ActionEvent e)
+ @Override
+ public void actionPerformed(ActionEvent e)
{
cancel_actionPerformed(e);
}