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