當前位置: 首頁>>代碼示例>>Java>>正文


Java ActionEvent.CTRL_MASK屬性代碼示例

本文整理匯總了Java中java.awt.event.ActionEvent.CTRL_MASK屬性的典型用法代碼示例。如果您正苦於以下問題:Java ActionEvent.CTRL_MASK屬性的具體用法?Java ActionEvent.CTRL_MASK怎麽用?Java ActionEvent.CTRL_MASK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.event.ActionEvent的用法示例。


在下文中一共展示了ActionEvent.CTRL_MASK屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: actionPerformed

@Override
public void actionPerformed(ActionEvent evt) {
  int increment = 1;
  if((evt.getModifiers() & ActionEvent.SHIFT_MASK) > 0) {
    // CTRL pressed -> use tokens for advancing
    increment = SHIFT_INCREMENT;
    if((evt.getModifiers() & ActionEvent.CTRL_MASK) > 0) {
      increment = CTRL_SHIFT_INCREMENT;
    }
  }
  long newValue = ann.getStartNode().getOffset().longValue() - increment;
  if(newValue < 0) newValue = 0;
  try {
    moveAnnotation(set, ann, new Long(newValue), ann.getEndNode()
        .getOffset());
  } catch(InvalidOffsetException ioe) {
    throw new GateRuntimeException(ioe);
  }
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:19,代碼來源:AnnotationEditor.java

示例2: isValidDefaultTypedAction

/**
 * Checks that the action will result in an insertion into document. 
 * Returns true for readonly docs as well.
 * 
 * @param evt action event
 * @return true, if the action event will result in insertion; readonly doc status is not 
 * checked.
 */
static boolean isValidDefaultTypedAction(ActionEvent evt) {
    // Check whether the modifiers are OK
    int mod = evt.getModifiers();
    boolean ctrl = ((mod & ActionEvent.CTRL_MASK) != 0);
    boolean alt = org.openide.util.Utilities.isMac() ? ((mod & ActionEvent.META_MASK) != 0) :
        ((mod & ActionEvent.ALT_MASK) != 0);
    return !(alt || ctrl);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:BaseKit.java

示例3: actionPerformed

/**
	 * This method is final so that you cannot override it and mess up the
	 * macro-recording part of it.  The actual meat of the action is in
	 * <code>actionPerformedImpl</code>.
	 *
	 * @param e The action being performed.
	 * @see #actionPerformedImpl
	 */
	@Override
	public final void actionPerformed(ActionEvent e) {

		JTextComponent textComponent = getTextComponent(e);
		if (textComponent instanceof RTextArea) {
			RTextArea textArea = (RTextArea)textComponent;
			//System.err.println("Recordable action: " + getMacroID());
			if (RTextArea.isRecordingMacro() && isRecordable()) {
				int mod = e.getModifiers();
				// We ignore keypresses involving ctrl/alt/meta if they are
				// "default" keypresses - i.e., they aren't some special
				// action like paste (e.g., paste would return Ctrl+V, but
				// its action would be "paste-action").
				String macroID = getMacroID();
//System.err.println(macroID);
//System.err.println("... " + (mod&ActionEvent.ALT_MASK));
//System.err.println("... " + (mod&ActionEvent.CTRL_MASK));
//System.err.println("... " + (mod&ActionEvent.META_MASK));
				if (!DefaultEditorKit.defaultKeyTypedAction.equals(macroID) || (
						(mod&ActionEvent.ALT_MASK)==0 &&
						(mod&ActionEvent.CTRL_MASK)==0 &&
						(mod&ActionEvent.META_MASK)==0)
					) {
					String command = e.getActionCommand();
					RTextArea.addToCurrentMacro(macroID, command);
					//System.err.println("... recording it!");
				}
			}
			actionPerformedImpl(e, textArea);
		}

	}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:40,代碼來源:RecordableTextAction.java

示例4: formMouseWheelMoved

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);
    }
}
 
開發者ID:buni-rock,項目名稱:Pixie,代碼行數:10,代碼來源:BoundingBoxWindow.java

示例5: mouseReleasedAction

/**
 * Implements the action which happens on mouse released action.
 *
 * @param e triggered mouse event
 */
private void mouseReleasedAction(MouseEvent e) {
    currentMouse.setLocation(e.getPoint());

    //notify the gui to update the cropped image
    switch (drawType) {
        case DRAW_CROP:
            saveCurrentBBox();
            observable.notifyObservers(ObservedActions.Action.OPEN_CROP_SEGMENTATION);
            break;

        case DRAW_BOUNDING_BOX:
            saveCurrentBBox();
            observable.notifyObservers(ObservedActions.Action.OPEN_BBOX_SEGMENTATION);
            break;

        case DRAW_POLYGON:
            currentPolygon.addPoint(currentMouse.x, currentMouse.y);
            break;

        case EDIT_MODE:
            // if edit mode and ctrl + mouse clicked => add crop to object
            if (((e.getModifiers() & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK) || addCropToObj) {
                saveCurrentBBox();
                observable.notifyObservers(ObservedActions.Action.CTRL_MOUSE_EVENT);

                // deactivate the drawing features
                addCropToObj = false;
                drawGuideShape = false;
                jLBoxSize.setVisible(drawGuideShape);
            }
            break;

        default:
            break;
    }
}
 
開發者ID:buni-rock,項目名稱:Pixie,代碼行數:41,代碼來源:DrawingPanel.java

示例6: hMinusPaddingButtonActionPerformed

private void hMinusPaddingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hMinusPaddingButtonActionPerformed
    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(-changeBy, 0, shift), null, null, null, null);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:GridBagCustomizer.java

示例7: hPlusLeftInsetButtonActionPerformed

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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:GridBagCustomizer.java

示例8: vPlusBottomInsetButtonActionPerformed

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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:GridBagCustomizer.java

示例9: vPlusTopInsetButtonActionPerformed

private void vPlusTopInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vPlusTopInsetButtonActionPerformed
    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, 0, 0, false), null, null, null);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:GridBagCustomizer.java

示例10: bMinusInsetButtonActionPerformed

private void bMinusInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bMinusInsetButtonActionPerformed
    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, -changeBy, -changeBy, -changeBy, shift), null, null, null);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:GridBagCustomizer.java

示例11: hMinusInsetButtonActionPerformed

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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:GridBagCustomizer.java

示例12: hPlusInsetButtonActionPerformed

private void hPlusInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hPlusInsetButtonActionPerformed
    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, changeBy, false), null, null, null);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:GridBagCustomizer.java

示例13: vMinusTopInsetButtonActionPerformed

private void vMinusTopInsetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vMinusTopInsetButtonActionPerformed
    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, 0, 0, shift), null, null, null);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:GridBagCustomizer.java

示例14: xGridPlusButtonActionPerformed

private void xGridPlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_xGridPlusButtonActionPerformed
    int changeBy = STANDARD_SIZE_CHANGE;
    if (( evt.getModifiers() & ActionEvent.CTRL_MASK ) != 0) changeBy = ACCELERATED_SIZE_CHANGE;
    update(-1, -1, null, null, null, new GridPositionChange(changeBy, NO_INDIRECT_CHANGE, 0, NO_INDIRECT_CHANGE, false), null, null);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:GridBagCustomizer.java

示例15: yGridPlusButtonActionPerformed

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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:GridBagCustomizer.java


注:本文中的java.awt.event.ActionEvent.CTRL_MASK屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。