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

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


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

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

TOP

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

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.