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

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


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

        // If we already have a status for the point, return it ... (may not be the best choice ...?)
        // if (gridForPoint.gridStatus.equals(GridStatus.SET)) { return createWrapped(event, gridForPoint.xdisplacement, gridForPoint.ydisplacement); }

        // Get elements near the document gaze point
        final RenderElement bestNear = getBestElementNear(documentPoint);
        if (bestNear == null) return event;

        // Update the displacement
        displacement.y = (int) (bestNear.getGeometry(CoordinatesType.DOCUMENT_BASED).getCenterY() - documentPoint.y);
        // displacement.x = (int) (bestNear.getGeometry().getCenterX() - documentPoint.x);

        // Only return new event if we have a displacement.
        if (displacement.x > 0 || displacement.y > 0) {
            // Update grid for point information
View Full Code Here

     */
    protected RenderElement getBestElementNear(final Point documentPoint) {
        final Set<String> ids = this.renderElements.keySet();

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

        for (final String id : ids) {
            final RenderElement renderElement = this.renderElements.get(id);

            // Currently we only care for text elements
            if (!(renderElement instanceof TextualRenderElement)) {
                continue;
            }

            final Rectangle geometry = renderElement.getGeometry(CoordinatesType.DOCUMENT_BASED);

            // Elements too large dont give enough information for interesting points ... We alo
            // dont care about the width, as we currently want to displace y-wise only ...
            // TODO: A bit harsh this limit ...
            if (geometry.height > 30) {
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

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.