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


Java MouseEvent.isConsumed方法代码示例

本文整理汇总了Java中java.awt.event.MouseEvent.isConsumed方法的典型用法代码示例。如果您正苦于以下问题:Java MouseEvent.isConsumed方法的具体用法?Java MouseEvent.isConsumed怎么用?Java MouseEvent.isConsumed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.event.MouseEvent的用法示例。


在下文中一共展示了MouseEvent.isConsumed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handlePress

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void handlePress(MouseEvent e) {

	if (!e.isConsumed()) {
		start = mediator.snap(e.getPoint());
		firstPort = port = getOutPortViewAt(e.getX(), e.getY());

		if (firstPort != null) {
			start = mediator.toScreen(firstPort.getLocation(null));
			////				Giuseppe De Cicco & Fabio Granara
			//				aa = (JmtCell)((OutputPort)(firstPort.getCell())).getParent();
			//				aa.okout=true;
		}
		e.consume();
	}
	pressed = true;
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:18,代码来源:ConnectState.java

示例2: handleMove

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void handleMove(MouseEvent e) {

	if (ml.getPreviousCursor() == null) {
		ml.setPreviousCursor(mediator.getGraphCursor());
	}
	if (mediator.isGraphEnabled()) {
		if (ml.getMarquee() != null) {
			ml.getMarquee().mouseMoved(e);
		}
		if (ml.getHandle() != null) {
			ml.getHandle().mouseMoved(e);
		}
		if (!e.isConsumed() && ml.getPreviousCursor() != null) {
			mediator.setGraphCursor(ml.getPreviousCursor());
			ml.setPreviousCursor(null);
		}

	}

	e.consume();
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:23,代码来源:SelectState.java

示例3: mouseDragged

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * 
 */
public void mouseDragged(MouseEvent e)
{
	if (!e.isConsumed() && start != null)
	{
		int dx = e.getX() - start.x;
		int dy = e.getY() - start.y;

		Rectangle r = graphComponent.getViewport().getViewRect();

		int right = r.x + ((dx > 0) ? 0 : r.width) - dx;
		int bottom = r.y + ((dy > 0) ? 0 : r.height) - dy;

		graphComponent.getGraphControl().scrollRectToVisible(
				new Rectangle(right, bottom, 0, 0));

		e.consume();
	}
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:22,代码来源:mxPanningHandler.java

示例4: handleDrag

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void handleDrag(MouseEvent e) {
	if (firstPort != null) {
		if (!e.isConsumed()) {
			Graphics2D g = mediator.getGraphGraphics();
			Color bg = mediator.getGraphBackground();
			Color fg = Color.BLACK;
			g.setColor(fg);
			g.setXORMode(bg);
			overlay(g);

			current = mediator.snap(e.getPoint());
			port = getInPortViewAt(e.getX(), e.getY());
			if (port != null) {
				current = mediator.toScreen(port.getLocation(null));
			}

			g.setColor(bg);
			g.setXORMode(fg);
			overlay(g);
			e.consume();
		}
	}
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:25,代码来源:ConnectState.java

示例5: mouseReleased

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * 
 */
public void mouseReleased(MouseEvent e)
{
	if (!e.isConsumed() && start != null)
	{
		int dx = Math.abs(start.x - e.getX());
		int dy = Math.abs(start.y - e.getY());

		if (graphComponent.isSignificant(dx, dy))
		{
			e.consume();
		}
	}

	start = null;
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:19,代码来源:mxPanningHandler.java

示例6: mousePressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * 
 */
public void mousePressed(MouseEvent e) {
  if (graphComponent.isEnabled() && isEnabled() && !e.isConsumed() && isStartEvent(e)) {
    start(e);
    e.consume();
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:10,代码来源:mxInsertHandler.java

示例7: handleDrag

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void handleDrag(MouseEvent e) {

	if (firstPort != null) {
		if (!e.isConsumed()) {
			Graphics2D g = mediator.getGraphGraphics();
			Color bg = mediator.getGraphBackground();
			Color fg = Color.black;
			g.setColor(fg);
			g.setXORMode(bg);
			overlay(g);

			current = mediator.snap(e.getPoint());

			port = getInPortViewAt(e.getX(), e.getY());
			if (port != null) {
				current = mediator.toScreen(port.getLocation(null));
			}

			g.setColor(bg);
			g.setXORMode(fg);
			overlay(g);
			e.consume();
		}
	}

}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:28,代码来源:ConnectState.java

示例8: mouseReleased

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * 
 */
public void mouseReleased(MouseEvent e) {
  if (graphComponent.isEnabled() && isEnabled() && !e.isConsumed() && first != null) {
    double deg = 0;
    Object cell = null;

    if (currentState != null) {
      cell = currentState.getCell();
      /*
       * deg = mxUtils.getDouble(currentState.getStyle(), mxConstants.STYLE_ROTATION);
       */
    }

    deg += currentAngle * mxConstants.DEG_PER_RAD;
    boolean willExecute = cell != null && first != null;

    // TODO: Call reset before execute in all handlers that
    // offer an execute method
    reset();

    if (graphComponent.isEnabled() && isEnabled() && !e.isConsumed() && willExecute) {
      graphComponent.getGraph().setCellStyles(mxConstants.STYLE_ROTATION, String.valueOf(deg),
          new Object[] {cell});

      graphComponent.getGraphControl().repaint();

      e.consume();
    }
  }

  currentState = null;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:35,代码来源:mxRotationHandler.java

示例9: mouseReleased

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * 
 */
public void mouseReleased(MouseEvent e) {
  Rectangle rect = bounds;
  reset();

  if (!e.isConsumed() && rect != null && graphComponent.isSignificant(rect.width, rect.height)) {
    select(rect, e);
    e.consume();
  }

}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:14,代码来源:mxRubberband.java

示例10: mouseClicked

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseClicked(MouseEvent e) {
    lastEvent = e;
    if (timer.isRunning() && !e.isConsumed() && e.getClickCount() > 1) {
        doubleClick(lastEvent);
        timer.stop();
    } else {
        timer.restart();
    }
}
 
开发者ID:phweda,项目名称:MFM,代码行数:11,代码来源:ClickListener.java

示例11: mousePressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * Dispatches the mousepressed event to the subhandles. This is called from the connection handler
 * as subhandles have precedence over the connection handler.
 */
public void mousePressed(MouseEvent e) {
  if (graphComponent.isEnabled() && !graphComponent.isForceMarqueeEvent(e) && isEnabled()) {
    Iterator<mxCellHandler> it = handlers.values().iterator();

    while (it.hasNext() && !e.isConsumed()) {
      it.next().mousePressed(e);
    }
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:14,代码来源:mxSelectionCellsHandler.java

示例12: mouseMoved

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * 
 */
public void mouseMoved(MouseEvent e) {
  if (graphComponent.isEnabled() && isEnabled()) {
    Iterator<mxCellHandler> it = handlers.values().iterator();

    while (it.hasNext() && !e.isConsumed()) {
      it.next().mouseMoved(e);
    }
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:13,代码来源:mxSelectionCellsHandler.java

示例13: mouseDragged

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * 
 */
public void mouseDragged(MouseEvent e)
{
	if (!e.isConsumed() && graphComponent.isEnabled() && isEnabled())
	{
		// Activates the handler
		if (!active && first != null)
		{
			double dx = Math.abs(first.getX() - e.getX());
			double dy = Math.abs(first.getY() - e.getY());
			int tol = graphComponent.getTolerance();
			
			if (dx > tol || dy > tol)
			{
				active = true;
			}
		}
		
		if (e.getButton() == 0 || (isActive() && connectPreview.isActive()))
		{
			mxCellState state = marker.process(e);

			if (connectPreview.isActive())
			{
				connectPreview.update(e, marker.getValidState(), e.getX(),
						e.getY());
				setBounds(null);
				e.consume();
			}
			else
			{
				source = state;
			}
		}
	}
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:39,代码来源:mxConnectionHandler.java

示例14: mousePressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * Processes the given event.
 */
public void mousePressed(MouseEvent e)
{
	if (!e.isConsumed())
	{
		int tmp = getIndexAt(e.getX(), e.getY());

		if (!isIgnoredEvent(e) && tmp >= 0 && isHandleEnabled(tmp))
		{
			graphComponent.stopEditing(true);
			start(e, tmp);
			e.consume();
		}
	}
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:18,代码来源:mxCellHandler.java

示例15: mouseClicked

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public synchronized void mouseClicked(MouseEvent e) {
    if (!e.isConsumed()) {
        if (selected != null) selected.removeUserDatum("SELECTED");
        selected = null;
        msgBox.setText("---");
    }
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:8,代码来源:CrookedRun.java


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