Package de.dfki.km.text20.browserplugin.services.mastergazehandler.impl.gazehandler.old

Examples of de.dfki.km.text20.browserplugin.services.mastergazehandler.impl.gazehandler.old.ReadingHandlerOld$Event


            @Override
            public void newEvaluationEvent(final FixationEvent event) {
                newGazeEvent(event);
            }

        }, new OptionFixationParameters(30, 25, 2));
    }
View Full Code Here


        if (selectedCreator == null) {
            this.logger.warning("No handler found for requested listener " + listener.getClass().getInterfaces()[0]);
            return;
        }

        final GazeHandler spawnEvaluator = selectedCreator.spawnEvaluator(listener, new OptionGazeEvaluatorPassthrough(options), new OptionGazeEvaluator(this));

        // Even worse: the handler was unable to spawn something
        if (spawnEvaluator == null) { throw new IllegalStateException("Unable to spawn the selected evaluator. This is a bug."); }

        // Register the evaluator
View Full Code Here

        if (selectedCreator == null) {
            this.logger.warning("No handler found for requested listener " + listener.getClass().getInterfaces()[0]);
            return;
        }

        final GazeHandler spawnEvaluator = selectedCreator.spawnEvaluator(listener, new OptionGazeEvaluatorPassthrough(options), new OptionGazeEvaluator(this));

        // Even worse: the handler was unable to spawn something
        if (spawnEvaluator == null) { throw new IllegalStateException("Unable to spawn the selected evaluator. This is a bug."); }

        // Register the evaluator
View Full Code Here

        if (this.lastFixations.size() < 3) return;

        // Check if we should look for a new fixation line ...
        if (this.currentFixationLine == null) {
            final FixationLineImpl candidata = createFixationLine(getLast(3));
            final FixationLineUtil flu = new FixationLineUtil(candidata);

            // Check start of line.
            for (double d : flu.getAllAngles()) {
                if (Math.abs(d) > 0.4) return;
            }
            // if (flu.getDimension().width > 100) return;
            // if (flu.getAvgVerticalDeviation() > 50) return;

            this.currentFixationLine = candidata;
            this.avgStartLength = flu.getAvgSaccadeLength();

            dispatch(FixationLineEventType.FIXATION_LINE_STARTED);
            this.misdetected = 0;
        } else {
            // ... or for a continuation
            final FixationLineUtil flu = new FixationLineUtil(this.currentFixationLine);
            final Fixation lastProperFixation = flu.getLastFixations(1).get(0);

            final Point properCenter = lastProperFixation.getCenter();
            final Point currentCenter = getLast(1).get(0).getCenter();

            final int oldMis = this.misdetected;

            // Check backward jump distance
            if (currentCenter.x - properCenter.x < -2 * this.avgStartLength) {
                this.misdetected++;
            }

            // Check forward jump distance
            if (currentCenter.x - properCenter.x > 2.5 * this.avgStartLength) {
                this.misdetected++;
            }

            // Check angle (TODO...)
            if (Math.abs(flu.getAverageYPosition() - currentCenter.y) > 50) {
                this.misdetected++;
            }

            // Check current status and dispatch
            if (oldMis < this.misdetected) {
View Full Code Here

        //    if (!this.pseudorenderer.getStatus().contains(PseudorendererStatus.VISIBLE))
        //        return;
        // }

        final FixationLine fl = event.getFixationLine();
        final FixationLineUtil flu = new FixationLineUtil(fl);

        //
        // If the fixation line was started, pick an appropriate line of text
        //
        if (event.getEventType() == FixationLineEventType.FIXATION_LINE_STARTED) {
            //
        }

        //
        // In case the line was continued
        //
        if (event.getEventType() == FixationLineEventType.FIXATION_LINE_CONTINUED) {
            //
        }

        //
        // In case the line was continued
        //
        if (event.getEventType() == FixationLineEventType.FIXATION_LINE_ENDED) {
            //
        }

        final List<Fixation> lastFixations = flu.getLastFixations(2);

        final Fixation a = lastFixations.get(0);
        final Fixation b = lastFixations.get(1);

        dispatchWith(fl, a, b);
View Full Code Here

                    return saccade;
                }

                @Override
                public long getGenerationTime() {
                    return new FixationUtil(currentFixation).getEndDate().getTime();
                }
            });
        }
    }
View Full Code Here

        }

        // Big, fat TODO: Adjust this based on the actual speed.
        float readSpeed = (p2.x - p1.x) / 100.0f;

        final FixationsUtil fu = new FixationsUtil(lastFixations);
        final Rectangle rectangle = fu.getRectangle();
        final Collection<RenderElement> elementsForDocumentArea = new ArrayList<RenderElement>();

        // Might be null in some cases
        if (rectangle != null) {
            final Point location = this.pseudorenderer.convertPoint(rectangle.getLocation(), CoordinatesType.SCREEN_BASED, CoordinatesType.DOCUMENT_BASED);
View Full Code Here

        // Try to obtain the speed in characters per second
        if (this.pseudorenderer != null) {
            Collection<RenderElement> allElementsIntersecting;

            RenderElement r1 = null;
            RenderElement r2 = null;

            // Get elements at fixation point
            allElementsIntersecting = this.pseudorenderer.getAllElementsIntersecting(new Rectangle(p1, new Dimension(1, 1)), CoordinatesType.SCREEN_BASED, new OptionMagnetic());
            for (RenderElement renderElement : allElementsIntersecting) {
                r1 = renderElement;
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    @Override
    public <T extends RenderElement> T createElement(Class<T> renderElement) {

        RenderElement re = null;

        if (renderElement.isAssignableFrom(TextualRenderElement.class)) {
            re = new TextualRenderElementImpl(this);
        }

        if (renderElement.isAssignableFrom(GraphicalRenderElement.class)) {
            re = new GraphicalRenderElementImpl(this);
        }

        if (re == null && renderElement.isAssignableFrom(RenderElement.class)) {
            re = new RenderElementImpl(this);
        }

        // Sanity check
        if (re == null)
            throw new IllegalStateException("Ups, render element must not be null at this point");

        this.elementsLock.lock();
        try {
            this.renderElements.add(re);
        } finally {
            this.elementsLock.unlock();
        }

        // Make element visible at first
        re.setVisible(true);

        return (T) re;
    }
View Full Code Here

        // In case we have no intersections and we're magnetic
        if (rval.size() == 0 && ou.contains(OptionMagnetic.class)) {
            final Point queryCenter = new Point((int) r.getCenterX(), (int) r.getCenterY());
            final int maxDistance = ou.get(OptionMagnetic.class).getMaxDistance();

            RenderElement bestMatch = null;
            double distance = Double.MAX_VALUE;

            // Find best match
            for (final RenderElement re : allElements) {
                final Circle current = new Circle(re.getGeometry(CoordinatesType.DOCUMENT_BASED));
View Full Code Here

TOP

Related Classes of de.dfki.km.text20.browserplugin.services.mastergazehandler.impl.gazehandler.old.ReadingHandlerOld$Event

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.