本文整理汇总了Java中java.awt.event.ActionEvent.SHIFT_MASK属性的典型用法代码示例。如果您正苦于以下问题:Java ActionEvent.SHIFT_MASK属性的具体用法?Java ActionEvent.SHIFT_MASK怎么用?Java ActionEvent.SHIFT_MASK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.event.ActionEvent
的用法示例。
在下文中一共展示了ActionEvent.SHIFT_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: keyTyped
@Override
public void keyTyped(KeyEvent e)
{
Object o = e.getSource();
if(o instanceof JTextField || o == enter || o == timeList)
{
int increment = ((e.getModifiers() & ActionEvent.SHIFT_MASK) == ActionEvent.SHIFT_MASK) ? -1 : 1;
switch(e.getKeyChar())
{
case 'c':
case 'C':
cones.setText(Integer.toString(cones.getInt() + increment));
e.consume();
break;
case 'g':
case 'G':
gates.setText(Integer.toString(gates.getInt() + increment));
e.consume();
break;
}
}
}
示例3: adjustCaret
/**
* Adjusts the caret location based on the MouseEvent.
*/
private void adjustCaret(MouseEvent e) {
if ((e.getModifiers()&ActionEvent.SHIFT_MASK)!=0 && getDot()!=-1) {
moveCaret(e);
}
else {
positionCaret(e);
}
}
示例4: adjustCaret
/**
* Adjusts the caret location based on the MouseEvent.
*/
private void adjustCaret(MouseEvent e) {
if ((e.getModifiers() & ActionEvent.SHIFT_MASK) != 0 &&
getDot() != -1) {
moveCaret(e);
} else if (!e.isPopupTrigger()) {
positionCaret(e);
}
}
示例5: adjustCaret
/**
* Adjusts the caret location based on the MouseEvent.
*/
@SuppressWarnings("deprecation")
private void adjustCaret(MouseEvent e) {
if ((e.getModifiers() & ActionEvent.SHIFT_MASK) != 0 &&
getDot() != -1) {
moveCaret(e);
} else if (!e.isPopupTrigger()) {
positionCaret(e);
}
}
示例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: bMinusPaddingButtonActionPerformed
private void bMinusPaddingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bMinusPaddingButtonActionPerformed
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, -changeBy, shift), null, null, null, null);
}
示例8: 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);
}
示例9: 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);
}
示例10: vMinusInsetButtonActionPerformed
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);
}
示例11: yGridMinusButtonActionPerformed
private void yGridMinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_yGridMinusButtonActionPerformed
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, new GridPositionChange(0, NO_INDIRECT_CHANGE, -changeBy, NO_INDIRECT_CHANGE, shift), null, null);
}
示例12: vMinusWeightButtonActionPerformed
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));
}
示例13: hGridMinusButtonActionPerformed
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);
}
示例14: vGridMinusButtonActionPerformed
private void vGridMinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vGridMinusButtonActionPerformed
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(0, NO_INDIRECT_CHANGE, -changeBy, NO_INDIRECT_CHANGE, shift), null);
}
示例15: vMinusPaddingButtonActionPerformed
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);
}