當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。