@Nullable public static KeyStroke convert(@NotNull ActionEvent event) { String cmd = event.getActionCommand(); int mods = event.getModifiers(); if (cmd != null && cmd.length() > 0) { char ch = cmd.charAt(0); if (ch < ' ') { if (mods == KeyEvent.CTRL_MASK) { return KeyStroke.getKeyStroke(KeyEvent.VK_A + ch - 1, mods); } } else { return KeyStroke.getKeyStroke(new Character(ch), mods); } } return null; }
@Override public void actionPerformed(ActionEvent e) { JTabbedPane house = mainWindow.getModel().house; if (e.getModifiers() != 2 || house.getTabCount() == 0) mainWindow.onCloseFileMenu(); else { mainWindow.getModel().closeOpenTab(house.getSelectedIndex()); } } });
public void actionPerformed(ActionEvent ae) { lastAction = FIND_ACTION_COMMAND; findReplaceCount = 0; if (FIND_REPLACE_DIALOG.isVisible() && FIND_REPLACE_DIALOG.getTitle().equals(FIND_ACTION_COMMAND)) { } int pos = textComponent.getSelectedText() == null ? textComponent.getCaretPosition() : textComponent.getSelectionStart(); boolean reverse = (ae.getModifiers() & ActionEvent.SHIFT_MASK) != 0; pos = findNext(reverse, pos); if (pos > -1) { String pattern = (String) FIND_FIELD.getSelectedItem(); textComponent.select(pos, pos + pattern.length()); findReplaceCount = 1; } setListStrings(); fireTextEvent(); } }
public void actionPerformed(@NotNull ActionEvent e) { ExTextField target = (ExTextField)getTextComponent(e); final Action currentAction = target.getCurrentAction(); if (currentAction != null) { currentAction.actionPerformed(e); } else { KeyStroke key = convert(e); if (key != null) { final char c = key.getKeyChar(); if (c > 0) { ActionEvent event = new ActionEvent(e.getSource(), e.getID(), "" + c, e.getWhen(), e.getModifiers()); super.actionPerformed(event); target.saveLastEntry(); } } else { super.actionPerformed(e); target.saveLastEntry(); } } } }
private void tbBlackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbBlackActionPerformed filterCardsColor(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbBlackActionPerformed
private void tbInstantsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbInstantsActionPerformed filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbInstantsActionPerformed
private void tbPlaneswalkersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbPlaneswalkersActionPerformed filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbPlaneswalkersActionPerformed
private void tbSpecialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbSpecialActionPerformed filterCardsRarity(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbSpecialActionPerformed
private void tbGreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbGreenActionPerformed filterCardsColor(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbGreenActionPerformed
private void tbBlueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbBlueActionPerformed filterCardsColor(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbBlueActionPerformed
private void tbCommonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbCommonActionPerformed filterCardsRarity(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbCommonActionPerformed
private void tbRareActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbRareActionPerformed filterCardsRarity(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbRareActionPerformed
private void tbWhiteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbWhiteActionPerformed filterCardsColor(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbWhiteActionPerformed
private void tbColorlessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbColorlessActionPerformed filterCardsColor(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbColorlessActionPerformed
private void tbCreaturesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbCreaturesActionPerformed filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbCreaturesActionPerformed
private void tbArifiactsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbArifiactsActionPerformed filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbArifiactsActionPerformed
private void tbSorceriesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbSorceriesActionPerformed filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbSorceriesActionPerformed
private void tbEnchantmentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbEnchantmentsActionPerformed filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbEnchantmentsActionPerformed
private void tbLandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbLandActionPerformed filterCardsType(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbLandActionPerformed
private void tbUncommonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbUncommonActionPerformed filterCardsRarity(evt.getModifiers(), evt.getActionCommand()); }//GEN-LAST:event_tbUncommonActionPerformed