1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.scenegraph.g2d.events;
\r
14 import java.io.Serializable;
\r
16 import org.simantics.scenegraph.g2d.events.MouseEvent.MouseClickEvent;
\r
17 import org.simantics.scenegraph.g2d.events.command.CommandEvent;
\r
21 * @see TimeEvent Time Heatbeat event
\r
22 * @see CommandEvent Command event
\r
23 * @see KeyEvent Keyboard events
\r
24 * @see MouseClickEvent Mouse click event
\r
25 * @see MouseEvent Other mouse event
\r
27 * @author Toni Kalajainen
\r
29 public abstract class Event implements Cloneable, Serializable {
\r
31 private static final long serialVersionUID = -6939802269348658216L;
\r
34 * Object describing the context of event occurrence. Usually an AWT UI
\r
37 public transient final Object context;
\r
40 * Time when event occured. The value is relative; values are comparable
\r
41 * only in the same domain of events (e.g. mouse or key events). The unit is
\r
44 * TODO MAKE BETTER SPECIFICATION
\r
46 public final long time;
\r
48 public Event(Object context, long time) {
\r
49 this.context = context;
\r
53 public Object getContext() {
\r
58 public String toString() {
\r
59 return getClass().getSimpleName() + "[time=" + time + "]";
\r