Commit b669e054 authored by Eric Tobias's avatar Eric Tobias

2.1.0 - Added SpatialEvent and its listener.

parent c43934be
2.1.0
+ Adding event broadcaster for TUI context events.
+ Added spatial handler to handle spatial positioning of tangibles.
2.0.0
+ Added abstraction layer (Adapter) to decouple core from the tangible protocol (TUIO)
+ Added network abstraction layer and implemented concrete examples (Bluetooth, Wifi, and Serial IO)
\ No newline at end of file
This diff is collapsed.
......@@ -27,7 +27,7 @@ import java.util.EventObject;
*
* @author Eric TOBIAS [eric.tobias@list.lu]
* @since 1.0
* @version 1.0.2
* @version 2.0.42
*/
@NonNullByDefault
public class ContextEvent extends EventObject {
......@@ -74,9 +74,9 @@ public class ContextEvent extends EventObject {
* Enumeration denoting all context types that are captured by the enclosing
* {@link ContextEvent} class.
*
* @author Eric TOBIAS [eric.tobias@tudor.lu]
* @since 5 Mar 2014
* @version 1
* @author Eric TOBIAS [eric.tobias@list.lu]
* @since 1.0
* @version 2.0.42
*/
public enum ContextType {
/** A cursor is dropped into the context. */
......@@ -90,6 +90,12 @@ public class ContextEvent extends EventObject {
/** An object is moved within the context. */
OBJECT_MOVE,
/** An object is lifted from the context. */
OBJECT_LIFT;
OBJECT_LIFT,
/** A blob is dropped from the context. */
BLOB_DROP,
/** A blob is moved from the context. */
BLOB_MOVE,
/** A blob is lifted from the context. */
BLOB_LIFT;
}
}
\ No newline at end of file
/**
* Copyright Luxembourg Institute of Science and Technology, 2015. All rights reserved.
*
* This file is part of TULIP.
*
* TULIP is free software: you can redistribute it and/or modify it under the terms of the GNU
* Lesser General Public License as published by the Free Software Foundation, version 3 of the
* License.
*
* TULIP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with TULIP. If
* not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
*/
package lu.list.itis.dkd.tui.event;
import lu.list.itis.dkd.dbc.annotation.NonNullByDefault;
import lu.list.itis.dkd.tui.adapter.TangibleObject;
import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.utility.ScreenCoordinates;
import com.google.common.base.Preconditions;
import java.util.EventObject;
/**
* Class used to disseminate spatial events. Events are to be triggered when elements in the spatial
* domain of the interface are added, removed, or moved. The event contains a source, usually the
* tangible object that is the root of the spatial (dis)placement and the location the event was
* triggered on, and the type of even.<br>
* <br>
*
* <b>Note</b> that the location is expressed as {@link ScreenCoordinates}.
*
* @author Eric Tobias [eric.tobias@list.lu]
* @since 2.1
* @version 2.1.0
*/
@NonNullByDefault
public class SpatialEvent extends EventObject {
private static final long serialVersionUID = 7414656845719882078L;
protected Point location;
/**
* Constructor initializing all fields.
*
* @param source
* The source of the {@link SpatialEvent}, that is, the tangible object that triggered
* the event.
* @param location
* The location the event was triggered on. Note that the location must be expressed in
* {@link ScreenCoordinates}.
* @ore location.getState().getClass() == ScreenCoordinates.class
*/
public SpatialEvent(TangibleObject source, Point location) {
super(source);
Preconditions.checkArgument(location.getState().getClass().equals(ScreenCoordinates.class), "The location must be given in screen coordinates!"); //$NON-NLS-1$
this.location = location;
}
/**
* Simple getter method for location.
*
* @return The value of location.
*/
public Point getLocation() {
return location;
}
}
\ No newline at end of file
/**
* Copyright Luxembourg Institute of Science and Technology, 2015. All rights reserved.
*
* This file is part of TULIP.
*
* TULIP is free software: you can redistribute it and/or modify it under the terms of the GNU
* Lesser General Public License as published by the Free Software Foundation, version 3 of the
* License.
*
* TULIP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with TULIP. If
* not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
*/
package lu.list.itis.dkd.tui.event;
import lu.list.itis.dkd.dbc.annotation.NonNullByDefault;
import java.util.EventListener;
/**
* Interface specifying the contract for {@link SpatialEventListener} instances.
*
* @author Eric Tobias [eric.tobias@list.lu]
* @since 2.1
* @version 2.1.0
*/
@NonNullByDefault
public interface SpatialEventListener extends EventListener {
/**
* Method invoked when the context is changed.
*
* @param event
* The event holding the source and location of the spacial happening.
*/
public void spaceUpdated(SpatialEvent event);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment