Merge branch 'develop' into feature/JAL-3416_update_to_flatlaf_3.1.1_with_unpacked_na...
[jalview.git] / src / jalview / jbgui / GTreePanel.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 java.awt.BorderLayout;
24 import java.awt.Color;
25 import java.awt.event.ActionEvent;
26 import java.awt.event.ActionListener;
27
28 import javax.swing.JCheckBoxMenuItem;
29 import javax.swing.JInternalFrame;
30 import javax.swing.JMenu;
31 import javax.swing.JMenuBar;
32 import javax.swing.JMenuItem;
33 import javax.swing.JScrollPane;
34 import javax.swing.event.MenuEvent;
35 import javax.swing.event.MenuListener;
36
37 import jalview.util.ImageMaker.TYPE;
38 import jalview.util.MessageManager;
39
40 @SuppressWarnings("serial")
41 public class GTreePanel extends JInternalFrame
42 {
43   BorderLayout borderLayout1 = new BorderLayout();
44
45   public JScrollPane scrollPane = new JScrollPane();
46
47   JMenuBar jMenuBar1 = new JMenuBar();
48
49   JMenu fileMenu = new JMenu();
50
51   JMenuItem saveAsNewick = new JMenuItem();
52
53   JMenuItem printMenu = new JMenuItem();
54
55   protected JMenu viewMenu = new JMenu();
56
57   public JMenuItem font = new JMenuItem();
58
59   public JMenuItem sortAssocViews = new JMenuItem();
60
61   public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
62
63   public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
64
65   public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
66
67   public JCheckBoxMenuItem placeholdersMenu = new JCheckBoxMenuItem();
68
69   JMenuItem pngTree = new JMenuItem();
70
71   JMenuItem epsTree = new JMenuItem();
72
73   JMenu saveAsMenu = new JMenu();
74
75   JMenuItem textbox = new JMenuItem();
76
77   public JMenuItem originalSeqData = new JMenuItem();
78
79   protected JMenu associateLeavesMenu = new JMenu();
80
81   public GTreePanel()
82   {
83     try
84     {
85       jbInit();
86       this.setJMenuBar(jMenuBar1);
87     } catch (Exception e)
88     {
89       e.printStackTrace();
90     }
91   }
92
93   private void jbInit() throws Exception
94   {
95     setFrameIcon(null);
96     setName("jalview-tree");
97     this.getContentPane().setLayout(borderLayout1);
98     this.setBackground(Color.white);
99     this.setFont(new java.awt.Font("Verdana", 0, 12));
100     scrollPane.setOpaque(false);
101     fileMenu.setText(MessageManager.getString("action.file"));
102     saveAsNewick.setText(MessageManager.getString("label.newick_format"));
103     saveAsNewick.addActionListener(new ActionListener()
104     {
105       @Override
106       public void actionPerformed(ActionEvent e)
107       {
108         saveAsNewick_actionPerformed(e);
109       }
110     });
111     printMenu.setText(MessageManager.getString("action.print"));
112     printMenu.addActionListener(new java.awt.event.ActionListener()
113     {
114       @Override
115       public void actionPerformed(ActionEvent e)
116       {
117         printMenu_actionPerformed(e);
118       }
119     });
120     viewMenu.setText(MessageManager.getString("action.view"));
121     viewMenu.addMenuListener(new MenuListener()
122     {
123       @Override
124       public void menuSelected(MenuEvent e)
125       {
126         viewMenu_menuSelected();
127       }
128
129       @Override
130       public void menuDeselected(MenuEvent e)
131       {
132       }
133
134       @Override
135       public void menuCanceled(MenuEvent e)
136       {
137       }
138     });
139     sortAssocViews.setText(
140             MessageManager.getString("label.sort_alignment_by_tree"));
141     sortAssocViews.addActionListener(new java.awt.event.ActionListener()
142     {
143       @Override
144       public void actionPerformed(ActionEvent e)
145       {
146         sortByTree_actionPerformed();
147       }
148     });
149     font.setText(MessageManager.getString("action.font"));
150     font.addActionListener(new java.awt.event.ActionListener()
151     {
152       @Override
153       public void actionPerformed(ActionEvent e)
154       {
155         font_actionPerformed(e);
156       }
157     });
158     bootstrapMenu.setText(
159             MessageManager.getString("label.show_bootstrap_values"));
160     bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
161     {
162       @Override
163       public void actionPerformed(ActionEvent e)
164       {
165         bootstrapMenu_actionPerformed(e);
166       }
167     });
168     distanceMenu.setText(MessageManager.getString("label.show_distances"));
169     distanceMenu.addActionListener(new java.awt.event.ActionListener()
170     {
171       @Override
172       public void actionPerformed(ActionEvent e)
173       {
174         distanceMenu_actionPerformed(e);
175       }
176     });
177     fitToWindow.setSelected(true);
178     fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
179     fitToWindow.addActionListener(new java.awt.event.ActionListener()
180     {
181       @Override
182       public void actionPerformed(ActionEvent e)
183       {
184         fitToWindow_actionPerformed(e);
185       }
186     });
187     epsTree.setText("EPS");
188     epsTree.addActionListener(new java.awt.event.ActionListener()
189     {
190       @Override
191       public void actionPerformed(ActionEvent e)
192       {
193         writeTreeImage(TYPE.EPS);
194       }
195     });
196     pngTree.setText("PNG");
197     pngTree.addActionListener(new java.awt.event.ActionListener()
198     {
199       @Override
200       public void actionPerformed(ActionEvent e)
201       {
202         writeTreeImage(TYPE.PNG);
203       }
204     });
205     saveAsMenu.setText(MessageManager.getString("action.save_as"));
206     placeholdersMenu.setToolTipText(MessageManager.getString(
207             "label.marks_leaves_tree_not_associated_with_sequence"));
208     placeholdersMenu.setText(
209             MessageManager.getString("label.mark_unlinked_leaves"));
210     placeholdersMenu.addActionListener(new ActionListener()
211     {
212       @Override
213       public void actionPerformed(ActionEvent e)
214       {
215         placeholdersMenu_actionPerformed(e);
216       }
217     });
218     textbox.setText(MessageManager.getString("label.out_to_textbox"));
219     textbox.addActionListener(new ActionListener()
220     {
221       @Override
222       public void actionPerformed(ActionEvent e)
223       {
224         textbox_actionPerformed(e);
225       }
226     });
227     originalSeqData.setText(MessageManager.getString("label.input_data"));
228     originalSeqData.addActionListener(new ActionListener()
229     {
230       @Override
231       public void actionPerformed(ActionEvent e)
232       {
233         originalSeqData_actionPerformed(e);
234       }
235     });
236     associateLeavesMenu.setText(
237             MessageManager.getString("label.associate_leaves_with"));
238     this.getContentPane().add(scrollPane, BorderLayout.CENTER);
239     jMenuBar1.add(fileMenu);
240     jMenuBar1.add(viewMenu);
241     fileMenu.add(saveAsMenu);
242     fileMenu.add(textbox);
243     fileMenu.add(printMenu);
244     fileMenu.add(originalSeqData);
245     viewMenu.add(fitToWindow);
246     viewMenu.add(font);
247     viewMenu.add(distanceMenu);
248     viewMenu.add(bootstrapMenu);
249     viewMenu.add(placeholdersMenu);
250     viewMenu.add(sortAssocViews);
251     viewMenu.add(associateLeavesMenu);
252     saveAsMenu.add(saveAsNewick);
253     saveAsMenu.add(epsTree);
254     saveAsMenu.add(pngTree);
255   }
256
257   public void printMenu_actionPerformed(ActionEvent e)
258   {
259   }
260
261   public void font_actionPerformed(ActionEvent e)
262   {
263   }
264
265   public void distanceMenu_actionPerformed(ActionEvent e)
266   {
267   }
268
269   public void bootstrapMenu_actionPerformed(ActionEvent e)
270   {
271   }
272
273   public void fitToWindow_actionPerformed(ActionEvent e)
274   {
275   }
276
277   public void writeTreeImage(TYPE imageType)
278   {
279   }
280
281   public void saveAsNewick_actionPerformed(ActionEvent e)
282   {
283   }
284
285   public void placeholdersMenu_actionPerformed(ActionEvent e)
286   {
287   }
288
289   public void textbox_actionPerformed(ActionEvent e)
290   {
291   }
292
293   public void fullid_actionPerformed(ActionEvent e)
294   {
295
296   }
297
298   public void originalSeqData_actionPerformed(ActionEvent e)
299   {
300
301   }
302
303   public void viewMenu_menuSelected()
304   {
305   }
306
307   public void sortByTree_actionPerformed()
308   {
309
310   }
311
312 }