Class |
Line # |
Actions |
|||
---|---|---|---|---|---|
GTreePanel | 41 | 71 | 31 |
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 | 14 | public GTreePanel() |
82 | { | |
83 | 14 | try |
84 | { | |
85 | 14 | jbInit(); |
86 | 14 | this.setJMenuBar(jMenuBar1); |
87 | } catch (Exception e) | |
88 | { | |
89 | 0 | e.printStackTrace(); |
90 | } | |
91 | } | |
92 | ||
93 | 14 | private void jbInit() throws Exception |
94 | { | |
95 | 14 | setFrameIcon(null); |
96 | 14 | setName("jalview-tree"); |
97 | 14 | this.getContentPane().setLayout(borderLayout1); |
98 | 14 | this.setBackground(Color.white); |
99 | 14 | this.setFont(new java.awt.Font("Verdana", 0, 12)); |
100 | 14 | scrollPane.setOpaque(false); |
101 | 14 | fileMenu.setText(MessageManager.getString("action.file")); |
102 | 14 | saveAsNewick.setText(MessageManager.getString("label.newick_format")); |
103 | 14 | saveAsNewick.addActionListener(new ActionListener() |
104 | { | |
105 | 0 | @Override |
106 | public void actionPerformed(ActionEvent e) | |
107 | { | |
108 | 0 | saveAsNewick_actionPerformed(e); |
109 | } | |
110 | }); | |
111 | 14 | printMenu.setText(MessageManager.getString("action.print")); |
112 | 14 | printMenu.addActionListener(new java.awt.event.ActionListener() |
113 | { | |
114 | 0 | @Override |
115 | public void actionPerformed(ActionEvent e) | |
116 | { | |
117 | 0 | printMenu_actionPerformed(e); |
118 | } | |
119 | }); | |
120 | 14 | viewMenu.setText(MessageManager.getString("action.view")); |
121 | 14 | viewMenu.addMenuListener(new MenuListener() |
122 | { | |
123 | 0 | @Override |
124 | public void menuSelected(MenuEvent e) | |
125 | { | |
126 | 0 | viewMenu_menuSelected(); |
127 | } | |
128 | ||
129 | 0 | @Override |
130 | public void menuDeselected(MenuEvent e) | |
131 | { | |
132 | } | |
133 | ||
134 | 0 | @Override |
135 | public void menuCanceled(MenuEvent e) | |
136 | { | |
137 | } | |
138 | }); | |
139 | 14 | sortAssocViews.setText( |
140 | MessageManager.getString("label.sort_alignment_by_tree")); | |
141 | 14 | sortAssocViews.addActionListener(new java.awt.event.ActionListener() |
142 | { | |
143 | 0 | @Override |
144 | public void actionPerformed(ActionEvent e) | |
145 | { | |
146 | 0 | sortByTree_actionPerformed(); |
147 | } | |
148 | }); | |
149 | 14 | font.setText(MessageManager.getString("action.font")); |
150 | 14 | font.addActionListener(new java.awt.event.ActionListener() |
151 | { | |
152 | 0 | @Override |
153 | public void actionPerformed(ActionEvent e) | |
154 | { | |
155 | 0 | font_actionPerformed(e); |
156 | } | |
157 | }); | |
158 | 14 | bootstrapMenu.setText( |
159 | MessageManager.getString("label.show_bootstrap_values")); | |
160 | 14 | bootstrapMenu.addActionListener(new java.awt.event.ActionListener() |
161 | { | |
162 | 0 | @Override |
163 | public void actionPerformed(ActionEvent e) | |
164 | { | |
165 | 0 | bootstrapMenu_actionPerformed(e); |
166 | } | |
167 | }); | |
168 | 14 | distanceMenu.setText(MessageManager.getString("label.show_distances")); |
169 | 14 | distanceMenu.addActionListener(new java.awt.event.ActionListener() |
170 | { | |
171 | 0 | @Override |
172 | public void actionPerformed(ActionEvent e) | |
173 | { | |
174 | 0 | distanceMenu_actionPerformed(e); |
175 | } | |
176 | }); | |
177 | 14 | fitToWindow.setSelected(true); |
178 | 14 | fitToWindow.setText(MessageManager.getString("label.fit_to_window")); |
179 | 14 | fitToWindow.addActionListener(new java.awt.event.ActionListener() |
180 | { | |
181 | 0 | @Override |
182 | public void actionPerformed(ActionEvent e) | |
183 | { | |
184 | 0 | fitToWindow_actionPerformed(e); |
185 | } | |
186 | }); | |
187 | 14 | epsTree.setText("EPS"); |
188 | 14 | epsTree.addActionListener(new java.awt.event.ActionListener() |
189 | { | |
190 | 0 | @Override |
191 | public void actionPerformed(ActionEvent e) | |
192 | { | |
193 | 0 | writeTreeImage(TYPE.EPS); |
194 | } | |
195 | }); | |
196 | 14 | pngTree.setText("PNG"); |
197 | 14 | pngTree.addActionListener(new java.awt.event.ActionListener() |
198 | { | |
199 | 0 | @Override |
200 | public void actionPerformed(ActionEvent e) | |
201 | { | |
202 | 0 | writeTreeImage(TYPE.PNG); |
203 | } | |
204 | }); | |
205 | 14 | saveAsMenu.setText(MessageManager.getString("action.save_as")); |
206 | 14 | placeholdersMenu.setToolTipText(MessageManager.getString( |
207 | "label.marks_leaves_tree_not_associated_with_sequence")); | |
208 | 14 | placeholdersMenu.setText( |
209 | MessageManager.getString("label.mark_unlinked_leaves")); | |
210 | 14 | placeholdersMenu.addActionListener(new ActionListener() |
211 | { | |
212 | 0 | @Override |
213 | public void actionPerformed(ActionEvent e) | |
214 | { | |
215 | 0 | placeholdersMenu_actionPerformed(e); |
216 | } | |
217 | }); | |
218 | 14 | textbox.setText(MessageManager.getString("label.out_to_textbox")); |
219 | 14 | textbox.addActionListener(new ActionListener() |
220 | { | |
221 | 0 | @Override |
222 | public void actionPerformed(ActionEvent e) | |
223 | { | |
224 | 0 | textbox_actionPerformed(e); |
225 | } | |
226 | }); | |
227 | 14 | originalSeqData.setText(MessageManager.getString("label.input_data")); |
228 | 14 | originalSeqData.addActionListener(new ActionListener() |
229 | { | |
230 | 0 | @Override |
231 | public void actionPerformed(ActionEvent e) | |
232 | { | |
233 | 0 | originalSeqData_actionPerformed(e); |
234 | } | |
235 | }); | |
236 | 14 | associateLeavesMenu.setText( |
237 | MessageManager.getString("label.associate_leaves_with")); | |
238 | 14 | this.getContentPane().add(scrollPane, BorderLayout.CENTER); |
239 | 14 | jMenuBar1.add(fileMenu); |
240 | 14 | jMenuBar1.add(viewMenu); |
241 | 14 | fileMenu.add(saveAsMenu); |
242 | 14 | fileMenu.add(textbox); |
243 | 14 | fileMenu.add(printMenu); |
244 | 14 | fileMenu.add(originalSeqData); |
245 | 14 | viewMenu.add(fitToWindow); |
246 | 14 | viewMenu.add(font); |
247 | 14 | viewMenu.add(distanceMenu); |
248 | 14 | viewMenu.add(bootstrapMenu); |
249 | 14 | viewMenu.add(placeholdersMenu); |
250 | 14 | viewMenu.add(sortAssocViews); |
251 | 14 | viewMenu.add(associateLeavesMenu); |
252 | 14 | saveAsMenu.add(saveAsNewick); |
253 | 14 | saveAsMenu.add(epsTree); |
254 | 14 | saveAsMenu.add(pngTree); |
255 | } | |
256 | ||
257 | 0 | public void printMenu_actionPerformed(ActionEvent e) |
258 | { | |
259 | } | |
260 | ||
261 | 0 | public void font_actionPerformed(ActionEvent e) |
262 | { | |
263 | } | |
264 | ||
265 | 0 | public void distanceMenu_actionPerformed(ActionEvent e) |
266 | { | |
267 | } | |
268 | ||
269 | 0 | public void bootstrapMenu_actionPerformed(ActionEvent e) |
270 | { | |
271 | } | |
272 | ||
273 | 0 | public void fitToWindow_actionPerformed(ActionEvent e) |
274 | { | |
275 | } | |
276 | ||
277 | 0 | public void writeTreeImage(TYPE imageType) |
278 | { | |
279 | } | |
280 | ||
281 | 0 | public void saveAsNewick_actionPerformed(ActionEvent e) |
282 | { | |
283 | } | |
284 | ||
285 | 0 | public void placeholdersMenu_actionPerformed(ActionEvent e) |
286 | { | |
287 | } | |
288 | ||
289 | 0 | public void textbox_actionPerformed(ActionEvent e) |
290 | { | |
291 | } | |
292 | ||
293 | 0 | public void fullid_actionPerformed(ActionEvent e) |
294 | { | |
295 | ||
296 | } | |
297 | ||
298 | 0 | public void originalSeqData_actionPerformed(ActionEvent e) |
299 | { | |
300 | ||
301 | } | |
302 | ||
303 | 0 | public void viewMenu_menuSelected() |
304 | { | |
305 | } | |
306 | ||
307 | 0 | public void sortByTree_actionPerformed() |
308 | { | |
309 | ||
310 | } | |
311 | ||
312 | } |