Package de.dfki.km.text20.browserplugin.services.sessionrecorder.events

Examples of de.dfki.km.text20.browserplugin.services.sessionrecorder.events.AbstractSessionEvent


                                      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 FixationLineHandler4 handler = new FixationLineHandler4((FixationLineListener) 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 FixationHandler handler = new FixationHandler((FixationListener) 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 WeakSaccadeHandler2 handler = new WeakSaccadeHandler2((WeakSaccadeListener) 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 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

TOP

Related Classes of de.dfki.km.text20.browserplugin.services.sessionrecorder.events.AbstractSessionEvent

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.