Package pythagoras.f

Examples of pythagoras.f.Point


            clicked.emit(event);
            return;
        }
        // if not, maybe impart some velocity
        float dragTime = (float)(_curStamp - _prevStamp);
        Point delta = new Point(_cur.x - _prev.x, _cur.y - _prev.y);
        Point dragVel = delta.mult(1 / dragTime);
        float dragSpeed = dragVel.distance(0, 0);
        if (dragSpeed > flickSpeedThresh() && delta.distance(0, 0) > minFlickDelta()) {
            if (dragSpeed > maxFlickSpeed()) {
                dragVel.multLocal(maxFlickSpeed() / dragSpeed);
                dragSpeed = maxFlickSpeed();
            }
            _vel.set(dragVel);
            _vel.multLocal(flickXfer());
            float sx = Math.signum(_vel.x), sy = Math.signum(_vel.y);
View Full Code Here


    /**
     * Positions {@code elem} at the specified position, in its preferred size.
     */
    public static <T extends Element<?>> T at (T elem, float x, float y) {
        return at(elem, new Point(x, y));
    }
View Full Code Here

    /**
     * Constrains {@code elem} to the specified position and size.
     */
    public static <T extends Element<?>> T at (T elem, float x, float y, float width, float height) {
        return at(elem, new Point(x, y), new Dimension(width, height));
    }
View Full Code Here

    /**
     * Positions {@code elem} relative to the given position using the given alignments.
     */
    public static <T extends Element<?>> T at (T elem, float x, float y,
                                               HAlign halign, VAlign valign) {
        return at(elem, new Point(x, y), ZERO, halign, valign);
    }
View Full Code Here

     * Constrains {@code elem} to the specified size and aligns it relative to the given position
     * using the given alignments.
     */
    public static <T extends Element<?>> T at (T elem, float x, float y, float width, float height,
                                               HAlign halign, VAlign valign) {
        return at(elem, new Point(x, y), new Dimension(width, height), halign, valign);
    }
View Full Code Here

    /**
     * Centers {@code elem} on the specified position, in its preferred size.
     */
    public static <T extends Element<?>> T centerAt (T elem, float x, float y) {
        return centerAt(elem, new Point(x, y));
    }
View Full Code Here

            else if (fheight > 0) return new Dimension(psize.width(), fheight);
            else return psize;
        }

        public IPoint pos (float width, float height, IDimension prefSize) {
            Point position = this.position.resolve(0, 0, width, height, new Point());
            Point origin = this.origin.resolve(prefSize, new Point());
            position.x -= origin.x;
            position.y -= origin.y;
            return position;
        }
View Full Code Here

    /** Gets a trigger point relative to an element using the given box point. */
    public static TriggerPoint relative (final BoxPoint location) {
        return new TriggerPoint() {
            @Override public Point getLocation (Element<?> trigger, IPoint pointer) {
                return location.resolve(trigger, new Point());
            }
        };
    }
View Full Code Here

    /** Gets a trigger point exactly under the pointer position. */
    public static TriggerPoint pointer () {
        return new TriggerPoint() {
            @Override public Point getLocation (Element<?> trigger, IPoint pointer) {
                return new Point(pointer);
            }
        };
    }
View Full Code Here

        /**
         * Optionally confines the menu area to the given element. By default the menu is confined
         * by the host's screen area (see {@link MenuHost#getScreenArea()}).
         */
        public Pop inElement (Element<?> elem) {
            Point tl = Layer.Util.layerToScreen(elem.layer, 0, 0);
            Point br = Layer.Util.layerToScreen(
                elem.layer, elem.size().width(), elem.size().height());
            bounds = new Rectangle(tl.x(), tl.y(), br.x() - tl.x(), br.y() - tl.y());
            return this;
        }
View Full Code Here

TOP

Related Classes of pythagoras.f.Point

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.