]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/pointertool/AbstractMode.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / diagram / participant / pointertool / AbstractMode.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.g2d.diagram.participant.pointertool;
13
14 import org.simantics.g2d.diagram.participant.AbstractDiagramParticipant;
15 import org.simantics.scenegraph.g2d.events.MouseEvent;
16
17 /**
18  * @author Toni Kalajainen
19  */
20 public abstract class AbstractMode extends AbstractDiagramParticipant {
21
22     /**
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.
25      */
26     protected int mouseId;
27
28     public AbstractMode(int mouseId) {
29         this.mouseId = mouseId;
30     }
31
32     public int getMouseId() {
33         return mouseId;
34     }
35
36     public void setMouseId(int mouseId) {
37         this.mouseId = mouseId;
38     }
39
40     protected boolean isModeMouse(MouseEvent e) {
41         return e.mouseId == mouseId;
42     }
43
44 }