本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}