Package de.dfki.km.text20.services.trackingdevices.eyes

Examples of de.dfki.km.text20.services.trackingdevices.eyes.EyeTrackingDeviceInfo


                                      SpawnEvaluatorOption... options) {

        // Handle options
        final OptionUtils<SpawnEvaluatorOption> ou = new OptionUtils<SpawnEvaluatorOption>(options);
        final AddGazeEvaluationListenerOption[] passThrough = ou.get(OptionGazeEvaluatorPassthrough.class).getOptions();
        final GazeEvaluator gazeEvaluator = ou.get(OptionGazeEvaluator.class).getGazeEvaluator();

        // Create the element
        final SaccadeHandler saccadeHandler = new SaccadeHandler((SaccadeListener) listener, passThrough);

        // Perform some setup
View Full Code Here


                                      SpawnEvaluatorOption... options) {

        // Handle options
        final OptionUtils<SpawnEvaluatorOption> ou = new OptionUtils<SpawnEvaluatorOption>(options);
        final AddGazeEvaluationListenerOption[] passThrough = ou.get(OptionGazeEvaluatorPassthrough.class).getOptions();
        final GazeEvaluator gazeEvaluator = ou.get(OptionGazeEvaluator.class).getGazeEvaluator();

        // Create the element
        final PerusalHandlerImpl3 handler = new PerusalHandlerImpl3((PerusalListener) listener, passThrough);

        // Perform some setup
View Full Code Here

                                      SpawnEvaluatorOption... options) {

        // Handle options
        final OptionUtils<SpawnEvaluatorOption> ou = new OptionUtils<SpawnEvaluatorOption>(options);
        final AddGazeEvaluationListenerOption[] passThrough = ou.get(OptionGazeEvaluatorPassthrough.class).getOptions();
        final GazeEvaluator gazeEvaluator = ou.get(OptionGazeEvaluator.class).getGazeEvaluator();

        // Create the element
        final RawHandlerImpl handler = new RawHandlerImpl((RawDataListener) listener, passThrough);

        // Perform some setup
View Full Code Here

        // Setup filter
        this.filter.addFilter(this.smoothingFilter);

        // Create gaze evaluator
        final GazeEvaluatorManager evaluationManager = this.pluginManager.getPlugin(GazeEvaluatorManager.class);

        this.evaluator = evaluationManager.createEvaluator(trackingDevice);
        this.evaluator.setFilter(this.filter);

        // Create gaze handler
        this.allGazeHandler.add(new RawGazeHandler());
        this.allGazeHandler.add(new RawApplicationGazeHandler());
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

        final Collection<OptionRequestVersion> requestedVersions = ou.getAll(OptionRequestVersion.class);

        GazeEvaluatorImpl.this.logger.fine("Obtained request to return an evaluator for " + listener.getClass());

        // Select the proper plugin
        final GazeHandlerFactory selectedCreator = this.pluginManager.getPlugin(GazeHandlerFactory.class, new OptionPluginSelector<GazeHandlerFactory>(new PluginSelector<GazeHandlerFactory>() {

            @Override
            public boolean selectPlugin(GazeHandlerFactory creator) {

                GazeEvaluatorImpl.this.logger.finer("Examining plugin factory " + creator);

                final PluginInformation pi = GazeEvaluatorImpl.this.pluginInformation;

                if (!creator.getEvaluatorType().isAssignableFrom(listener.getClass()))
                    return false;

                GazeEvaluatorImpl.this.logger.finer("Plugin looks promising");

                // Now check the requested versions
                for (OptionRequestVersion rqv : requestedVersions) {
                    // Check if we're dealing with the proper listener.
                    if (!rqv.getListener().isAssignableFrom(listener.getClass()))
                        continue;

                    GazeEvaluatorImpl.this.logger.finer("Found a version request. Checking authors ... ");

                    // Check author
                    if (rqv.getAuthor() != null) {
                        if (!pi.getInformation(Information.AUTHORS, creator).contains(rqv.getAuthor()))
                            return false;
                    }

                    GazeEvaluatorImpl.this.logger.finer("Checking implementaiton version ... ");

                    // Check version
                    if (rqv.getVersion() >= 0) {
                        final Collection<String> information = pi.getInformation(Information.VERSION, creator);
                        if (information.size() != 1) return false;

                        final int version = Integer.parseInt(information.iterator().next());

                        // We accept any newer version
                        if (version < rqv.getVersion()) return false;
                    }

                    GazeEvaluatorImpl.this.logger.finer("Checking capabilities ... ");

                    // Check capabilities
                    if (rqv.getCapabilities().length > 0) {
                        final Collection<String> information = pi.getInformation(Information.CAPABILITIES, creator);

                        // Must match all caps
                        if (!information.containsAll(Arrays.asList(rqv.getCapabilities())))
                            return false;
                    }
                }

                GazeEvaluatorImpl.this.logger.finer("All tests passed. Plugin selected.");

                return true;
            }
        }));

        // No handler to spawn something found, tthis is bad
        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

    /**
     * @param fixations
     * @return
     */
    private FixationLineImpl createFixationLine(final List<Fixation> fixations) {
        return new FixationLineImpl(fixations);
    }
View Full Code Here

        // Need a minimum size
        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;
View Full Code Here

            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
View Full Code Here

        final List<EyeTrackingEvent> myTrackingEvents = new ArrayList<EyeTrackingEvent>(trackingEvents);

        callListener(new FixationEvent() {
            @Override
            public Fixation getFixation() {
                return new Fixation() {

                    @Override
                    public Point getCenter() {
                        return (Point) center.clone();
                    }
View Full Code Here

TOP

Related Classes of de.dfki.km.text20.services.trackingdevices.eyes.EyeTrackingDeviceInfo

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.