Clover icon

Coverage Report

  1. Project Clover database Thu Nov 7 2024 17:01:39 GMT
  2. Package jalview.jbgui

File GStructureViewer.java

 

Coverage histogram

../../img/srcFileCovDistChart0.png
0% of files have more coverage

Code metrics

0
71
20
1
275
195
21
0.3
3.55
20
1.05

Classes

Class Line # Actions
GStructureViewer 42 71 21
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

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.GridLayout;
25    import java.awt.event.ActionEvent;
26    import java.awt.event.ActionListener;
27   
28    import javax.swing.JInternalFrame;
29    import javax.swing.JLabel;
30    import javax.swing.JMenu;
31    import javax.swing.JMenuBar;
32    import javax.swing.JMenuItem;
33    import javax.swing.JPanel;
34    import javax.swing.JRadioButtonMenuItem;
35   
36    import jalview.api.structures.JalviewStructureDisplayI;
37    import jalview.gui.ColourMenuHelper.ColourChangeListener;
38    import jalview.util.ImageMaker.TYPE;
39    import jalview.util.MessageManager;
40   
41    @SuppressWarnings("serial")
 
42    public abstract class GStructureViewer extends JInternalFrame
43    implements JalviewStructureDisplayI, ColourChangeListener
44    {
45    // private AAStructureBindingModel bindingModel;
46   
47    protected JMenu savemenu;
48   
49    protected JMenu viewMenu;
50   
51    protected JMenu colourMenu;
52   
53    protected JMenu chainMenu;
54   
55    protected JMenu hetatmMenu;
56   
57    protected JMenu viewerActionMenu;
58   
59    protected JMenuItem alignStructs;
60   
61    protected JMenuItem fitToWindow;
62   
63    protected JRadioButtonMenuItem seqColour;
64   
65    protected JRadioButtonMenuItem chainColour;
66   
67    protected JRadioButtonMenuItem chargeColour;
68   
69    protected JRadioButtonMenuItem viewerColour;
70   
71    protected JMenuItem helpItem;
72   
73    protected JLabel statusBar;
74   
75    protected JPanel statusPanel;
76   
77    /**
78    * Constructor
79    */
 
80  0 toggle public GStructureViewer()
81    {
82  0 try
83    {
84  0 jbInit();
85    } catch (Exception ex)
86    {
87  0 ex.printStackTrace();
88    }
89    }
90   
 
91  0 toggle private void jbInit() throws Exception
92    {
93  0 setFrameIcon(null);
94  0 setName("jalview-structureviewer");
95   
96  0 JMenuBar menuBar = new JMenuBar();
97  0 this.setJMenuBar(menuBar);
98   
99  0 JMenu fileMenu = new JMenu();
100  0 fileMenu.setText(MessageManager.getString("action.file"));
101   
102  0 savemenu = new JMenu();
103  0 savemenu.setActionCommand(
104    MessageManager.getString("action.save_image"));
105  0 savemenu.setText(MessageManager.getString("action.save_as"));
106   
107  0 JMenuItem pdbFile = new JMenuItem();
108  0 pdbFile.setText(MessageManager.getString("label.pdb_file"));
109  0 pdbFile.addActionListener(new ActionListener()
110    {
 
111  0 toggle @Override
112    public void actionPerformed(ActionEvent actionEvent)
113    {
114  0 pdbFile_actionPerformed();
115    }
116    });
117   
118  0 JMenuItem png = new JMenuItem();
119  0 png.setText("PNG");
120  0 png.addActionListener(new ActionListener()
121    {
 
122  0 toggle @Override
123    public void actionPerformed(ActionEvent actionEvent)
124    {
125  0 makePDBImage(TYPE.PNG);
126    }
127    });
128   
129  0 JMenuItem eps = new JMenuItem();
130  0 eps.setText("EPS");
131  0 eps.addActionListener(new ActionListener()
132    {
 
133  0 toggle @Override
134    public void actionPerformed(ActionEvent actionEvent)
135    {
136  0 makePDBImage(TYPE.EPS);
137    }
138    });
139   
140  0 JMenuItem viewMapping = new JMenuItem();
141  0 viewMapping.setText(MessageManager.getString("label.view_mapping"));
142  0 viewMapping.addActionListener(new ActionListener()
143    {
 
144  0 toggle @Override
145    public void actionPerformed(ActionEvent actionEvent)
146    {
147  0 viewMapping_actionPerformed();
148    }
149    });
150   
151  0 viewMenu = new JMenu();
152  0 viewMenu.setText(MessageManager.getString("action.view"));
153   
154  0 chainMenu = new JMenu();
155  0 chainMenu.setText(MessageManager.getString("action.show_chain"));
156   
157  0 hetatmMenu = new JMenu();
158  0 hetatmMenu.setText(MessageManager.getString("action.show_hetatm"));
159   
160  0 fitToWindow = new JMenuItem();
161  0 fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
162  0 fitToWindow.addActionListener(new ActionListener()
163    {
 
164  0 toggle @Override
165    public void actionPerformed(ActionEvent actionEvent)
166    {
167  0 fitToWindow_actionPerformed();
168    }
169    });
170   
171  0 JMenu helpMenu = new JMenu();
172  0 helpMenu.setText(MessageManager.getString("action.help"));
173  0 helpItem = new JMenuItem();
174  0 helpItem.addActionListener(new ActionListener()
175    {
 
176  0 toggle @Override
177    public void actionPerformed(ActionEvent actionEvent)
178    {
179  0 showHelp_actionPerformed();
180    }
181    });
182  0 alignStructs = new JMenuItem();
183  0 alignStructs.setText(
184    MessageManager.getString("label.superpose_structures"));
185  0 alignStructs.addActionListener(new ActionListener()
186    {
 
187  0 toggle @Override
188    public void actionPerformed(ActionEvent actionEvent)
189    {
190  0 alignStructsWithAllAlignPanels();
191    }
192    });
193   
194  0 viewerActionMenu = new JMenu(); // text set in sub-classes
195  0 viewerActionMenu.setVisible(false);
196  0 viewerActionMenu.add(alignStructs);
197  0 colourMenu = new JMenu();
198  0 colourMenu.setText(MessageManager.getString("label.colours"));
199  0 fileMenu.add(savemenu);
200  0 fileMenu.add(viewMapping);
201  0 savemenu.add(pdbFile);
202  0 savemenu.add(png);
203  0 savemenu.add(eps);
204  0 viewMenu.add(chainMenu);
205  0 viewMenu.add(hetatmMenu);
206  0 helpMenu.add(helpItem);
207   
208  0 menuBar.add(fileMenu);
209  0 menuBar.add(viewMenu);
210  0 menuBar.add(colourMenu);
211  0 menuBar.add(viewerActionMenu);
212  0 menuBar.add(helpMenu);
213   
214  0 statusPanel = new JPanel();
215  0 statusPanel.setLayout(new GridLayout());
216  0 this.getContentPane().add(statusPanel, BorderLayout.SOUTH);
217  0 statusBar = new JLabel();
218  0 statusPanel.add(statusBar, null);
219    }
220   
 
221  0 toggle protected void fitToWindow_actionPerformed()
222    {
223  0 getBinding().focusView();
224    }
225   
 
226  0 toggle protected void highlightSelection_actionPerformed()
227    {
228    }
229   
 
230  0 toggle protected void viewerColour_actionPerformed()
231    {
232    }
233   
234    protected abstract String alignStructsWithAllAlignPanels();
235   
 
236  0 toggle public void pdbFile_actionPerformed()
237    {
238   
239    }
240   
 
241  0 toggle public void makePDBImage(TYPE imageType)
242    {
243   
244    }
245   
 
246  0 toggle public void viewMapping_actionPerformed()
247    {
248   
249    }
250   
 
251  0 toggle public void seqColour_actionPerformed()
252    {
253   
254    }
255   
 
256  0 toggle public void chainColour_actionPerformed()
257    {
258   
259    }
260   
 
261  0 toggle public void chargeColour_actionPerformed()
262    {
263   
264    }
265   
 
266  0 toggle public void background_actionPerformed()
267    {
268   
269    }
270   
 
271  0 toggle public void showHelp_actionPerformed()
272    {
273   
274    }
275    }