| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 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") |
| |
|
| 70.3% |
Uncovered Elements: 27 (91) |
Complexity: 21 |
Complexity Density: 0.3 |
|
| 42 |
|
public abstract class GStructureViewer extends JInternalFrame |
| 43 |
|
implements JalviewStructureDisplayI, ColourChangeListener |
| 44 |
|
{ |
| 45 |
|
|
| 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 |
|
|
| 79 |
|
|
| |
|
| 66.7% |
Uncovered Elements: 1 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 80 |
62 |
public GStructureViewer()... |
| 81 |
|
{ |
| 82 |
62 |
try |
| 83 |
|
{ |
| 84 |
62 |
jbInit(); |
| 85 |
|
} catch (Exception ex) |
| 86 |
|
{ |
| 87 |
0 |
ex.printStackTrace(); |
| 88 |
|
} |
| 89 |
|
} |
| 90 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (60) |
Complexity: 1 |
Complexity Density: 0.02 |
|
| 91 |
62 |
private void jbInit() throws Exception... |
| 92 |
|
{ |
| 93 |
62 |
setFrameIcon(null); |
| 94 |
62 |
setName("jalview-structureviewer"); |
| 95 |
|
|
| 96 |
62 |
JMenuBar menuBar = new JMenuBar(); |
| 97 |
62 |
this.setJMenuBar(menuBar); |
| 98 |
|
|
| 99 |
62 |
JMenu fileMenu = new JMenu(); |
| 100 |
62 |
fileMenu.setText(MessageManager.getString("action.file")); |
| 101 |
|
|
| 102 |
62 |
savemenu = new JMenu(); |
| 103 |
62 |
savemenu.setActionCommand( |
| 104 |
|
MessageManager.getString("action.save_image")); |
| 105 |
62 |
savemenu.setText(MessageManager.getString("action.save_as")); |
| 106 |
|
|
| 107 |
62 |
JMenuItem pdbFile = new JMenuItem(); |
| 108 |
62 |
pdbFile.setText(MessageManager.getString("label.pdb_file")); |
| 109 |
62 |
pdbFile.addActionListener(new ActionListener() |
| 110 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 111 |
0 |
@Override... |
| 112 |
|
public void actionPerformed(ActionEvent actionEvent) |
| 113 |
|
{ |
| 114 |
0 |
pdbFile_actionPerformed(); |
| 115 |
|
} |
| 116 |
|
}); |
| 117 |
|
|
| 118 |
62 |
JMenuItem png = new JMenuItem(); |
| 119 |
62 |
png.setText("PNG"); |
| 120 |
62 |
png.addActionListener(new ActionListener() |
| 121 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 122 |
0 |
@Override... |
| 123 |
|
public void actionPerformed(ActionEvent actionEvent) |
| 124 |
|
{ |
| 125 |
0 |
makePDBImage(TYPE.PNG); |
| 126 |
|
} |
| 127 |
|
}); |
| 128 |
|
|
| 129 |
62 |
JMenuItem eps = new JMenuItem(); |
| 130 |
62 |
eps.setText("EPS"); |
| 131 |
62 |
eps.addActionListener(new ActionListener() |
| 132 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 133 |
0 |
@Override... |
| 134 |
|
public void actionPerformed(ActionEvent actionEvent) |
| 135 |
|
{ |
| 136 |
0 |
makePDBImage(TYPE.EPS); |
| 137 |
|
} |
| 138 |
|
}); |
| 139 |
|
|
| 140 |
62 |
JMenuItem viewMapping = new JMenuItem(); |
| 141 |
62 |
viewMapping.setText(MessageManager.getString("label.view_mapping")); |
| 142 |
62 |
viewMapping.addActionListener(new ActionListener() |
| 143 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 144 |
0 |
@Override... |
| 145 |
|
public void actionPerformed(ActionEvent actionEvent) |
| 146 |
|
{ |
| 147 |
0 |
viewMapping_actionPerformed(); |
| 148 |
|
} |
| 149 |
|
}); |
| 150 |
|
|
| 151 |
62 |
viewMenu = new JMenu(); |
| 152 |
62 |
viewMenu.setText(MessageManager.getString("action.view")); |
| 153 |
|
|
| 154 |
62 |
chainMenu = new JMenu(); |
| 155 |
62 |
chainMenu.setText(MessageManager.getString("action.show_chain")); |
| 156 |
|
|
| 157 |
62 |
hetatmMenu = new JMenu(); |
| 158 |
62 |
hetatmMenu.setText(MessageManager.getString("action.show_hetatm")); |
| 159 |
|
|
| 160 |
62 |
fitToWindow = new JMenuItem(); |
| 161 |
62 |
fitToWindow.setText(MessageManager.getString("label.fit_to_window")); |
| 162 |
62 |
fitToWindow.addActionListener(new ActionListener() |
| 163 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 164 |
0 |
@Override... |
| 165 |
|
public void actionPerformed(ActionEvent actionEvent) |
| 166 |
|
{ |
| 167 |
0 |
fitToWindow_actionPerformed(); |
| 168 |
|
} |
| 169 |
|
}); |
| 170 |
|
|
| 171 |
62 |
JMenu helpMenu = new JMenu(); |
| 172 |
62 |
helpMenu.setText(MessageManager.getString("action.help")); |
| 173 |
62 |
helpItem = new JMenuItem(); |
| 174 |
62 |
helpItem.addActionListener(new ActionListener() |
| 175 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 176 |
0 |
@Override... |
| 177 |
|
public void actionPerformed(ActionEvent actionEvent) |
| 178 |
|
{ |
| 179 |
0 |
showHelp_actionPerformed(); |
| 180 |
|
} |
| 181 |
|
}); |
| 182 |
62 |
alignStructs = new JMenuItem(); |
| 183 |
62 |
alignStructs.setText( |
| 184 |
|
MessageManager.getString("label.superpose_structures")); |
| 185 |
62 |
alignStructs.addActionListener(new ActionListener() |
| 186 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 187 |
0 |
@Override... |
| 188 |
|
public void actionPerformed(ActionEvent actionEvent) |
| 189 |
|
{ |
| 190 |
0 |
alignStructsWithAllAlignPanels(); |
| 191 |
|
} |
| 192 |
|
}); |
| 193 |
|
|
| 194 |
62 |
viewerActionMenu = new JMenu(); |
| 195 |
62 |
viewerActionMenu.setVisible(false); |
| 196 |
62 |
viewerActionMenu.add(alignStructs); |
| 197 |
62 |
colourMenu = new JMenu(); |
| 198 |
62 |
colourMenu.setText(MessageManager.getString("label.colours")); |
| 199 |
62 |
fileMenu.add(savemenu); |
| 200 |
62 |
fileMenu.add(viewMapping); |
| 201 |
62 |
savemenu.add(pdbFile); |
| 202 |
62 |
savemenu.add(png); |
| 203 |
62 |
savemenu.add(eps); |
| 204 |
62 |
viewMenu.add(chainMenu); |
| 205 |
62 |
viewMenu.add(hetatmMenu); |
| 206 |
62 |
helpMenu.add(helpItem); |
| 207 |
|
|
| 208 |
62 |
menuBar.add(fileMenu); |
| 209 |
62 |
menuBar.add(viewMenu); |
| 210 |
62 |
menuBar.add(colourMenu); |
| 211 |
62 |
menuBar.add(viewerActionMenu); |
| 212 |
62 |
menuBar.add(helpMenu); |
| 213 |
|
|
| 214 |
62 |
statusPanel = new JPanel(); |
| 215 |
62 |
statusPanel.setLayout(new GridLayout()); |
| 216 |
62 |
this.getContentPane().add(statusPanel, BorderLayout.SOUTH); |
| 217 |
62 |
statusBar = new JLabel(); |
| 218 |
62 |
statusPanel.add(statusBar, null); |
| 219 |
|
} |
| 220 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 221 |
0 |
protected void fitToWindow_actionPerformed()... |
| 222 |
|
{ |
| 223 |
0 |
getBinding().focusView(); |
| 224 |
|
} |
| 225 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 226 |
0 |
protected void highlightSelection_actionPerformed()... |
| 227 |
|
{ |
| 228 |
|
} |
| 229 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 230 |
0 |
protected void viewerColour_actionPerformed()... |
| 231 |
|
{ |
| 232 |
|
} |
| 233 |
|
|
| 234 |
|
protected abstract String alignStructsWithAllAlignPanels(); |
| 235 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 236 |
0 |
public void pdbFile_actionPerformed()... |
| 237 |
|
{ |
| 238 |
|
|
| 239 |
|
} |
| 240 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 241 |
0 |
public void makePDBImage(TYPE imageType)... |
| 242 |
|
{ |
| 243 |
|
|
| 244 |
|
} |
| 245 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 246 |
0 |
public void viewMapping_actionPerformed()... |
| 247 |
|
{ |
| 248 |
|
|
| 249 |
|
} |
| 250 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 251 |
0 |
public void seqColour_actionPerformed()... |
| 252 |
|
{ |
| 253 |
|
|
| 254 |
|
} |
| 255 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 256 |
0 |
public void chainColour_actionPerformed()... |
| 257 |
|
{ |
| 258 |
|
|
| 259 |
|
} |
| 260 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 261 |
0 |
public void chargeColour_actionPerformed()... |
| 262 |
|
{ |
| 263 |
|
|
| 264 |
|
} |
| 265 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 266 |
0 |
public void background_actionPerformed()... |
| 267 |
|
{ |
| 268 |
|
|
| 269 |
|
} |
| 270 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 271 |
0 |
public void showHelp_actionPerformed()... |
| 272 |
|
{ |
| 273 |
|
|
| 274 |
|
} |
| 275 |
|
} |