cddbb3bd64a00dc0fda661a83f69d19fa51c7233
[jalview.git] / src / jalview / jbgui / GWebserviceInfo.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.jbgui;
22
23 import jalview.util.MessageManager;
24
25 import java.awt.BorderLayout;
26 import java.awt.Color;
27 import java.awt.Dimension;
28 import java.awt.Font;
29 import java.awt.GridBagConstraints;
30 import java.awt.GridBagLayout;
31 import java.awt.GridLayout;
32 import java.awt.Insets;
33 import java.awt.event.ActionEvent;
34
35 import javax.swing.JButton;
36 import javax.swing.JLabel;
37 import javax.swing.JPanel;
38 import javax.swing.JScrollPane;
39 import javax.swing.JTextArea;
40
41 /**
42  * DOCUMENT ME!
43  * 
44  * @author $author$
45  * @version $Revision$
46  */
47 public class GWebserviceInfo extends JPanel
48 {
49   protected JTextArea infoText = new JTextArea();
50
51   JScrollPane jScrollPane1 = new JScrollPane();
52
53   JPanel jPanel1 = new JPanel();
54
55   BorderLayout borderLayout1 = new BorderLayout();
56
57   BorderLayout borderLayout2 = new BorderLayout();
58
59   protected JPanel titlePanel = new JPanel();
60
61   BorderLayout borderLayout3 = new BorderLayout();
62
63   protected JPanel buttonPanel = new JPanel();
64
65   public JLabel titleText = new JLabel();
66
67   public JButton cancel = new JButton();
68
69   public JButton showResultsNewFrame = new JButton();
70
71   public JButton mergeResults = new JButton();
72
73   GridBagLayout gridBagLayout1 = new GridBagLayout();
74
75   public JPanel statusPanel = new JPanel(new GridLayout());
76
77   public JLabel statusBar = new JLabel();
78
79   /**
80    * Creates a new GWebserviceInfo object.
81    */
82   public GWebserviceInfo()
83   {
84     try
85     {
86       jbInit();
87     } catch (Exception e)
88     {
89       e.printStackTrace();
90     }
91   }
92
93   /**
94    * DOCUMENT ME!
95    * 
96    * @throws Exception
97    *           DOCUMENT ME!
98    */
99   private void jbInit() throws Exception
100   {
101     infoText.setFont(new Font("Verdana", 0, 10));
102     infoText.setBorder(null);
103     infoText.setEditable(false);
104     infoText.setText("");
105     infoText.setLineWrap(true);
106     infoText.setWrapStyleWord(true);
107     this.setLayout(borderLayout1);
108     jPanel1.setLayout(borderLayout2);
109     titlePanel.setBackground(Color.white);
110     titlePanel.setPreferredSize(new Dimension(0, 60));
111     titlePanel.setLayout(borderLayout3);
112     titleText.setFont(new Font("Arial", Font.BOLD, 12));
113     titleText.setBorder(null);
114     titleText.setText("");
115     jScrollPane1.setBorder(null);
116     jScrollPane1.setPreferredSize(new Dimension(400, 70));
117     cancel.setFont(new Font("Verdana", 0, 11));
118     cancel.setText(MessageManager.getString("action.cancel"));
119     cancel.addActionListener(new java.awt.event.ActionListener()
120     {
121       @Override
122         public void actionPerformed(ActionEvent e)
123       {
124         cancel_actionPerformed(e);
125       }
126     });
127     buttonPanel.setLayout(gridBagLayout1);
128     buttonPanel.setOpaque(false);
129     showResultsNewFrame
130             .setText(MessageManager.getString("label.new_window"));
131     mergeResults.setText(MessageManager.getString("action.merge_results"));
132     this.setBackground(Color.white);
133     this.add(jPanel1, BorderLayout.NORTH);
134     jPanel1.add(jScrollPane1, BorderLayout.CENTER);
135     jScrollPane1.getViewport().add(infoText, null);
136     jPanel1.add(titlePanel, BorderLayout.NORTH);
137     titlePanel.add(buttonPanel, BorderLayout.EAST);
138     buttonPanel.add(cancel,
139             new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
140                     GridBagConstraints.CENTER, GridBagConstraints.NONE,
141                     new Insets(19, 6, 16, 4), 0, 0));
142     this.add(statusPanel, java.awt.BorderLayout.SOUTH);
143     statusPanel.add(statusBar, null);
144   }
145
146   /**
147    * DOCUMENT ME!
148    * 
149    * @param e
150    *          DOCUMENT ME!
151    */
152   protected void cancel_actionPerformed(ActionEvent e)
153   {
154   }
155 }