Package de.dfki.km.text20.services.pseudorenderer

Examples of de.dfki.km.text20.services.pseudorenderer.RenderElement


            };
        }

        @Override
        public EyeTrackingDeviceInfo getDeviceInfo() {
            return new EyeTrackingDeviceInfo() {

                @Override
                public String getInfo(final String key) {
                    return null;
                }
View Full Code Here


        }

        this.logger.fine("Getting device with selector " + deviceSelector);

        // Obtain the proper tracking device here
        EyeTrackingDeviceProvider deviceProvider = this.pluginManager.getPlugin(EyeTrackingDeviceProvider.class, new OptionCapabilities(deviceSelector));

        // No device is bad ... at this stage ...
        if (deviceProvider == null) {
            this.logger.warning("No tracking device found for " + deviceSelector + "!");
            return;
        }

        this.logger.info("Device found, opening connection to " + trackerConnection);

        // Now open the device
        this.eyeTrackingDevice = deviceProvider.openDevice(trackerConnection);

        // If opening the device didn't work and we have autodetection, use the mouse
        if (this.eyeTrackingDevice == null && autoDetection) {

            this.logger.info("Device did not open. Trying mouse.");

            deviceSelector = "eyetrackingdevice:mouse";

            // Obtain the fallback device here
            deviceProvider = this.pluginManager.getPlugin(EyeTrackingDeviceProvider.class, new OptionCapabilities(deviceSelector));

            // No device is bad ... at this stage ...
            if (deviceProvider == null) {
                this.logger.warning("Still no tracking device found for " + deviceSelector + ". This is really bad.");
                return;
            }

            // Now open the fallback device
            this.eyeTrackingDevice = deviceProvider.openDevice(trackerConnection);

            // Bad luck today.
            if (this.eyeTrackingDevice == null) {
                this.logger.warning("No device found. This is terminal.");
                return;
View Full Code Here

    /* (non-Javadoc)
     * @see de.dfki.km.augmentedtext.services.trackingdevices.TrackingListener#newTrackingEvent(de.dfki.km.augmentedtext.services.trackingdevices.TrackingEvent)
     */
    @Override
    public void newTrackingEvent(final EyeTrackingEvent event) {
        EyeTrackingEvent filteredEvent = event;

        // Sanity check
        if (event == null) return;

        // We ignore invalid points.
View Full Code Here

     */
    @SuppressWarnings("unused")
    private long getAgeOf(final List<EyeTrackingEvent> events) {
        if (events.size() <= 1) return 0;

        final EyeTrackingEvent first = events.get(0);
        final EyeTrackingEvent last = events.get(events.size() - 1);

        return last.getEventTime() - first.getEventTime();
    }
View Full Code Here

     */
    public long getStartTime() {
        final Fixation fixation = this.$fixations.compact().get(0);
        if (fixation == null || fixation.getTrackingEvents() == null) return 0;

        final EyeTrackingEvent trackingEvent = fixation.getTrackingEvents().get(0);
        if (trackingEvent == null) return 0;

        return trackingEvent.getEventTime();
    }
View Full Code Here

     */
    public long getStopTime() {
        final Fixation fixation = this.$fixations.compact().get(-1);
        if (fixation == null || fixation.getTrackingEvents() == null) return 0;

        final EyeTrackingEvent trackingEvent = $(fixation.getTrackingEvents()).get(-1);
        if (trackingEvent == null) return 0;

        return trackingEvent.getEventTime();
    }
View Full Code Here

                        final PointerInfo pointerInfo = MouseInfo.getPointerInfo();

                        // Obtain information from the mouse
                        final Point point = pointerInfo.getLocation();

                        final EyeTrackingEvent event = createEvent(point);

                        MouseTrackingDevice.this.listenerLock.lock();
                        // And dispatch it to the listener
                        for (int i = 0; i < MouseTrackingDevice.this.trackingListener.size(); i++) {
                            final EyeTrackingListener l = MouseTrackingDevice.this.trackingListener.get(i);
View Full Code Here

                this.listenerLock.unlock();
            }
        }

        public EyeTrackingEvent createEvent(final Point p) {
            return new EyeTrackingEvent() {

                long et = System.currentTimeMillis();

                @Override
                public boolean areValid(final EyeTrackingEventValidity... validities) {
View Full Code Here

     *
     * @return .
     */
    private boolean checkLastFixationStopped() {
        if (this.fixation == null) return false;
        final EyeTrackingEvent last = getLast(1).get(0);

        if (last.getGazeCenter().distance(this.fixation) > OUTER_RING_SIZE / 2) {
            this.numOutsideOuterRing++;
        }
        if (last.getGazeCenter().distance(this.fixation) <= INNER_RING_SIZE / 2) {
            this.numOutsideOuterRing = 0;
        }

        if (this.numOutsideOuterRing > FIXATION_THRESHOLD) {
            this.fixation = null;
View Full Code Here

        if (this.eyeTrackingDevice == null) return;

        final AtomicLong lng = new AtomicLong();
        final AtomicBoolean warned = new AtomicBoolean(false);

        this.eyeTrackingDevice.addTrackingListener(new EyeTrackingListener() {

            @Override
            public void newTrackingEvent(final EyeTrackingEvent event) {
                lng.set(System.currentTimeMillis());
            }
View Full Code Here

TOP

Related Classes of de.dfki.km.text20.services.pseudorenderer.RenderElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.