1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.g2d.diagram.participant.pointertool;
14 import org.simantics.g2d.diagram.participant.AbstractDiagramParticipant;
15 import org.simantics.scenegraph.g2d.events.MouseEvent;
18 * @author Toni Kalajainen
20 public abstract class AbstractMode extends AbstractDiagramParticipant {
23 * ID of the mouse that is used for this mode participant. In a single-mouse
24 * setup it will be 0, but may be > 0 in a multi-mouse setup.
26 protected int mouseId;
28 public AbstractMode(int mouseId) {
29 this.mouseId = mouseId;
32 public int getMouseId() {
36 public void setMouseId(int mouseId) {
37 this.mouseId = mouseId;
40 protected boolean isModeMouse(MouseEvent e) {
41 return e.mouseId == mouseId;