List of usage examples for java.awt.event KeyEvent VK_F12
int VK_F12
To view the source code for java.awt.event KeyEvent VK_F12.
Click Source Link
From source file:com.igormaznitsa.zxpoly.MainForm.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from ww w .java 2 s . c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; scrollPanel = new javax.swing.JScrollPane(); jSeparator2 = new javax.swing.JSeparator(); panelIndicators = new javax.swing.JPanel(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); labelTurbo = new javax.swing.JLabel(); labelMouseUsage = new javax.swing.JLabel(); labelZX128 = new javax.swing.JLabel(); labelTapeUsage = new javax.swing.JLabel(); labelDiskUsage = new javax.swing.JLabel(); menuBar = new javax.swing.JMenuBar(); menuFile = new javax.swing.JMenu(); menuFileLoadSnapshot = new javax.swing.JMenuItem(); menuFileLoadTap = new javax.swing.JMenuItem(); menuLoadDrive = new javax.swing.JMenu(); menuFileSelectDiskA = new javax.swing.JMenuItem(); jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JPopupMenu.Separator(); menuFileOptions = new javax.swing.JMenuItem(); jSeparator3 = new javax.swing.JPopupMenu.Separator(); menuFileExit = new javax.swing.JMenuItem(); menuTap = new javax.swing.JMenu(); menuTapeRewindToStart = new javax.swing.JMenuItem(); menuTapPrevBlock = new javax.swing.JMenuItem(); menuTapPlay = new javax.swing.JCheckBoxMenuItem(); menuTapNextBlock = new javax.swing.JMenuItem(); menuTapGotoBlock = new javax.swing.JMenuItem(); menuService = new javax.swing.JMenu(); menuFileReset = new javax.swing.JMenuItem(); menuResetKeyboard = new javax.swing.JMenuItem(); menuServiceSaveScreen = new javax.swing.JMenuItem(); menuTapExportAs = new javax.swing.JMenu(); menuTapExportAsWav = new javax.swing.JMenuItem(); menuTracer = new javax.swing.JMenu(); menuTraceCPU0 = new javax.swing.JCheckBoxMenuItem(); menuTraceCPU1 = new javax.swing.JCheckBoxMenuItem(); menuTraceCPU2 = new javax.swing.JCheckBoxMenuItem(); menuTraceCPU3 = new javax.swing.JCheckBoxMenuItem(); menuOptions = new javax.swing.JMenu(); menuOptionsShowIndicators = new javax.swing.JCheckBoxMenuItem(); menuOptionsZX128Mode = new javax.swing.JCheckBoxMenuItem(); menuOptionsTurbo = new javax.swing.JCheckBoxMenuItem(); menuHelp = new javax.swing.JMenu(); menuHelpAbout = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setLocationByPlatform(true); addWindowFocusListener(new java.awt.event.WindowFocusListener() { public void windowGainedFocus(java.awt.event.WindowEvent evt) { formWindowGainedFocus(evt); } public void windowLostFocus(java.awt.event.WindowEvent evt) { formWindowLostFocus(evt); } }); scrollPanel.setViewportView(jSeparator2); getContentPane().add(scrollPanel, java.awt.BorderLayout.CENTER); panelIndicators.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelIndicators.setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1000.0; panelIndicators.add(filler1, gridBagConstraints); labelTurbo.setText(" "); labelTurbo.setToolTipText("Shows turbo mode on"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 0; panelIndicators.add(labelTurbo, gridBagConstraints); labelMouseUsage.setText(" "); labelMouseUsage.setToolTipText("Indicates kempston mouse activation, ESC - deactivate mouse"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 6; gridBagConstraints.gridy = 0; panelIndicators.add(labelMouseUsage, gridBagConstraints); labelZX128.setText(" "); labelZX128.setToolTipText("Shows that active ZX128 emulation mode"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 7; gridBagConstraints.gridy = 0; panelIndicators.add(labelZX128, gridBagConstraints); labelTapeUsage.setText(" "); labelTapeUsage.setToolTipText("Shows tape activity"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 8; gridBagConstraints.gridy = 0; panelIndicators.add(labelTapeUsage, gridBagConstraints); labelDiskUsage.setText(" "); labelDiskUsage.setToolTipText("Shows disk activity"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 9; gridBagConstraints.gridy = 0; panelIndicators.add(labelDiskUsage, gridBagConstraints); getContentPane().add(panelIndicators, java.awt.BorderLayout.SOUTH); menuFile.setText("File"); menuFileLoadSnapshot.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/snapshot.png"))); // NOI18N menuFileLoadSnapshot.setText("Load Snapshot"); menuFileLoadSnapshot.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileLoadSnapshotActionPerformed(evt); } }); menuFile.add(menuFileLoadSnapshot); menuFileLoadTap.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/cassette.png"))); // NOI18N menuFileLoadTap.setText("Load TAPE"); menuFileLoadTap.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileLoadTapActionPerformed(evt); } }); menuFile.add(menuFileLoadTap); menuLoadDrive.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/disk.png"))); // NOI18N menuLoadDrive.setText("Load Disk.."); menuFileSelectDiskA.setText("Drive A"); menuFileSelectDiskA.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileSelectDiskAActionPerformed(evt); } }); menuLoadDrive.add(menuFileSelectDiskA); jMenuItem1.setText("Drive B"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); menuLoadDrive.add(jMenuItem1); jMenuItem2.setText("Drive C"); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); menuLoadDrive.add(jMenuItem2); jMenuItem3.setText("Drive D"); jMenuItem3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem3ActionPerformed(evt); } }); menuLoadDrive.add(jMenuItem3); menuFile.add(menuLoadDrive); menuFile.add(jSeparator1); menuFileOptions.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/settings.png"))); // NOI18N menuFileOptions.setText("Options"); menuFileOptions.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileOptionsActionPerformed(evt); } }); menuFile.add(menuFileOptions); menuFile.add(jSeparator3); menuFileExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK)); menuFileExit.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/reset.png"))); // NOI18N menuFileExit.setText("Exit"); menuFileExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileExitActionPerformed(evt); } }); menuFile.add(menuFileExit); menuBar.add(menuFile); menuTap.setText("Tape"); menuTapeRewindToStart.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/zxpoly/icons/tape_previous.png"))); // NOI18N menuTapeRewindToStart.setText("Rewind to start"); menuTapeRewindToStart.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTapeRewindToStartActionPerformed(evt); } }); menuTap.add(menuTapeRewindToStart); menuTapPrevBlock.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/zxpoly/icons/tape_backward.png"))); // NOI18N menuTapPrevBlock.setText("Prev block"); menuTapPrevBlock.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTapPrevBlockActionPerformed(evt); } }); menuTap.add(menuTapPrevBlock); menuTapPlay.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, 0)); menuTapPlay.setText("Play"); menuTapPlay.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/tape_play.png"))); // NOI18N menuTapPlay.setInheritsPopupMenu(true); menuTapPlay.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTapPlayActionPerformed(evt); } }); menuTap.add(menuTapPlay); menuTapNextBlock.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/zxpoly/icons/tape_forward.png"))); // NOI18N menuTapNextBlock.setText("Next block"); menuTapNextBlock.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTapNextBlockActionPerformed(evt); } }); menuTap.add(menuTapNextBlock); menuTapGotoBlock.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/tape_pos.png"))); // NOI18N menuTapGotoBlock.setText("Go to block"); menuTapGotoBlock.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTapGotoBlockActionPerformed(evt); } }); menuTap.add(menuTapGotoBlock); menuBar.add(menuTap); menuService.setText("Service"); menuFileReset.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F12, 0)); menuFileReset.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/reset2.png"))); // NOI18N menuFileReset.setText("Reset"); menuFileReset.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuFileResetActionPerformed(evt); } }); menuService.add(menuFileReset); menuResetKeyboard.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/keyboard.png"))); // NOI18N menuResetKeyboard.setText("Reset keyboard"); menuResetKeyboard.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuResetKeyboardActionPerformed(evt); } }); menuService.add(menuResetKeyboard); menuServiceSaveScreen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F8, 0)); menuServiceSaveScreen.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/photo.png"))); // NOI18N menuServiceSaveScreen.setText("Make Screenshot"); menuServiceSaveScreen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuServiceSaveScreenActionPerformed(evt); } }); menuService.add(menuServiceSaveScreen); menuTapExportAs.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/zxpoly/icons/tape_record.png"))); // NOI18N menuTapExportAs.setText("Export TAPE as.."); menuTapExportAsWav.setText("WAV file"); menuTapExportAsWav.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTapExportAsWavActionPerformed(evt); } }); menuTapExportAs.add(menuTapExportAsWav); menuService.add(menuTapExportAs); menuTracer.setText("Trace"); menuTraceCPU0.setText("CPU0"); menuTraceCPU0.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTraceCPU0ActionPerformed(evt); } }); menuTracer.add(menuTraceCPU0); menuTraceCPU1.setText("CPU1"); menuTraceCPU1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTraceCPU1ActionPerformed(evt); } }); menuTracer.add(menuTraceCPU1); menuTraceCPU2.setText("CPU2"); menuTraceCPU2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTraceCPU2ActionPerformed(evt); } }); menuTracer.add(menuTraceCPU2); menuTraceCPU3.setText("CPU3"); menuTraceCPU3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuTraceCPU3ActionPerformed(evt); } }); menuTracer.add(menuTraceCPU3); menuService.add(menuTracer); menuBar.add(menuService); menuOptions.setText("Options"); menuOptionsShowIndicators.setSelected(true); menuOptionsShowIndicators.setText("Indicator panel"); menuOptionsShowIndicators.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/indicator.png"))); // NOI18N menuOptionsShowIndicators.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuOptionsShowIndicatorsActionPerformed(evt); } }); menuOptions.add(menuOptionsShowIndicators); menuOptionsZX128Mode.setSelected(true); menuOptionsZX128Mode.setText("ZX 128 Mode"); menuOptionsZX128Mode.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/zx128.png"))); // NOI18N menuOptionsZX128Mode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuOptionsZX128ModeActionPerformed(evt); } }); menuOptions.add(menuOptionsZX128Mode); menuOptionsTurbo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F3, 0)); menuOptionsTurbo.setSelected(true); menuOptionsTurbo.setText("Turbo"); menuOptionsTurbo.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/turbo.png"))); // NOI18N menuOptionsTurbo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuOptionsTurboActionPerformed(evt); } }); menuOptions.add(menuOptionsTurbo); menuBar.add(menuOptions); menuHelp.setText("Help"); menuHelpAbout.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0)); menuHelpAbout.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/zxpoly/icons/info.png"))); // NOI18N menuHelpAbout.setText("About"); menuHelpAbout.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuHelpAboutActionPerformed(evt); } }); menuHelp.add(menuHelpAbout); menuBar.add(menuHelp); setJMenuBar(menuBar); pack(); }
From source file:com.sshtools.sshterm.emulation.TerminalEmulation.java
public void keyPressed(int keyCode, char keyChar, int modifiers) { if (debug > 0) { System.out.println("keyPressed(" + keyCode + "," + keyChar + "," + modifiers); }//from w w w . j av a 2 s . c om boolean control = (modifiers & VDUInput.KEY_CONTROL) != 0; boolean shift = (modifiers & VDUInput.KEY_SHIFT) != 0; boolean alt = (modifiers & VDUInput.KEY_ALT) != 0; int xind; String[] fmap; xind = 0; fmap = FunctionKey; if (shift) { fmap = FunctionKeyShift; xind = 1; } if (control) { fmap = FunctionKeyCtrl; xind = 2; } if (alt) { fmap = FunctionKeyAlt; xind = 3; } switch (keyCode) { case KeyEvent.VK_PAUSE: if (shift || control) { sendTelnetCommand((byte) 243); } // BREAK break; case KeyEvent.VK_ESCAPE: writeSpecial(Escape[xind]); break; case KeyEvent.VK_F1: writeSpecial(fmap[1]); break; case KeyEvent.VK_F2: writeSpecial(fmap[2]); break; case KeyEvent.VK_F3: writeSpecial(fmap[3]); break; case KeyEvent.VK_F4: writeSpecial(fmap[4]); break; case KeyEvent.VK_F5: writeSpecial(fmap[5]); break; case KeyEvent.VK_F6: writeSpecial(fmap[6]); break; case KeyEvent.VK_F7: writeSpecial(fmap[7]); break; case KeyEvent.VK_F8: writeSpecial(fmap[8]); break; case KeyEvent.VK_F9: writeSpecial(fmap[9]); break; case KeyEvent.VK_F10: writeSpecial(fmap[10]); break; case KeyEvent.VK_F11: writeSpecial(fmap[11]); break; case KeyEvent.VK_F12: writeSpecial(fmap[12]); break; case KeyEvent.VK_UP: writeSpecial(KeyUp[xind]); break; case KeyEvent.VK_DOWN: writeSpecial(KeyDown[xind]); break; case KeyEvent.VK_LEFT: writeSpecial(KeyLeft[xind]); break; case KeyEvent.VK_RIGHT: writeSpecial(KeyRight[xind]); break; case KeyEvent.VK_PAGE_DOWN: writeSpecial(NextScn[xind]); break; case KeyEvent.VK_PAGE_UP: writeSpecial(PrevScn[xind]); break; case KeyEvent.VK_INSERT: writeSpecial(Insert[xind]); break; case KeyEvent.VK_DELETE: writeSpecial(Remove[xind]); break; case KeyEvent.VK_BACK_SPACE: writeSpecial(BackSpace[xind]); if (localecho) { if (BackSpace[xind] == "\b" || BackSpace[xind] == "\u007f") { putString("\b \b"); // make the last char 'deleted' } else { putString(BackSpace[xind]); // echo it } } break; case KeyEvent.VK_HOME: writeSpecial(KeyHome[xind]); break; case KeyEvent.VK_END: writeSpecial(KeyEnd[xind]); break; case KeyEvent.VK_NUM_LOCK: if (vms && control) { writeSpecial(PF1); } if (!control) { numlock = !numlock; } break; case KeyEvent.VK_CAPS_LOCK: capslock = !capslock; return; case KeyEvent.VK_SHIFT: case KeyEvent.VK_CONTROL: case KeyEvent.VK_ALT: return; default: break; } }
From source file:br.com.atmatech.sac.view.ViewPessoa.java
private void jTconsultaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTconsultaKeyPressed // TODO add your handling code here: if (evt.getKeyCode() == KeyEvent.VK_F12 && jTtcidade.getSelectedRow() > -1) { jTiddistrito.setText(jTtcidade.getValueAt(jTtcidade.getSelectedRow(), 0).toString()); jTcidade.setText(jTtcidade.getValueAt(jTtcidade.getSelectedRow(), 1).toString()); jDcidade.setVisible(false);/*from www . j a v a 2 s . c o m*/ } }
From source file:base.BasePlayer.Main.java
@Override public void keyPressed(KeyEvent e) { keyCode = e.getKeyCode();/*from w w w .j a va 2s .c o m*/ if (!Main.shift && (e.getModifiers() & KeyEvent.SHIFT_MASK) != 0) { Main.shift = true; } else if ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0) { Main.drawCanvas.ctrlpressed = 100; if (keyCode == KeyEvent.VK_S) { if (drawCanvas.drawVariables.projectName.equals("Untitled")) { saveProjectAs.doClick(); } else { Serializer ser = new Serializer(); ser.serialize(drawCanvas.drawVariables.projectFile); } } if (keyCode == KeyEvent.VK_W) { // System.out.println("\n----\n"); /* int[][] array = new int[Main.varsamples][VariantHandler.callSlider.getUpperValue()+1]; for(int i = 0; i<array.length; i++) { for(int j = 0; j<array[i].length; j++) { array[i][j] = 0; } } /*VarNode node = FileRead.head.getNext(); int counter = 0; while(node != null) { if(!drawCanvas.hideNode(node)) { counter++; for(int i = 0; i<node.vars.size(); i++) { if(!drawCanvas.hideNodeVar(node, node.vars.get(i))) { for(int j = 0;j<node.vars.get(i).getValue().size(); j++) { if(!drawCanvas.hideVar(node.vars.get(i).getValue().get(j), false)) { array[node.vars.get(i).getValue().get(j).getSample().getIndex()][(int)(MethodLibrary.round(node.vars.get(i).getValue().get(j).getAlleleFraction()*100,2))]++; } } } } } node = node.getNext(); }*/ /* int width = Main.drawCanvas.getWidth()-Main.sidebarWidth; JPopupMenu menu = new JPopupMenu(); Plotter plotter = new Plotter(width); plotter.setPreferredSize(new Dimension(width,400)); menu.add(plotter); menu.pack(); menu.show(Main.drawCanvas,Main.sidebarWidth, drawScroll.getVerticalScrollBar().getValue()); */ } if (keyCode == KeyEvent.VK_PLUS || keyCode == 107) { // defaultFontSize++; // setFonts(); } if (keyCode == KeyEvent.VK_M || keyCode == KeyEvent.VK_MINUS || keyCode == 109) { // defaultFontSize--; // setFonts(); } /* else if(keyCode == KeyEvent.VK_M) { VarNode current = FileRead.head.getNext(); while(current != null) { if(current.getNext() != null && current.getNext().getPosition()-current.getPosition() > 100000) { System.out.println(current.getPosition() +" " +(current.getNext().getPosition()-current.getPosition())); } current = current.getNext(); } current = null; } */ } else if (keyCode == KeyEvent.VK_DELETE) { if (Main.drawCanvas.selectedSample != null) { Main.drawCanvas.removeSample(Main.drawCanvas.selectedSample); } } /* else if(keyCode == KeyEvent.VK_7) { }*/ else if (keyCode == KeyEvent.VK_O && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) { /* clearData(); try { FileInputStream fin = new FileInputStream("C:/HY-Data/RKATAINE/test.ses"); ObjectInputStream ois = new ObjectInputStream(fin); drawCanvas.sampleList = (ArrayList<Sample>) ois.readObject(); Main.samples = (short)drawCanvas.sampleList.size(); drawCanvas.splits = (ArrayList<SplitClass>) ois.readObject(); for(int i = 0; i<drawCanvas.splits.size(); i++) { drawCanvas.splits.get(i).resetSplits(); } drawCanvas.drawVariables = (DrawVariables)ois.readObject(); ois.close(); drawCanvas.resizeCanvas(Main.drawCanvas.getWidth(), Main.drawCanvas.getHeight()); Draw.setScrollbar(drawCanvas.drawVariables.scrollbarpos); for(int i= 0; i<drawCanvas.splits.size(); i++) { drawCanvas.splits.get(i).setCytoImage(null); chromDraw.drawCyto(drawCanvas.splits.get(i)); chromDraw.updateExons = true; FileRead.search = true; drawCanvas.gotoPos(drawCanvas.splits.get(i).chrom, drawCanvas.splits.get(i).start, drawCanvas.splits.get(i).end); chromDraw.repaint(); } for(int i = 0 ;i<drawCanvas.sampleList.size(); i++) { for(int r = 0 ;r<drawCanvas.sampleList.size(); r++) { if(drawCanvas.sampleList.get(i).getreadHash().size() > 0) { drawCanvas.sampleList.get(i).resetreadHash(); } } } } catch(Exception ex) { ex.printStackTrace(); } */ } else if (keyCode == KeyEvent.VK_F9) { FileRead.head.putNext(null); drawCanvas.variantsStart = 0; drawCanvas.variantsEnd = 1; Draw.updatevars = true; Main.drawCanvas.repaint(); } else if (keyCode == KeyEvent.VK_F11) { /* try { BBFileReader reader = new BBFileReader( Main.bedCanvas.bedTrack.get(0).file.getCanonicalPath(), Main.bedCanvas.bedTrack.get(0)); int zoomlevel = 1; for(int i =2;i<reader.getZoomLevels().getZoomHeaderCount();i++) { if(reader.getZoomLevels().getZoomLevelHeader(i).getReductionLevel() < (Main.drawCanvas.splits.get(0).viewLength/(Main.drawCanvas.splits.get(0).pixel*Main.drawCanvas.splits.get(0).viewLength))) { zoomlevel = i; } else { break; } } } catch(Exception ex) { ex.printStackTrace(); }*/ } else if (keyCode == KeyEvent.VK_F12) { /*VarNode next = Main.drawCanvas.current.getNext(); MethodLibrary.makeMultiAlt("2",next.getPosition(), "G", next); next = null; */ /* try { URL urli = new URL("ftp://ftp.ensembl.org/pub/grch37/update/gff3/homo_sapiens/Homo_sapiens.GRCh37.87.gff3.gz"); System.out.println(urli.getProtocol() +" " +urli.getHost() +" " +urli.getPath().substring(0,urli.getPath().lastIndexOf("/")+1)); } catch(Exception ex) { ex.printStackTrace(); }*/ } else if (keyCode == KeyEvent.VK_F8) { File file = new File(searchField.getText().replaceAll(" ", "")); if (!file.exists()) { if (Main.drawCanvas.splits.get(0).viewLength < 1000) { Main.getConsSeq(); } } else { try { /* JFileChooser chooser = new JFileChooser(file.getPath()); chooser.setAcceptAllFileFilterUsed(true); chooser.setDialogTitle("Save FASTA file as..."); int returnVal = chooser.showSaveDialog((Component)this.getParent()); if(returnVal == JFileChooser.APPROVE_OPTION) { String suffix = ""; if(!chooser.getSelectedFile().getName().endsWith(".fa") && !chooser.getSelectedFile().getName().endsWith(".fasta")) { suffix = ".fa"; } File outfile = new File(chooser.getSelectedFile().getCanonicalPath() +suffix); // File outfile = new File("test.fa"); Main.nothread = true; Main.noreadthread = true; FileRead.search = true; Draw.variantcalculator = true; Seqfetcher fetcher = new Seqfetcher(file, outfile); fetcher.execute(); }*/ } catch (Exception ex) { ex.printStackTrace(); } } } else if (keyCode == KeyEvent.VK_ENTER) { if (e.getSource() == searchField) { search(searchField.getText()); } } }
From source file:org.eclipse.jubula.client.ui.rcp.constants.InputCodeHelper.java
/** * private constructor//from w w w .ja v a 2 s. c o m * */ private InputCodeHelper() { m_modifier[0] = InputEvent.CTRL_DOWN_MASK; m_modifier[1] = InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK; m_modifier[2] = InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK; m_modifier[3] = InputEvent.ALT_DOWN_MASK; m_modifier[4] = InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK; m_modifier[5] = 0; // no modifier pressed List<UserInput> inputList = new ArrayList<UserInput>(); List<String> inputStringList = new ArrayList<String>(); for (int i = KeyEvent.VK_0; i <= KeyEvent.VK_9; i++) { inputList.add(new UserInput(i, InputConstants.TYPE_KEY_PRESS)); inputStringList.add(KeyEvent.getKeyText(i)); } for (int i = KeyEvent.VK_A; i <= KeyEvent.VK_Z; i++) { inputList.add(new UserInput(i, InputConstants.TYPE_KEY_PRESS)); inputStringList.add(KeyEvent.getKeyText(i)); } for (int i = KeyEvent.VK_NUMPAD0; i <= KeyEvent.VK_ADD; i++) { inputList.add(new UserInput(i, InputConstants.TYPE_KEY_PRESS)); inputStringList.add(KeyEvent.getKeyText(i)); } for (int i = KeyEvent.VK_SUBTRACT; i <= KeyEvent.VK_DIVIDE; i++) { inputList.add(new UserInput(i, InputConstants.TYPE_KEY_PRESS)); inputStringList.add(KeyEvent.getKeyText(i)); } for (int i = KeyEvent.VK_F1; i <= KeyEvent.VK_F12; i++) { inputList.add(new UserInput(i, InputConstants.TYPE_KEY_PRESS)); inputStringList.add(KeyEvent.getKeyText(i)); } m_modifierString = new String[m_modifier.length]; for (int i = 0; i < m_modifier.length; i++) { m_modifierString[i] = InputEvent.getModifiersExText(m_modifier[i]); } m_keys = inputList.toArray(new UserInput[inputList.size()]); m_keyStrings = inputStringList.toArray(new String[inputStringList.size()]); inputList.add(new UserInput(InputConstants.MOUSE_BUTTON_LEFT, InputConstants.TYPE_MOUSE_CLICK)); inputList.add(new UserInput(InputConstants.MOUSE_BUTTON_MIDDLE, InputConstants.TYPE_MOUSE_CLICK)); inputList.add(new UserInput(InputConstants.MOUSE_BUTTON_RIGHT, InputConstants.TYPE_MOUSE_CLICK)); inputStringList.add(Messages.ObjectMappingPreferencePageMouseButton1); inputStringList.add(Messages.ObjectMappingPreferencePageMouseButton2); inputStringList.add(Messages.ObjectMappingPreferencePageMouseButton3); m_inputs = inputList.toArray(new UserInput[inputList.size()]); m_inputStrings = inputStringList.toArray(new String[inputStringList.size()]); }
From source file:org.safs.selenium.webdriver.lib.WDLibrary.java
/** * Convert a Java KEYCODE to a Selenium WebDriver Keys Enum * @param keycode int, a java keycode//from w w w . j a v a 2 s . c o m * @return Keys enum for (primarily) non-printable (control) characters, or null. */ public static Keys convertToKeys(int keycode) { Keys key = null; switch (keycode) { case java.awt.event.KeyEvent.VK_ADD: key = Keys.ADD; break; case java.awt.event.KeyEvent.VK_ALT: key = Keys.ALT; break; case java.awt.event.KeyEvent.VK_KP_DOWN: key = Keys.ARROW_DOWN; break; case java.awt.event.KeyEvent.VK_KP_LEFT: key = Keys.ARROW_LEFT; break; case java.awt.event.KeyEvent.VK_KP_RIGHT: key = Keys.ARROW_RIGHT; break; case java.awt.event.KeyEvent.VK_KP_UP: key = Keys.ARROW_UP; break; case java.awt.event.KeyEvent.VK_BACK_SPACE: key = Keys.BACK_SPACE; break; case java.awt.event.KeyEvent.VK_CANCEL: key = Keys.CANCEL; break; case java.awt.event.KeyEvent.VK_CLEAR: key = Keys.CLEAR; break; case java.awt.event.KeyEvent.VK_WINDOWS: key = Keys.COMMAND; break; case java.awt.event.KeyEvent.VK_CONTROL: key = Keys.CONTROL; break; case java.awt.event.KeyEvent.VK_DECIMAL: key = Keys.DECIMAL; break; case java.awt.event.KeyEvent.VK_DELETE: key = Keys.DELETE; break; case java.awt.event.KeyEvent.VK_DIVIDE: key = Keys.DIVIDE; break; case java.awt.event.KeyEvent.VK_DOWN: key = Keys.DOWN; break; case java.awt.event.KeyEvent.VK_END: key = Keys.END; break; case java.awt.event.KeyEvent.VK_ENTER: key = Keys.ENTER; break; case java.awt.event.KeyEvent.VK_EQUALS: key = Keys.EQUALS; break; case java.awt.event.KeyEvent.VK_ESCAPE: key = Keys.ESCAPE; break; case java.awt.event.KeyEvent.VK_F1: key = Keys.F1; break; case java.awt.event.KeyEvent.VK_F2: key = Keys.F2; break; case java.awt.event.KeyEvent.VK_F3: key = Keys.F3; break; case java.awt.event.KeyEvent.VK_F4: key = Keys.F4; break; case java.awt.event.KeyEvent.VK_F5: key = Keys.F5; break; case java.awt.event.KeyEvent.VK_F6: key = Keys.F6; break; case java.awt.event.KeyEvent.VK_F7: key = Keys.F7; break; case java.awt.event.KeyEvent.VK_F8: key = Keys.F8; break; case java.awt.event.KeyEvent.VK_F9: key = Keys.F9; break; case java.awt.event.KeyEvent.VK_F10: key = Keys.F10; break; case java.awt.event.KeyEvent.VK_F11: key = Keys.F11; break; case java.awt.event.KeyEvent.VK_F12: key = Keys.F12; break; case java.awt.event.KeyEvent.VK_HELP: key = Keys.HELP; break; case java.awt.event.KeyEvent.VK_HOME: key = Keys.HOME; break; case java.awt.event.KeyEvent.VK_INSERT: key = Keys.INSERT; break; case java.awt.event.KeyEvent.VK_LEFT: key = Keys.LEFT; break; case java.awt.event.KeyEvent.VK_META: key = Keys.META; break; case java.awt.event.KeyEvent.VK_MULTIPLY: key = Keys.MULTIPLY; break; case java.awt.event.KeyEvent.VK_NUMPAD0: key = Keys.NUMPAD0; break; case java.awt.event.KeyEvent.VK_NUMPAD1: key = Keys.NUMPAD1; break; case java.awt.event.KeyEvent.VK_NUMPAD2: key = Keys.NUMPAD2; break; case java.awt.event.KeyEvent.VK_NUMPAD3: key = Keys.NUMPAD3; break; case java.awt.event.KeyEvent.VK_NUMPAD4: key = Keys.NUMPAD4; break; case java.awt.event.KeyEvent.VK_NUMPAD5: key = Keys.NUMPAD5; break; case java.awt.event.KeyEvent.VK_NUMPAD6: key = Keys.NUMPAD6; break; case java.awt.event.KeyEvent.VK_NUMPAD7: key = Keys.NUMPAD7; break; case java.awt.event.KeyEvent.VK_NUMPAD8: key = Keys.NUMPAD8; break; case java.awt.event.KeyEvent.VK_NUMPAD9: key = Keys.NUMPAD9; break; case java.awt.event.KeyEvent.VK_PAGE_DOWN: key = Keys.PAGE_DOWN; break; case java.awt.event.KeyEvent.VK_PAGE_UP: key = Keys.PAGE_UP; break; case java.awt.event.KeyEvent.VK_PAUSE: key = Keys.PAUSE; break; case java.awt.event.KeyEvent.VK_RIGHT: key = Keys.RIGHT; break; case java.awt.event.KeyEvent.VK_SEMICOLON: key = Keys.SEMICOLON; break; case java.awt.event.KeyEvent.VK_SEPARATOR: key = Keys.SEPARATOR; break; case java.awt.event.KeyEvent.VK_SHIFT: key = Keys.SHIFT; break; case java.awt.event.KeyEvent.VK_SPACE: key = Keys.SPACE; break; case java.awt.event.KeyEvent.VK_SUBTRACT: key = Keys.SUBTRACT; break; case java.awt.event.KeyEvent.VK_TAB: key = Keys.TAB; break; case java.awt.event.KeyEvent.VK_UP: key = Keys.UP; break; } return key; }
From source file:statechum.analysis.learning.Visualiser.java
protected void setVisualiserKeyBindings() { persistAction = new graphAction("saveLayout", "save the layout of the visible graph") { /** Serial number. */ private static final long serialVersionUID = 1L; @Override//from www . j a v a2s.c o m public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { XMLEncoder encoder = null; try { if (propName >= 0) { String fileName = getLayoutFileName(graphs.get(currentGraph)); encoder = new XMLEncoder(new FileOutputStream(fileName)); Map<Integer, DoublePair> layout = ((XMLPersistingLayout) viewer.getModel().getGraphLayout()) .persist(); encoder.writeObject(layout); XMLAffineTransformSerialised trV = new XMLAffineTransformSerialised(); trV.setFromAffineTransform(viewer.getViewTransformer().getTransform()); encoder.writeObject(trV); XMLAffineTransformSerialised trL = new XMLAffineTransformSerialised(); trL.setFromAffineTransform(viewer.getLayoutTransformer().getTransform()); encoder.writeObject(trL); ((XMLModalGraphMouse) viewer.getGraphMouse()).store(encoder); encoder.writeObject(layoutOptions.get(currentGraph)); encoder.close(); encoder = null; } } catch (Exception e1) { e1.printStackTrace(); } finally { if (encoder != null) { encoder.close(); encoder = null; } } } }; keyToActionMap.put(KeyEvent.VK_F2, persistAction); keyToActionMap.put(KeyEvent.VK_F3, new graphAction("loadLayout", "loads the previously saved layout into the visible graph") { /** Serial number. */ private static final long serialVersionUID = 2L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { reloadLayout(false, true); } }); keyToActionMap.put(KeyEvent.VK_F9, new graphAction("loadPreviousLayout", "loads the layout of the previous graph in the list") { /** Serial number. */ private static final long serialVersionUID = 3L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { if (currentGraph > 0) { restoreLayout(false, currentGraph - 1); } } }); pickAction = new graphAction("pick", "Switches Jung into picking mode") { /** Serial number. */ private static final long serialVersionUID = 7L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { ((XMLModalGraphMouse) viewer.getGraphMouse()).setMode(ModalGraphMouse.Mode.PICKING); } }; keyToActionMap.put(KeyEvent.VK_F11, pickAction); transformAction = new graphAction("transform", "Switches Jung into transformation mode") { /** Serial number. */ private static final long serialVersionUID = 8L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { ((XMLModalGraphMouse) viewer.getGraphMouse()).setMode(ModalGraphMouse.Mode.TRANSFORMING); } }; keyToActionMap.put(KeyEvent.VK_F12, transformAction); keyToActionMap.put(KeyEvent.VK_UP, new graphAction("previous", "loads the previous graph") { /** Serial number. */ private static final long serialVersionUID = 9L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { if (currentGraph > 0) { --currentGraph; reloadLayout(false, true); } } }); keyToActionMap.put(KeyEvent.VK_DOWN, new graphAction("next", "loads the next graph") { /** Serial number. */ private static final long serialVersionUID = 10L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { if (currentGraph < graphs.size() - 1) { ++currentGraph; reloadLayout(false, true); } } }); keyToActionMap.put(KeyEvent.VK_F, new graphAction("negatives", "toggles negatives on or off") { /** Serial number. */ private static final long serialVersionUID = 11L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { LayoutOptions options = layoutOptions.get(currentGraph); if (options != null) { options.showNegatives = !options.showNegatives; reloadLayout(false, false); } } }); keyToActionMap.put(KeyEvent.VK_I, new graphAction("ignored states", "toggles ignored states on or off") { /** Serial number. */ private static final long serialVersionUID = 12L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { LayoutOptions options = layoutOptions.get(currentGraph); if (options != null) { options.showIgnored = !options.showIgnored; reloadLayout(false, false); } } }); keyToActionMap.put(KeyEvent.VK_PAGE_DOWN, new graphAction("refine", "reduces the abstraction level") { /** Serial number. */ private static final long serialVersionUID = 13L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { LayoutOptions options = layoutOptions.get(currentGraph); if (options != null && options.componentsToPick < Integer.MAX_VALUE) { options.componentsToPick++; reloadLayout(false, false); } } }); keyToActionMap.put(KeyEvent.VK_PAGE_UP, new graphAction("abstract", "increases abstraction level") { /** Serial number. */ private static final long serialVersionUID = 14L; @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { LayoutOptions options = layoutOptions.get(currentGraph); if (options != null && options.componentsToPick != Integer.MAX_VALUE && options.componentsToPick > 0) { --options.componentsToPick; reloadLayout(false, false); } } }); }