| 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.Color; |
| 25 |
|
import java.awt.FlowLayout; |
| 26 |
|
import java.awt.Font; |
| 27 |
|
import java.awt.GridLayout; |
| 28 |
|
import java.awt.event.ActionEvent; |
| 29 |
|
import java.awt.event.ActionListener; |
| 30 |
|
|
| 31 |
|
import javax.swing.JButton; |
| 32 |
|
import javax.swing.JCheckBoxMenuItem; |
| 33 |
|
import javax.swing.JComboBox; |
| 34 |
|
import javax.swing.JInternalFrame; |
| 35 |
|
import javax.swing.JLabel; |
| 36 |
|
import javax.swing.JMenu; |
| 37 |
|
import javax.swing.JMenuBar; |
| 38 |
|
import javax.swing.JMenuItem; |
| 39 |
|
import javax.swing.JPanel; |
| 40 |
|
import javax.swing.event.MenuEvent; |
| 41 |
|
import javax.swing.event.MenuListener; |
| 42 |
|
|
| 43 |
|
import jalview.util.ImageMaker.TYPE; |
| 44 |
|
import jalview.util.MessageManager; |
| 45 |
|
|
| |
|
| 68.7% |
Uncovered Elements: 46 (147) |
Complexity: 34 |
Complexity Density: 0.3 |
|
| 46 |
|
public class GPCAPanel extends JInternalFrame |
| 47 |
|
{ |
| 48 |
|
private static final Font VERDANA_12 = new Font("Verdana", 0, 12); |
| 49 |
|
|
| 50 |
|
protected JComboBox<String> xCombobox = new JComboBox<>(); |
| 51 |
|
|
| 52 |
|
protected JComboBox<String> yCombobox = new JComboBox<>(); |
| 53 |
|
|
| 54 |
|
protected JComboBox<String> zCombobox = new JComboBox<>(); |
| 55 |
|
|
| 56 |
|
protected JMenu viewMenu = new JMenu(); |
| 57 |
|
|
| 58 |
|
protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem(); |
| 59 |
|
|
| 60 |
|
protected JMenu associateViewsMenu = new JMenu(); |
| 61 |
|
|
| 62 |
|
protected JLabel statusBar = new JLabel(); |
| 63 |
|
|
| 64 |
|
protected JPanel statusPanel = new JPanel(); |
| 65 |
|
|
| 66 |
|
protected JMenuItem originalSeqData; |
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| |
|
| 88.9% |
Uncovered Elements: 1 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
| 71 |
2 |
public GPCAPanel()... |
| 72 |
|
{ |
| 73 |
2 |
try |
| 74 |
|
{ |
| 75 |
2 |
jbInit(); |
| 76 |
|
} catch (Exception e) |
| 77 |
|
{ |
| 78 |
0 |
e.printStackTrace(); |
| 79 |
|
} |
| 80 |
|
|
| 81 |
16 |
for (int i = 1; i < 8; i++) |
| 82 |
|
{ |
| 83 |
14 |
xCombobox.addItem("dim " + i); |
| 84 |
14 |
yCombobox.addItem("dim " + i); |
| 85 |
14 |
zCombobox.addItem("dim " + i); |
| 86 |
|
} |
| 87 |
|
} |
| 88 |
|
|
| |
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
| 89 |
0 |
public GPCAPanel(int dim)... |
| 90 |
|
{ |
| 91 |
0 |
try |
| 92 |
|
{ |
| 93 |
0 |
jbInit(); |
| 94 |
|
} catch (Exception e) |
| 95 |
|
{ |
| 96 |
0 |
e.printStackTrace(); |
| 97 |
|
} |
| 98 |
|
|
| 99 |
0 |
for (int i = 1; i <= dim; i++) |
| 100 |
|
{ |
| 101 |
0 |
xCombobox.addItem("dim " + i); |
| 102 |
0 |
yCombobox.addItem("dim " + i); |
| 103 |
0 |
zCombobox.addItem("dim " + i); |
| 104 |
|
} |
| 105 |
|
} |
| 106 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (85) |
Complexity: 1 |
Complexity Density: 0.01 |
|
| 107 |
2 |
private void jbInit() throws Exception... |
| 108 |
|
{ |
| 109 |
2 |
setFrameIcon(null); |
| 110 |
2 |
setName("jalview-pca"); |
| 111 |
2 |
this.getContentPane().setLayout(new BorderLayout()); |
| 112 |
2 |
JPanel jPanel2 = new JPanel(); |
| 113 |
2 |
jPanel2.setLayout(new FlowLayout()); |
| 114 |
2 |
JLabel jLabel1 = new JLabel(); |
| 115 |
2 |
jLabel1.setFont(VERDANA_12); |
| 116 |
2 |
jLabel1.setText("x="); |
| 117 |
2 |
JLabel jLabel2 = new JLabel(); |
| 118 |
2 |
jLabel2.setFont(VERDANA_12); |
| 119 |
2 |
jLabel2.setText("y="); |
| 120 |
2 |
JLabel jLabel3 = new JLabel(); |
| 121 |
2 |
jLabel3.setFont(VERDANA_12); |
| 122 |
2 |
jLabel3.setText("z="); |
| 123 |
2 |
jPanel2.setBackground(Color.white); |
| 124 |
2 |
jPanel2.setBorder(null); |
| 125 |
2 |
zCombobox.setFont(VERDANA_12); |
| 126 |
2 |
zCombobox.addActionListener(new ActionListener() |
| 127 |
|
{ |
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 128 |
4 |
@Override... |
| 129 |
|
public void actionPerformed(ActionEvent e) |
| 130 |
|
{ |
| 131 |
4 |
doDimensionChange(); |
| 132 |
|
} |
| 133 |
|
}); |
| 134 |
2 |
yCombobox.setFont(VERDANA_12); |
| 135 |
2 |
yCombobox.addActionListener(new ActionListener() |
| 136 |
|
{ |
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 137 |
4 |
@Override... |
| 138 |
|
public void actionPerformed(ActionEvent e) |
| 139 |
|
{ |
| 140 |
4 |
doDimensionChange(); |
| 141 |
|
} |
| 142 |
|
}); |
| 143 |
2 |
xCombobox.setFont(VERDANA_12); |
| 144 |
2 |
xCombobox.addActionListener(new ActionListener() |
| 145 |
|
{ |
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 146 |
4 |
@Override... |
| 147 |
|
public void actionPerformed(ActionEvent e) |
| 148 |
|
{ |
| 149 |
4 |
doDimensionChange(); |
| 150 |
|
} |
| 151 |
|
}); |
| 152 |
2 |
JButton resetButton = new JButton(); |
| 153 |
2 |
resetButton.setFont(VERDANA_12); |
| 154 |
2 |
resetButton.setText(MessageManager.getString("action.reset")); |
| 155 |
2 |
resetButton.addActionListener(new ActionListener() |
| 156 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 157 |
0 |
@Override... |
| 158 |
|
public void actionPerformed(ActionEvent e) |
| 159 |
|
{ |
| 160 |
0 |
resetButton_actionPerformed(); |
| 161 |
|
} |
| 162 |
|
}); |
| 163 |
2 |
JMenu fileMenu = new JMenu(); |
| 164 |
2 |
fileMenu.setText(MessageManager.getString("action.file")); |
| 165 |
2 |
JMenu saveMenu = new JMenu(); |
| 166 |
2 |
saveMenu.setText(MessageManager.getString("action.save_as")); |
| 167 |
2 |
JMenuItem eps = new JMenuItem("EPS"); |
| 168 |
2 |
eps.addActionListener(new ActionListener() |
| 169 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 170 |
0 |
@Override... |
| 171 |
|
public void actionPerformed(ActionEvent e) |
| 172 |
|
{ |
| 173 |
0 |
makePCAImage(TYPE.EPS); |
| 174 |
|
} |
| 175 |
|
}); |
| 176 |
2 |
JMenuItem png = new JMenuItem("PNG"); |
| 177 |
2 |
png.addActionListener(new ActionListener() |
| 178 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 179 |
0 |
@Override... |
| 180 |
|
public void actionPerformed(ActionEvent e) |
| 181 |
|
{ |
| 182 |
0 |
makePCAImage(TYPE.PNG); |
| 183 |
|
} |
| 184 |
|
}); |
| 185 |
2 |
JMenuItem outputValues = new JMenuItem(); |
| 186 |
2 |
outputValues.setText(MessageManager.getString("label.output_values")); |
| 187 |
2 |
outputValues.addActionListener(new ActionListener() |
| 188 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 189 |
0 |
@Override... |
| 190 |
|
public void actionPerformed(ActionEvent e) |
| 191 |
|
{ |
| 192 |
0 |
outputValues_actionPerformed(); |
| 193 |
|
} |
| 194 |
|
}); |
| 195 |
2 |
JMenuItem outputPoints = new JMenuItem(); |
| 196 |
2 |
outputPoints.setText(MessageManager.getString("label.output_points")); |
| 197 |
2 |
outputPoints.addActionListener(new ActionListener() |
| 198 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 199 |
0 |
@Override... |
| 200 |
|
public void actionPerformed(ActionEvent e) |
| 201 |
|
{ |
| 202 |
0 |
outputPoints_actionPerformed(); |
| 203 |
|
} |
| 204 |
|
}); |
| 205 |
2 |
JMenuItem outputProjPoints = new JMenuItem(); |
| 206 |
2 |
outputProjPoints.setText( |
| 207 |
|
MessageManager.getString("label.output_transformed_points")); |
| 208 |
2 |
outputProjPoints.addActionListener(new ActionListener() |
| 209 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 210 |
0 |
@Override... |
| 211 |
|
public void actionPerformed(ActionEvent e) |
| 212 |
|
{ |
| 213 |
0 |
outputProjPoints_actionPerformed(); |
| 214 |
|
} |
| 215 |
|
}); |
| 216 |
2 |
JMenuItem print = new JMenuItem(); |
| 217 |
2 |
print.setText(MessageManager.getString("action.print")); |
| 218 |
2 |
print.addActionListener(new ActionListener() |
| 219 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 220 |
0 |
@Override... |
| 221 |
|
public void actionPerformed(ActionEvent e) |
| 222 |
|
{ |
| 223 |
0 |
print_actionPerformed(); |
| 224 |
|
} |
| 225 |
|
}); |
| 226 |
2 |
viewMenu.setText(MessageManager.getString("action.view")); |
| 227 |
2 |
viewMenu.addMenuListener(new MenuListener() |
| 228 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 229 |
0 |
@Override... |
| 230 |
|
public void menuSelected(MenuEvent e) |
| 231 |
|
{ |
| 232 |
0 |
viewMenu_menuSelected(); |
| 233 |
|
} |
| 234 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 235 |
0 |
@Override... |
| 236 |
|
public void menuDeselected(MenuEvent e) |
| 237 |
|
{ |
| 238 |
|
} |
| 239 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 240 |
0 |
@Override... |
| 241 |
|
public void menuCanceled(MenuEvent e) |
| 242 |
|
{ |
| 243 |
|
} |
| 244 |
|
}); |
| 245 |
2 |
showLabels.setText(MessageManager.getString("label.show_labels")); |
| 246 |
2 |
showLabels.addActionListener(new ActionListener() |
| 247 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 248 |
0 |
@Override... |
| 249 |
|
public void actionPerformed(ActionEvent e) |
| 250 |
|
{ |
| 251 |
0 |
showLabels_actionPerformed(); |
| 252 |
|
} |
| 253 |
|
}); |
| 254 |
2 |
JMenuItem bgcolour = new JMenuItem(); |
| 255 |
2 |
bgcolour.setText(MessageManager.getString("action.background_colour")); |
| 256 |
2 |
bgcolour.addActionListener(new ActionListener() |
| 257 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 258 |
0 |
@Override... |
| 259 |
|
public void actionPerformed(ActionEvent e) |
| 260 |
|
{ |
| 261 |
0 |
bgcolour_actionPerformed(); |
| 262 |
|
} |
| 263 |
|
}); |
| 264 |
2 |
originalSeqData = new JMenuItem(); |
| 265 |
2 |
originalSeqData.setText(MessageManager.getString("label.input_data")); |
| 266 |
2 |
originalSeqData.addActionListener(new ActionListener() |
| 267 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 268 |
0 |
@Override... |
| 269 |
|
public void actionPerformed(ActionEvent e) |
| 270 |
|
{ |
| 271 |
0 |
originalSeqData_actionPerformed(); |
| 272 |
|
} |
| 273 |
|
}); |
| 274 |
2 |
associateViewsMenu.setText( |
| 275 |
|
MessageManager.getString("label.associate_nodes_with")); |
| 276 |
|
|
| 277 |
2 |
statusPanel.setLayout(new GridLayout()); |
| 278 |
2 |
statusBar.setFont(VERDANA_12); |
| 279 |
|
|
| 280 |
|
|
| 281 |
|
|
| 282 |
2 |
JPanel panelBar = new JPanel(new BorderLayout()); |
| 283 |
2 |
panelBar.add(jPanel2, BorderLayout.NORTH); |
| 284 |
2 |
panelBar.add(statusPanel, BorderLayout.SOUTH); |
| 285 |
2 |
this.getContentPane().add(panelBar, BorderLayout.SOUTH); |
| 286 |
2 |
jPanel2.add(jLabel1, null); |
| 287 |
2 |
jPanel2.add(xCombobox, null); |
| 288 |
2 |
jPanel2.add(jLabel2, null); |
| 289 |
2 |
jPanel2.add(yCombobox, null); |
| 290 |
2 |
jPanel2.add(jLabel3, null); |
| 291 |
2 |
jPanel2.add(zCombobox, null); |
| 292 |
2 |
jPanel2.add(resetButton, null); |
| 293 |
|
|
| 294 |
2 |
JMenuBar jMenuBar1 = new JMenuBar(); |
| 295 |
2 |
jMenuBar1.add(fileMenu); |
| 296 |
2 |
jMenuBar1.add(viewMenu); |
| 297 |
2 |
setJMenuBar(jMenuBar1); |
| 298 |
2 |
fileMenu.add(saveMenu); |
| 299 |
2 |
fileMenu.add(outputValues); |
| 300 |
2 |
fileMenu.add(print); |
| 301 |
2 |
fileMenu.add(originalSeqData); |
| 302 |
2 |
fileMenu.add(outputPoints); |
| 303 |
2 |
fileMenu.add(outputProjPoints); |
| 304 |
2 |
saveMenu.add(eps); |
| 305 |
2 |
saveMenu.add(png); |
| 306 |
2 |
viewMenu.add(showLabels); |
| 307 |
2 |
viewMenu.add(bgcolour); |
| 308 |
2 |
viewMenu.add(associateViewsMenu); |
| 309 |
|
} |
| 310 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 311 |
0 |
protected void resetButton_actionPerformed()... |
| 312 |
|
{ |
| 313 |
|
} |
| 314 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 315 |
0 |
protected void outputPoints_actionPerformed()... |
| 316 |
|
{ |
| 317 |
|
} |
| 318 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 319 |
0 |
protected void outputProjPoints_actionPerformed()... |
| 320 |
|
{ |
| 321 |
|
} |
| 322 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 323 |
0 |
public void makePCAImage(TYPE imageType)... |
| 324 |
|
{ |
| 325 |
|
} |
| 326 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 327 |
0 |
protected void outputValues_actionPerformed()... |
| 328 |
|
{ |
| 329 |
|
} |
| 330 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 331 |
0 |
protected void print_actionPerformed()... |
| 332 |
|
{ |
| 333 |
|
} |
| 334 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 335 |
0 |
protected void showLabels_actionPerformed()... |
| 336 |
|
{ |
| 337 |
|
} |
| 338 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 339 |
0 |
protected void bgcolour_actionPerformed()... |
| 340 |
|
{ |
| 341 |
|
} |
| 342 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 343 |
0 |
protected void originalSeqData_actionPerformed()... |
| 344 |
|
{ |
| 345 |
|
} |
| 346 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 347 |
0 |
protected void viewMenu_menuSelected()... |
| 348 |
|
{ |
| 349 |
|
} |
| 350 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 351 |
0 |
protected void doDimensionChange()... |
| 352 |
|
{ |
| 353 |
|
} |
| 354 |
|
} |