List of usage examples for java.awt.event KeyEvent VK_9
int VK_9
To view the source code for java.awt.event KeyEvent VK_9.
Click Source Link
From source file:org.deegree.tools.rendering.InteractiveWPVS.java
@Override public void keyPressed(KeyEvent ev) { int k = ev.getKeyCode(); float scale = 1.01f; if ((ev.getModifiersEx() & (InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK)) == InputEvent.SHIFT_DOWN_MASK) { // SHIFT (and not CTRL) scale = 1.10f;//from w ww . ja v a 2 s . co m } else if ((ev.getModifiersEx() & (InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK)) == InputEvent.CTRL_DOWN_MASK) { // CTRL (and not SHIFT) scale /= 1.001; } switch (k) { case KeyEvent.VK_U: { this.updateLODStructure = !updateLODStructure; break; } case KeyEvent.VK_F11: { lodAnalyzerFrame.setVisible(!lodAnalyzerFrame.isVisible()); this.setEnabled(true); break; } case KeyEvent.VK_T: { if (this.availableDatasets.contains("trees")) { renderTrees = !renderTrees; if (renderTrees) { this.currentDatasets.add(currentDatasets.size() - 1, "trees"); } else { this.currentDatasets.remove("trees"); } } break; } case KeyEvent.VK_C: { if (!this.availableColorMaps.isEmpty()) { this.currentColormap++; if (this.currentColormap >= this.availableColorMaps.size()) { this.currentColormap = -1; } if (this.currentColormap >= 0) { String title = this.availableColorMaps.get(currentColormap); List<String> cm = new ArrayList<String>(1); cm.add(title); this.activeColormap = new Pair<String, Colormap>(title, this.perspectiveViewService.getColormap(cm, null)); this.currentDatasets.add(title); } else { if (this.activeColormap != null) { this.currentDatasets.remove(this.activeColormap.first); } this.activeColormap = null; } } break; } case KeyEvent.VK_B: { if (this.availableDatasets.contains("buildings")) { renderBuildings = !renderBuildings; renderTrees = !renderTrees; if (renderBuildings) { this.currentDatasets.add(currentDatasets.size() - 1, "buildings"); } else { this.currentDatasets.remove("buildings"); } } break; } case KeyEvent.VK_G: { getImage = true; break; } case KeyEvent.VK_1: { disableElevationModel = !disableElevationModel; if (disableElevationModel) { this.currentDatasets.remove("dem"); } else { this.currentDatasets.add("dem"); } break; } case KeyEvent.VK_2: { if (activeTextureManagers.length >= 1) { activeTextureManagers[0] = !activeTextureManagers[0]; if (activeTextureManagers[0]) { this.currentDatasets.add(Math.min(currentDatasets.size(), 1), this.availableDatasets.get(1)); } else { this.currentDatasets.remove(this.availableDatasets.get(1)); } } break; } case KeyEvent.VK_3: { if (activeTextureManagers.length >= 2) { activeTextureManagers[1] = !activeTextureManagers[1]; if (activeTextureManagers[1]) { this.currentDatasets.add(Math.min(currentDatasets.size(), 2), this.availableDatasets.get(2)); } else { this.currentDatasets.remove(this.availableDatasets.get(2)); } } break; } case KeyEvent.VK_4: { if (activeTextureManagers.length >= 3) { activeTextureManagers[2] = !activeTextureManagers[2]; if (activeTextureManagers[2]) { this.currentDatasets.add(Math.min(currentDatasets.size(), 3), this.availableDatasets.get(3)); } else { this.currentDatasets.remove(this.availableDatasets.get(3)); } } break; } case KeyEvent.VK_5: { if (activeTextureManagers.length >= 4) { activeTextureManagers[3] = !activeTextureManagers[3]; if (activeTextureManagers[3]) { this.currentDatasets.add(Math.min(currentDatasets.size(), 4), this.availableDatasets.get(4)); } else { this.currentDatasets.remove(this.availableDatasets.get(4)); } } break; } case KeyEvent.VK_6: { if (activeTextureManagers.length >= 5) { activeTextureManagers[4] = !activeTextureManagers[4]; if (activeTextureManagers[4]) { this.currentDatasets.add(Math.min(currentDatasets.size(), 5), this.availableDatasets.get(5)); } else { this.currentDatasets.remove(this.availableDatasets.get(5)); } } break; } case KeyEvent.VK_7: { if (activeTextureManagers.length >= 6) { activeTextureManagers[5] = !activeTextureManagers[5]; if (activeTextureManagers[5]) { this.currentDatasets.add(Math.min(currentDatasets.size(), 6), this.availableDatasets.get(6)); } else { this.currentDatasets.remove(this.availableDatasets.get(6)); } } break; } case KeyEvent.VK_8: { if (activeTextureManagers.length >= 7) { activeTextureManagers[6] = !activeTextureManagers[6]; if (activeTextureManagers[6]) { this.currentDatasets.add(Math.min(currentDatasets.size(), 7), this.availableDatasets.get(7)); } else { this.currentDatasets.remove(this.availableDatasets.get(7)); } } break; } case KeyEvent.VK_9: { if (activeTextureManagers.length >= 8) { activeTextureManagers[7] = !activeTextureManagers[7]; if (activeTextureManagers[7]) { this.currentDatasets.add(Math.min(currentDatasets.size(), 8), this.availableDatasets.get(8)); } else { this.currentDatasets.remove(this.availableDatasets.get(8)); } } break; } case KeyEvent.VK_PAGE_DOWN: { glRenderContext.setTerrainScale(glRenderContext.getTerrainScale() / scale); break; } case KeyEvent.VK_PAGE_UP: { glRenderContext.setTerrainScale(glRenderContext.getTerrainScale() * scale); break; } } }
From source file:org.eclipse.jubula.client.ui.rcp.constants.InputCodeHelper.java
/** * private constructor//from w ww . j av a 2s . 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:savant.view.swing.Savant.java
private void initHiddenShortcuts() { JMenuBar hiddenBar = new JMenuBar(); hiddenBar.setSize(new Dimension(0, 0)); hiddenBar.setMaximumSize(new Dimension(0, 0)); hiddenBar.setPreferredSize(new Dimension(0, 0)); JMenuItem hiddenBookmarkPrev = new JMenuItem(""); hiddenBookmarkPrev.setAccelerator(/*from w w w.j av a 2s. co m*/ javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_9, MiscUtils.MENU_MASK)); hiddenBookmarkPrev.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (favoriteSheet != null) { favoriteSheet.goToPreviousBookmark(); } } }); JMenuItem hiddenBookmarkNext = new JMenuItem(""); hiddenBookmarkNext.setAccelerator( javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_0, MiscUtils.MENU_MASK)); hiddenBookmarkNext.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (favoriteSheet != null) { favoriteSheet.goToNextBookmark(); } } }); hiddenBar.add(hiddenBookmarkPrev); hiddenBar.add(hiddenBookmarkNext); this.add(hiddenBar); }