List of usage examples for java.awt.event KeyEvent toString
public String toString()
From source file:net.sf.maltcms.chromaui.chromatogram2Dviewer.ui.panel.Chromatogram2DViewerPanel.java
@Override public void keyPressed(KeyEvent ke) { Logger.getLogger(getClass().getName()).log(Level.INFO, "Received key event: {0}", ke.toString()); if (ke.isControlDown()) { modeSpinner.setValue(InstanceContentSelectionHandler.Mode.ON_HOVER.toString()); }//from w w w . j a va2 s. co m // if (getDataPoint() != null) { // Logger.getLogger(getClass().getName()).info("Data point is not null!"); // Point p = null; // if (ke.getKeyCode() == KeyEvent.VK_RIGHT) { // p = new Point(getDataPoint()); // p.translate(1, 0); // } else if (ke.getKeyCode() == KeyEvent.VK_LEFT) { // p = new Point(getDataPoint()); // p.translate(-1, 0); // } else if (ke.getKeyCode() == KeyEvent.VK_UP) { // p = new Point(getDataPoint()); // p.translate(0, 1); // } else if (ke.getKeyCode() == KeyEvent.VK_DOWN) { // p = new Point(getDataPoint()); // p.translate(0, -1); // } // setDataPoint(p); // if (!ke.isShiftDown()) { //// triggerMSUpdate(); // } // } }
From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.panel.Chromatogram1DHeatmapViewerPanel.java
@Override public void keyPressed(KeyEvent ke) { Logger.getLogger(getClass().getName()).log(Level.INFO, "Received key event: {0}", ke.toString()); if (ke.isControlDown()) { modeSpinner.setValue(InstanceContentSelectionHandler.Mode.ON_HOVER.toString()); }/*from w w w . j a va 2s .co m*/ if (getDataPoint() != null) { Logger.getLogger(getClass().getName()).info("Data point is not null!"); Point p = null; if (ke.getKeyCode() == KeyEvent.VK_RIGHT) { p = new Point(getDataPoint()); p.translate(1, 0); } else if (ke.getKeyCode() == KeyEvent.VK_LEFT) { p = new Point(getDataPoint()); p.translate(-1, 0); } else if (ke.getKeyCode() == KeyEvent.VK_UP) { p = new Point(getDataPoint()); p.translate(0, 1); } else if (ke.getKeyCode() == KeyEvent.VK_DOWN) { p = new Point(getDataPoint()); p.translate(0, -1); } setDataPoint(p); if (!ke.isShiftDown()) { // triggerMSUpdate(); } } }
From source file:com.xyphos.vmtgen.GUI.java
@Override public boolean dispatchKeyEvent(KeyEvent ke) { if (KeyEvent.KEY_PRESSED == ke.getID()) { System.out.println(ke.toString()); switch (ke.getKeyCode()) { case KeyEvent.VK_F1: generateVMT();/* ww w .j a v a2 s .c o m*/ return true; case KeyEvent.VK_F2: setAllLocks(true); return true; case KeyEvent.VK_F3: setAllLocks(false); return true; case KeyEvent.VK_F4: toggleAllLocks(); return true; case KeyEvent.VK_F5: showTextureFiles(); return true; case KeyEvent.VK_F6: resetAllInput(); return true; } } return false; }
From source file:tufts.vue.RichTextBox.java
public void keyPressed(KeyEvent e) { if (DEBUG.KEYS) out(e.toString()); //System.out.println("TextBox: " + e); //if (VueUtil.isAbortKey(e)) // check for ESCAPE for CTRL-Z or OPTION-Z if on mac if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { e.consume();// w w w . j a v a 2 s. c o m // System.out.println(mUnchangedText); //setText(mUnchangedText); revert = true; getParent().remove(this); // will trigger a save (via focusLost) return; // setSize(mUnchangedSize); // todo: won't be good enough if we ever resize the actual node as we type } else if (isFinishEditKeyPress(e)) { keyWasPressed = true; e.consume(); getParent().remove(this); // will trigger a save (via focusLost) VUE.getFormattingPanel().getTextPropsPane().getFontEditorPanel().updateFormatControlsTB(this); } else if (e.getKeyCode() == KeyEvent.VK_U && e.isMetaDown()) { e.consume(); String t = getText(); if (e.isShiftDown()) setText(t.toUpperCase()); // upper whole string else setText(Character.toTitleCase(t.charAt(0)) + t.substring(1)); // upper first char } else keyWasPressed = true; // Dimension d = preAddDimension; // d.height = this.getPreferredSize().height; // setSize(getPreferredSize()); // action keys will be ignored if we consume this here! // (e.g., "enter" does nothing) //e.consume(); }