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

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


        // 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

     */
    public int getLastFixatedWordPos() {
        final Fixation fixation = this.correctedFixations.get(this.correctedFixations.size() - 1);
        final Point location2 = this.pseudorenderer.convertPoint(fixation.getCenter(), CoordinatesType.SCREEN_BASED, CoordinatesType.DOCUMENT_BASED);

        final RenderElement element = getLastFixatedElement();

        // Get fixated word.
        if (element != null && element instanceof TextualRenderElement) {

            final TextualRenderElementCharPositions recp = new TextualRenderElementCharPositions();
View Full Code Here

            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;
            }

            allElementsIntersecting = this.pseudorenderer.getAllElementsIntersecting(new Rectangle(p2, new Dimension(1, 1)), CoordinatesType.SCREEN_BASED, new OptionMagnetic());
            for (RenderElement renderElement : allElementsIntersecting) {
                r2 = renderElement;
            }

            // Check if both are textual elements
View Full Code Here

                r2 = renderElement;
            }

            // Check if both are textual elements
            if (r1 != null && r1 instanceof TextualRenderElement && r2 != null && r2 instanceof TextualRenderElement) {
                TextualRenderElement t1 = (TextualRenderElement) r1;
                TextualRenderElement t2 = (TextualRenderElement) r2;

                int tID1 = t1.getTextID();
                int tID2 = t2.getTextID();

                if (tID1 == tID2) {
                    //System.out.println(t1.getWordID() + " --> " + t2.getWordID());
                    //System.out.println(t1.getContent() + " ---> " + t2.getContent());
View Full Code Here

        final RenderElement element = getLastFixatedElement();

        // Get fixated word.
        if (element != null && element instanceof TextualRenderElement) {

            final TextualRenderElementCharPositions recp = new TextualRenderElementCharPositions();
            return recp.getPositionOf((TextualRenderElement) element, CoordinatesType.DOCUMENT_BASED, location2);
        }

        return -1;
    }
View Full Code Here

        // Setup eye tracking device
        if ($(getParameter("enablebraintracker")).get("false").equals("true")) {
            this.logger.info("Enabling Brain Tracker");
            this.deviceManager.initBrainTrackerConnection(null, getParameter("braintrackingconnection"));

            final BrainTrackingDevice device = this.deviceManager.getBrainTrackingDevice();

            if (device != null) {
                device.addTrackingListener(new BrainTrackingListener() {

                    @Override
                    public void newTrackingEvent(BrainTrackingEvent event) {
                        BrowserPluginImpl.this.sessionRecorder.newBrainTrackingEvent(event);
                    }
View Full Code Here

         * de.dfki.km.augmentedtext.services.trackingdevices.TrackingDevice#
         * getDeviceInfo()
         */
        @Override
        public BrainTrackingDeviceInfo getDeviceInfo() {
            return new BrainTrackingDeviceInfo() {

                @Override
                public String getInfo(final String key) {
                    if (ServerTrackingDevice.this.deviceInformation == null) return null;

View Full Code Here

        if (trackerConnection == null) {
            trackerConnection = "discover://any";
        }

        // Obtain the proper tracking device here
        BrainTrackingDeviceProvider deviceProvider = this.pluginManager.getPlugin(BrainTrackingDeviceProvider.class);

        // No device is bad ... at this stage ...
        if (deviceProvider == null) {
            this.logger.warning("No brain tracker device provide found");
            return;
        }

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

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

        // If opening the device didn't work and we have autodetection, use the mouse
        if (this.brainTrackingDevice == null) {
            this.logger.info("Device did not open. No brainz today.");
            return;
View Full Code Here

TOP

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

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.