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


Java Event.META_MASK屬性代碼示例

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


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

示例1: getMenuKey

public String getMenuKey() {
    int menuShortcutKeyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
    if ((menuShortcutKeyMask & Event.CTRL_MASK) == Event.CTRL_MASK) {
        return "Control";
    }
    if ((menuShortcutKeyMask & Event.META_MASK) == Event.META_MASK) {
        return "Meta";
    }
    return "";
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:JavaElementPropertyAccessor.java

示例2: getMenuKey

public static Keys getMenuKey() {
    int keyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
    if (keyMask == Event.CTRL_MASK) {
        return Keys.CONTROL;
    }
    if (keyMask == Event.META_MASK) {
        return Keys.META;
    }
    if (keyMask == Event.ALT_MASK) {
        return Keys.ALT;
    }
    throw new WebDriverException("Unable to find the keymask... not control or meta?");
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:13,代碼來源:OSUtils.java

示例3: mousePressed

/*********************************************************************
 * Listen to <code>mousePressed</code> events.
 * Update the current point or call the
 * ImageJ's zoom methods.
 * 
 * @param e
 *            Event.
 ********************************************************************/
@Override
public void mousePressed(final MouseEvent e)
{
	final int x = e.getX();
	final int y = e.getY();
	switch (tb.getCurrentTool())
	{
		case turboRegPointHandler.MAGNIFIER:
		{
			int flags = e.getModifiers();
			if ((flags & (Event.ALT_MASK | Event.META_MASK | Event.CTRL_MASK)) != 0)
			{
				mainImp.getWindow().getCanvas().zoomOut(x, y);
			} else
			{
				mainImp.getWindow().getCanvas().zoomIn(x, y);
			}
			break;
		}
		case turboRegPointHandler.MOVE_CROSS:
		{
			final int currentPoint = mainPh.findClosest(x, y);
			secondaryPh.setCurrentPoint(currentPoint);
			updateAndDraw();
			break;
		}
	}
}
 
開發者ID:TOMIGalway,項目名稱:cmoct-sourcecode,代碼行數:36,代碼來源:ImageAlignTool.java

示例4: mousePressed

public void mousePressed (
   final MouseEvent e
) {
   if (dialog.isFinalActionLaunched()) return;
   int x = e.getX(),xp;
   int y = e.getY(),yp;
   int currentPoint;
   boolean doubleClick = (System.currentTimeMillis() - mouseDownTime) <= 250L;
   mouseDownTime = System.currentTimeMillis();
   switch (tb.getCurrentTool()) {
      case ADD_CROSS:
         xp=mainImp.getWindow().getCanvas().offScreenX(x);
         yp=mainImp.getWindow().getCanvas().offScreenY(y);
         mainPh.addPoint(xp,yp);
         xp = positionX(mainImp, secondaryImp, mainImp.getWindow().getCanvas().offScreenX(x));
         yp = positionY(mainImp, secondaryImp, mainImp.getWindow().getCanvas().offScreenY(y));
         secondaryPh.addPoint(xp, yp);
         updateAndDraw();
         break;
      case MOVE_CROSS:
         currentPoint = mainPh.findClosest(x, y);
         secondaryPh.setCurrentPoint(currentPoint);
         updateAndDraw();
         break;
      case REMOVE_CROSS:
         currentPoint = mainPh.findClosest(x, y);
         mainPh.removePoint(currentPoint);
         secondaryPh.removePoint(currentPoint);
         updateAndDraw();
         break;
      case MASK:
      case INVERTMASK:
          if (mainPh.canAddMaskPoints()) {
             if (!doubleClick) {
                if (dialog.isClearMaskSet()) {
                   mainPh.clearMask();
                   dialog.setClearMask(false);
                   dialog.ungrayImage(this);
                }
                x = positionX(mainImp, secondaryImp, mainImp.getWindow().getCanvas().offScreenX(x));
                               y = positionY(mainImp, secondaryImp, mainImp.getWindow().getCanvas().offScreenY(y));
                mainPh.addMaskPoint(x,y);
             } else 
                mainPh.closeMask(tb.getCurrentTool());
             updateAndDraw();
         } else {
             IJ.error("A mask cannot be manually assigned since the mask was already in the stack");
         }
          break;
      case MAGNIFIER:
         final int flags = e.getModifiers();
         if ((flags & (Event.ALT_MASK | Event.META_MASK | Event.CTRL_MASK)) != 0) {
            mainImp.getWindow().getCanvas().zoomOut(x, y);
         }
         else {
            mainImp.getWindow().getCanvas().zoomIn(x, y);
         }
         break;
   }
}
 
開發者ID:akmaier,項目名稱:CONRAD,代碼行數:60,代碼來源:UnwarpJ_.java

示例5: mousePressed

/**
 * Method mouse pressed, allow all the different option over the images.
 *
 * @param e mouse event
 */
public void mousePressed (final MouseEvent e)
{
   if (dialog.isFinalActionLaunched()) 
	   return;
   int x = e.getX(),xp = 0;
   int y = e.getY(),yp = 0;
   int currentPoint = 0;
   boolean doubleClick = (System.currentTimeMillis() - mouseDownTime) <= 250L;
   this.mouseDownTime = System.currentTimeMillis();
   switch (tb.getCurrentTool()) 
   {
      case ADD_CROSS:
         xp = mainImp.getWindow().getCanvas().offScreenX(x);
         yp = mainImp.getWindow().getCanvas().offScreenY(y);
         mainPh.addPoint(xp, yp);

         xp = positionX(mainImp, secondaryImp, mainImp.getWindow().getCanvas().offScreenX(x));
         yp = positionY(mainImp, secondaryImp, mainImp.getWindow().getCanvas().offScreenY(y));
         secondaryPh.addPoint(xp, yp);

         updateAndDraw();
         break;
      case MOVE_CROSS:
         currentPoint = mainPh.findClosest(x, y);
         secondaryPh.setCurrentPoint(currentPoint);
         updateAndDraw();
         break;
      case REMOVE_CROSS:
         currentPoint = mainPh.findClosest(x, y);
         mainPh.removePoint(currentPoint);
         secondaryPh.removePoint(currentPoint);
         updateAndDraw();
         break;
      case MASK:
      case INVERTMASK:
          if (mainPh.canAddMaskPoints())
          {
             if (!doubleClick)
             {
                if (dialog.isClearMaskSet())
                {
                   mainPh.clearMask();
                   dialog.setClearMask(false);
                   dialog.ungrayImage(this);
                }
                x = positionX(mainImp, secondaryImp, mainImp.getWindow().getCanvas().offScreenX(x));
                y = positionY(mainImp, secondaryImp, mainImp.getWindow().getCanvas().offScreenY(y));

                mainPh.addMaskPoint(x, y);
             }
             else
                mainPh.closeMask(tb.getCurrentTool());
             updateAndDraw();
         } else {
             IJ.error("A mask cannot be manually assigned since the mask was already in the stack");
         }
          break;
      case MAGNIFIER:
         final int flags = e.getModifiers();
         if ((flags & (Event.ALT_MASK | Event.META_MASK | Event.CTRL_MASK)) != 0) {
            mainImp.getWindow().getCanvas().zoomOut(x, y);
         }
         else {
            mainImp.getWindow().getCanvas().zoomIn(x, y);
         }
         break;
   }
}
 
開發者ID:akmaier,項目名稱:CONRAD,代碼行數:73,代碼來源:PointAction.java


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