当前位置: 首页>>代码示例>>Java>>正文


Java ActionEvent.SHIFT_MASK属性代码示例

本文整理汇总了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);
  }
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:19,代码来源:AnnotationEditor.java

示例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;
		}
	}
}
 
开发者ID:drytoastman,项目名称:scorekeeperfrontend,代码行数:23,代码来源:TimeEntry.java

示例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);
	}
}
 
开发者ID:Thecarisma,项目名称:powertext,代码行数:11,代码来源:ConfigurableCaret.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:DefaultCaret.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:DefaultCaret.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: 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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GridBagCustomizer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GridBagCustomizer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GridBagCustomizer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GridBagCustomizer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GridBagCustomizer.java

示例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));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GridBagCustomizer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GridBagCustomizer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GridBagCustomizer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GridBagCustomizer.java


注:本文中的java.awt.event.ActionEvent.SHIFT_MASK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。