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.scenegraph.g2d.events;
14 import java.io.Serializable;
16 import org.simantics.scenegraph.g2d.events.MouseEvent.MouseClickEvent;
17 import org.simantics.scenegraph.g2d.events.command.CommandEvent;
21 * @see TimeEvent Time Heatbeat event
22 * @see CommandEvent Command event
23 * @see KeyEvent Keyboard events
24 * @see MouseClickEvent Mouse click event
25 * @see MouseEvent Other mouse event
27 * @author Toni Kalajainen
29 public abstract class Event implements Cloneable, Serializable {
31 private static final long serialVersionUID = -6939802269348658216L;
34 * Object describing the context of event occurrence. Usually an AWT UI
37 public transient final Object context;
40 * Time when event occured. The value is relative; values are comparable
41 * only in the same domain of events (e.g. mouse or key events). The unit is
44 * TODO MAKE BETTER SPECIFICATION
46 public final long time;
48 public Event(Object context, long time) {
49 this.context = context;
53 public Object getContext() {
58 public String toString() {
59 return getClass().getSimpleName() + "[time=" + time + "]";