本文整理汇总了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;
}
示例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();
}
示例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();
}
}
示例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();
}
}
}
示例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;
}
示例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();
}
}
示例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();
}
}
}
示例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;
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}
}
}
}
示例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();
}
}
}
示例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("---");
}
}