X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fevent%2Fadapter%2FSWTFocusAdapter.java;fp=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fevent%2Fadapter%2FSWTFocusAdapter.java;h=d0b4f63c8510360161496d9eb7f6ba32a178b833;hp=304b8a95918a91808e2672ee74cf573e92f4ac36;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/event/adapter/SWTFocusAdapter.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/event/adapter/SWTFocusAdapter.java index 304b8a959..d0b4f63c8 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/event/adapter/SWTFocusAdapter.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/event/adapter/SWTFocusAdapter.java @@ -1,48 +1,48 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.g2d.event.adapter; - -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.simantics.scenegraph.g2d.events.IEventHandler; -import org.simantics.scenegraph.g2d.events.IEventQueue; -import org.simantics.scenegraph.g2d.events.FocusEvent.FocusGainedEvent; -import org.simantics.scenegraph.g2d.events.FocusEvent.FocusLostEvent; -import org.simantics.scenegraph.g2d.events.adapter.AbstractEventAdapter; - -/** - * Adapts SWT focus event to G2D event - * - * @author Toni Kalajainen - */ -public class SWTFocusAdapter extends AbstractEventAdapter implements FocusListener { - - public SWTFocusAdapter(Object sender, IEventHandler delegator) { - super(sender, delegator); - } - - public SWTFocusAdapter(Object sender, IEventQueue queue) { - super(sender, queue); - } - - @Override - public void focusGained(FocusEvent e) { - handleEvent(new FocusGainedEvent(sender, e.time)); - } - - @Override - public void focusLost(FocusEvent e) { - handleEvent(new FocusLostEvent(sender, e.time)); - - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.g2d.event.adapter; + +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.simantics.scenegraph.g2d.events.IEventHandler; +import org.simantics.scenegraph.g2d.events.IEventQueue; +import org.simantics.scenegraph.g2d.events.FocusEvent.FocusGainedEvent; +import org.simantics.scenegraph.g2d.events.FocusEvent.FocusLostEvent; +import org.simantics.scenegraph.g2d.events.adapter.AbstractEventAdapter; + +/** + * Adapts SWT focus event to G2D event + * + * @author Toni Kalajainen + */ +public class SWTFocusAdapter extends AbstractEventAdapter implements FocusListener { + + public SWTFocusAdapter(Object sender, IEventHandler delegator) { + super(sender, delegator); + } + + public SWTFocusAdapter(Object sender, IEventQueue queue) { + super(sender, queue); + } + + @Override + public void focusGained(FocusEvent e) { + handleEvent(new FocusGainedEvent(sender, e.time)); + } + + @Override + public void focusLost(FocusEvent e) { + handleEvent(new FocusLostEvent(sender, e.time)); + + } + +}