Java Code Examples for java.awt.event.ActionEvent#CTRL_MASK

The following examples show how to use java.awt.event.ActionEvent#CTRL_MASK . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: netbeans   File: ExtKit.java    License: Apache License 2.0 6 votes vote down vote up
public @Override void actionPerformed(ActionEvent evt, JTextComponent target) {
    String cmd = evt.getActionCommand();
    int mod = evt.getModifiers();

    // Dirty fix for Completion shortcut on Unix !!!
    if (cmd != null && cmd.equals(" ") && (mod == ActionEvent.CTRL_MASK)) { // NOI18N
        // Ctrl + SPACE
    } else {
        Caret caret = target.getCaret();
        if (caret instanceof ExtCaret) {
            ((ExtCaret)caret).requestMatchBraceUpdateSync(); // synced bracket update
        }
        super.actionPerformed(evt, target);
    }

    if ((target != null) && (evt != null)) {
        if ((cmd != null) && (cmd.length() == 1)) {
            // Check whether char that should reindent the line was inserted
            checkIndentHotChars(target, cmd);

            // Check the completion
            checkCompletion(target, cmd);
        }
    }
}
 
Example 2
Source Project: openAGV   File: MoveAction.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
  AffineTransform tx = new AffineTransform();

  // TODO: Make these factors configurable?
  if ((e.getModifiers() & ActionEvent.CTRL_MASK) > 0) {
    tx.translate(dx * 10, dy * 10);
  }
  else if ((e.getModifiers() & ActionEvent.SHIFT_MASK) > 0) {
    tx.translate(dx, dy);
  }
  else {
    tx.translate(dx * 5, dy * 5);
  }

  Set<Figure> transformedFigures = new HashSet<>();

  for (Figure f : getView().getSelectedFigures()) {
    if (f.isTransformable()) {
      transformedFigures.add(f);
      f.willChange();
      f.transform(tx);
      f.changed();
    }
  }

  fireUndoableEditHappened(new TransformEdit(transformedFigures, tx));
}
 
Example 3
Source Project: Pixie   File: BoundingBoxWindow.java    License: MIT License 5 votes vote down vote up
private void formMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_formMouseWheelMoved
    int notches = evt.getWheelRotation();
    if ((evt.getModifiers() & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK) {
        // Ctrl + mouse scroll => change the border size
        changeBorderSize(notches);
    } else {
        // mouse scroll => zoom
        zoomImage(notches);
    }
}
 
Example 4
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void vPlusBottomInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vPlusBottomInsetButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, null, new InsetsChange(0, 0, changeBy, 0, false), null, null, null);
}
 
Example 5
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void hPlusLeftInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hPlusLeftInsetButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, null, new InsetsChange(0, changeBy, 0, 0, false), null, null, null);
}
 
Example 6
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void hPlusPaddingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hPlusPaddingButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, new PaddingChange(changeBy, 0, false), null, null, null, null);
}
 
Example 7
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void hPlusRightInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hPlusRightInsetButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, null, new InsetsChange(0, 0, 0, changeBy, false), null, null, null);
}
 
Example 8
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void bPlusPaddingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bPlusPaddingButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, new PaddingChange(changeBy, changeBy, false), null, null, null, null);
}
 
Example 9
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void vMinusPaddingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vMinusPaddingButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    boolean shift = ( evt.getModifiers() & ActionEvent.SHIFT_MASK ) != 0;
    update(-1, -1, null, new PaddingChange(0, -changeBy, shift), null, null, null, null);
}
 
Example 10
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void hMinusInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hMinusInsetButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    boolean shift = ( evt.getModifiers() & ActionEvent.SHIFT_MASK ) != 0;
    update(-1, -1, null, null, new InsetsChange(0, -changeBy, 0, -changeBy, shift), null, null, null);
}
 
Example 11
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void hGridPlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hGridPlusButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, null, null, null, new GridSizeChange(changeBy, NO_INDIRECT_CHANGE, 0, NO_INDIRECT_CHANGE, false), null);
}
 
Example 12
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void vMinusInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vMinusInsetButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    boolean shift = ( evt.getModifiers() & ActionEvent.SHIFT_MASK ) != 0;
    update(-1, -1, null, null, new InsetsChange(-changeBy, 0, -changeBy, 0, shift), null, null, null);
}
 
Example 13
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void vPlusInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vPlusInsetButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, null, new InsetsChange(changeBy, 0, changeBy, 0, false), null, null, null);
}
 
Example 14
void rCopyButton_actionPerformed(ActionEvent e) {
  boolean isFormatted = 0 != (e.getModifiers() & ActionEvent.CTRL_MASK);
  tbModel.copyResult(isFormatted);
}
 
Example 15
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void hGridMinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hGridMinusButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    boolean shift = ( evt.getModifiers() & ActionEvent.SHIFT_MASK ) != 0;
    update(-1, -1, null, null, null, null, new GridSizeChange(-changeBy, NO_INDIRECT_CHANGE, 0, NO_INDIRECT_CHANGE, shift), null);
}
 
Example 16
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void yGridPlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_yGridPlusButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, null, null, new GridPositionChange(0, NO_INDIRECT_CHANGE, changeBy, NO_INDIRECT_CHANGE, false), null, null);
}
 
Example 17
public boolean isMiddleButtonDefault(ActionEvent e) {
    return (e.getModifiers() & ActionEvent.CTRL_MASK) != ActionEvent.CTRL_MASK;
}
 
Example 18
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void vGridPlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vGridPlusButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, null, null, null, new GridSizeChange(0, NO_INDIRECT_CHANGE, changeBy, NO_INDIRECT_CHANGE, false), null);
}
 
Example 19
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void vMinusWeightButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vMinusWeightButtonActionPerformed
    double changeBy = STANDARD_WEIGHT_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_WEIGHT_CHANGE;
    boolean shift = ( evt.getModifiers() & ActionEvent.SHIFT_MASK ) != 0;
    update(-1, -1, null, null, null, null, null, new WeightChange(0.0d, NO_INDIRECT_CHANGE, -changeBy, NO_INDIRECT_CHANGE, shift));
}
 
Example 20
Source Project: netbeans   File: GridBagCustomizer.java    License: Apache License 2.0 4 votes vote down vote up
private void vPlusWeightButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vPlusWeightButtonActionPerformed
    double changeBy = STANDARD_WEIGHT_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_WEIGHT_CHANGE;
    update(-1, -1, null, null, null, null, null, new WeightChange(0.0d, NO_INDIRECT_CHANGE, changeBy, NO_INDIRECT_CHANGE, false));
}