Package java.awt

Examples of java.awt.Point.translate()


     */
    public Point getLocationOnScreen() {
        Point p = targetComponent.getLocation();
        Container parent = targetComponent.getParent();
        while (parent != null) {
            p.translate(parent.getX(), parent.getY());
            parent = parent.getParent();
        }
        return p;
    }

View Full Code Here


          @Override
          public void run() {
            // Set location relative to chatTextArea
            Point location = chatTextArea.getLocation();
            SwingUtilities.convertPointToScreen(location, chatTextArea.getParent());
            location.translate(0, chatTextArea.getHeight()
                + (chatTextArea.getBorder() == null ? 0
                    : chatTextArea.getBorder().getBorderInsets(chatTextArea).bottom));
            tcPopupWindow.setLocation(location);
          }
        });
View Full Code Here

            Point2D pos = evt.getPoint2D();
            AffineTransform transform = ua.getTransform();
            if (transform != null && !transform.isIdentity())
                transform.transform(pos, pos);
            Point screen = ua.getClientAreaLocationOnScreen();
            screen.translate((int)Math.floor(pos.getX()),
                             (int)Math.floor(pos.getY()));
            // compute screen coordinates
            GraphicsNode node = evt.getGraphicsNode();
            Element elmt = context.getElement(node);
            if (elmt == null) // should not appeared if binding on
View Full Code Here

            }
            public void mouseDragged(MouseEvent e) {
                if (!SwingUtilities.isLeftMouseButton(e))
                    return;
                Point where = e.getPoint();
                where.translate(-offset.x, -offset.y);
                Point loc = frame.getLocationOnScreen();
                loc.translate(where.x, where.y);
                frame.setLocation(loc.x, loc.y);
            }
            public void mouseReleased(MouseEvent e) {
View Full Code Here

                if (!SwingUtilities.isLeftMouseButton(e))
                    return;
                Point where = e.getPoint();
                where.translate(-offset.x, -offset.y);
                Point loc = frame.getLocationOnScreen();
                loc.translate(where.x, where.y);
                frame.setLocation(loc.x, loc.y);
            }
            public void mouseReleased(MouseEvent e) {
                if (e.isPopupTrigger()) {
                    showPopup(e);
View Full Code Here

            owner == null ? new Point(0, 0)
                : (owner.isShowing()
                   ? owner.getLocationOnScreen() : owner.getLocation());
        final Window parent = owner != null
            ? SwingUtilities.getWindowAncestor(owner) : null;
        origin.translate(x, y);
        return new Popup() {
            private BubbleWindow w;
            public void show() {
                w = new BubbleWindow(parent, content);
                w.pack();
View Full Code Here

            private BubbleWindow w;
            public void show() {
                w = new BubbleWindow(parent, content);
                w.pack();
                Point where = new Point(origin);
                where.translate(-w.getWidth()/3, -w.getHeight());
                w.setAnchorLocation(where.x, where.y);
                w.setVisible(true);
            }
            public void hide() {
                w.setVisible(false);
View Full Code Here

            public void mouseDragged(MouseEvent e) {
                if (offset != null) {
                    Window w = (Window)e.getSource();
                    Point where = e.getPoint();
                    where.translate(-offset.x, -offset.y);
                    Point loc = w.getLocationOnScreen();
                    loc.translate(where.x, where.y);
                    w.setLocation(loc.x, loc.y);
                }
            }
View Full Code Here

                if (offset != null) {
                    Window w = (Window)e.getSource();
                    Point where = e.getPoint();
                    where.translate(-offset.x, -offset.y);
                    Point loc = w.getLocationOnScreen();
                    loc.translate(where.x, where.y);
                    w.setLocation(loc.x, loc.y);
                }
            }
        };
        alphaWindow.addMouseListener(handler);
View Full Code Here

      owner != null ? SwingUtilities.getWindowAncestor(owner) : null;
    final String text =
      content != null ? content : "";
    final Integer timerDuration =
      duration != null ? duration : 10000;
    origin.translate(x, y);
    vpos = VPOS_BELOW;
    hpos = HPOS_LEFT;
    return new Popup () {
      private BalloonTip bt = null;
      final ComponentEar componentEar = new ComponentEar();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.