Package pythagoras.f

Examples of pythagoras.f.Point


            }
        });

        scroll.contentClicked().connect(new Slot<Pointer.Event>() {
            @Override public void onEmit (Event e) {
                Point pt = Layer.Util.screenToLayer(content.layer, e.x(), e.y());
                click.text.update(pt.x + ", " + pt.y);
            }
        });

        scroll.addListener(new Scroller.Listener() {
View Full Code Here


        final Slider width = new Slider(50, 10, 150);
        final Slider height = new Slider(50, 10, 150);
        Group sizeCtrl = new Group(AxisLayout.horizontal()).add(new Label("Size:"), width, height);
        final Group group = new Group(new AbsoluteLayout());
        group.layer.add(PlayN.graphics().createImmediateLayer(new ImmediateLayer.Renderer() {
            Point pt = new Point();
            @Override public void render (Surface surface) {
                IDimension size = group.size();
                position.point.get().resolve(size, pt);
                surface.save();
                surface.setFillColor(Colors.BLACK);
View Full Code Here

        }

        display().addFilter(SWT.MouseDown, new Listener() {
            @Override public void handleEvent (Event event) {
                if (event.widget == _platform.graphics().canvas() &&
                    (_kfc == null || _kfc.unfocusForLocation(new Point(event.x, event.y)))) {
                    clearFocus();
                }
            }
        });
    }
View Full Code Here

                }
            });
            return true;
        }

        Point offset = Layers.transform(new Point(0, 0), elem.layer, scroller.content.layer);
        scroller.scroll(offset.x, offset.y);
        return true;
    }
View Full Code Here

     * Sets the left and top of the view area relative to that of the content the next time the
     * container is laid out. This is needed if the caller invalidates the content and needs
     * to then set a scroll position which may be out of range for the old size.
     */
    public void queueScroll (float x, float y) {
        _queuedScroll = new Point(x, y);
    }
View Full Code Here

        }
    }

    protected Rectangle getNativeFieldBounds () {
        Insets insets = resolveStyle(Style.BACKGROUND).insets;
        Point screenCoords = Layer.Util.layerToScreen(layer, insets.left(), insets.top());
        return new Rectangle(screenCoords.x, screenCoords.y,
                             _size.width - insets.width(), _size.height - insets.height());
    }
View Full Code Here

                    }
                }

                // by default, we lose focus, so test if we need to try and preempt it
                if (_focus.get() != null && _kfc != null &&
                        !_kfc.unfocusForLocation(new Point(e.getX(), e.getY()))) {
                    final Component comp =
                        ((JavaNativeTextField)_focus.get().exposeNativeField()).component;
                    EventQueue.invokeLater(new Runnable() {
                        @Override public void run () { comp.requestFocusInWindow(); }
                    });
View Full Code Here

    /**
     * Transforms a point from one Layer's coordinate system to another's.
     */
    public static Point transform (IPoint p, Layer from, Layer to) {
        return transform(p, from, to, new Point());
    }
View Full Code Here

    /**
     * Removes {@code layer} from its current parent and adds it to {@code target}, modifying its
     * transform in the process so that it stays in the same position on the screen.
     */
    public static void reparent (Layer layer, GroupLayer target) {
        Point pos = new Point(layer.tx(), layer.ty());
        Layer.Util.layerToScreen(layer.parent(), pos, pos);
        target.add(layer);
        Layer.Util.screenToLayer(layer.parent(), pos, pos);
        layer.setTranslation(pos.x, pos.y);
    }
View Full Code Here

     * The returned Rectangle will be in {@code root}'s coordinate system.
     */
    public static Rectangle totalBounds (Layer root) {
        // account for root's origin
        Rectangle r = new Rectangle(root.originX(), root.originY(), 0, 0);
        addBounds(root, root, r, new Point());
        return r;
    }
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.