Package pythagoras.f

Examples of pythagoras.f.Point


            // get the origin point from the menu
            BoxPoint origin = resolveStyle(pop.trigger, POPUP_ORIGIN);

            // get the desired position, may be relative to trigger or pointer
            Point tpos = position.getLocation(pop.trigger, pop.pointer);
            Point mpos = origin.resolve(0, 0, width, height, new Point());

            // figure out the best place to put the menu, in screen coordinates; starting with
            // the requested popup position
            Rectangle bounds = new Rectangle(tpos.x - mpos.x, tpos.y - mpos.y, width, height);
View Full Code Here


    protected static class Absolute implements TriggerPoint
    {
        public final Point pos;

        protected Absolute (float x, float y) {
            pos = new Point(x, y);
        }
View Full Code Here

        protected Absolute (float x, float y) {
            pos = new Point(x, y);
        }

        @Override public Point getLocation (Element<?> trigger, IPoint pointer) {
            return new Point(pos);
        }
View Full Code Here

                "touchId", node.touch.id());
            return;
        }

        GestureNode lastNode = _lastNodes.get(node.touch.id());
        Point current = node.location();
        _lastNodes.put(node.touch.id(), node);
        // we haven't moved far enough yet, no further evaluation needed.
        Point startLoc = start.location();
        if (current.distance(startLoc) < _onAxisThreshold) return;

        float offAxisDistance; // distance from our start position in the perpendicular axis
        float lastAxisDistance = axisDistance(
            lastNode == null ? null : lastNode.location(), current);
        if (_direction == Direction.UP || _direction == Direction.DOWN)
            offAxisDistance = Math.abs(current.x() - startLoc.x());
        else
            offAxisDistance = Math.abs(current.y() - startLoc.y());

        // if we've strayed outside of the safe zone, or we've backtracked from our last position,
        // disqualify
        if (offAxisDistance > _offAxisTolerance) setState(State.UNQUALIFIED);
        else if (lastAxisDistance < 0) backtracked(node, -lastAxisDistance);
View Full Code Here

        case PAUSE:
            setState(State.UNQUALIFIED);
            break;

        case MOVE:
            Point start = _startPoints.get(node.touch.id());
            if (start == null) Log.log.warning("No start for a moved touch", "id", node.touch.id());
            else if (start.distance(node.location()) > MOVE_THRESHOLD) setState(State.UNQUALIFIED);
            break;

        case CANCEL:
            setState(State.UNQUALIFIED);
            break;
View Full Code Here

            return true;
        }

        protected boolean hideVirtualKeyboardAt (PointF pointF) {
            PointF overlay = ConvertPointToView(pointF, _overlay);
            Point pythagOverlay = new Point(overlay.get_X(), overlay.get_Y());
            return _platform._kfc == null ||
                    _platform._kfc.unfocusForLocation(pythagOverlay);
        }
View Full Code Here

    /**
     * Convenience method to get a Point for the local location of the touch event in this node.
     */
    public Point location () {
        return new Point(touch.localX(), touch.localY());
    }
View Full Code Here

            duration = istream.readInt();
            if (istream.readBoolean()) {
                label = istream.readUTF();
            }

            loc = new Point(istream.readFloat(), istream.readFloat());
            scale = new Point(istream.readFloat(), istream.readFloat());
            skew = new Point(istream.readFloat(), istream.readFloat());
            pivot = new Point(istream.readFloat(), istream.readFloat());
            alpha = istream.readFloat();
            visible = istream.readBoolean();
            tweened = istream.readBoolean();
            ease = istream.readFloat();
View Full Code Here

        public Point start;
        public double startTime;
        public float maxMovedSq;

        public Tracking (Events.Position where) {
            start = new Point(where.x(), where.y());
            startTime = where.time();
        }
View Full Code Here

            atlas.subImage(rect.get(0), rect.get(1), rect.get(2), rect.get(3)));
    }

    protected static IPoint getPoint (Json.Object json, String field, float defX, float defY) {
        Json.TypedArray<Float> array = json.getArray(field, Float.class);
        return (array != null) ? new Point(array.get(0), array.get(1)) : new Point(defX, defY);
    }
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.