Package java.awt

Examples of java.awt.Point.translate()


        hidePopupTimer = new Timer(timerDuration, new TimerAction());
        bt = new BalloonTip(parent, text, origin, bordercolor,
          backgroundcolor, textcolor);
        bt.pack();
        Point pt = new Point(origin);
        pt.translate(10, owner.getHeight());
        bt.setLocation(getAdjustedOrigin(pt));
        bt.setWindowMask();
        bt.setVisible(true);
        owner.addFocusListener(focusEar);
        owner.addMouseListener(mouseEar);
View Full Code Here


            alphaWindow.setSize(alphaWindow.getPreferredSize());
        }
        if (!alphaWindow.isVisible()) {
            Window parent = alphaWindow.getOwner();
            Point where = parent.getLocationOnScreen();
            where.translate(parent.getWidth(), 0);
            alphaWindow.setLocation(where);
            alphaWindow.setVisible(true);
        }
    }
View Full Code Here

                if (System.getProperty("java.version").matches("^1\\.4\\..*"))
                    alphaWindow.setVisible(true);
                win = new X11.Window((int)Native.getWindowID(alphaWindow));
                Window parent = alphaWindow.getOwner();
                Point where = parent.getLocationOnScreen();
                where.translate(parent.getWidth(), 0);
                alphaWindow.removeAll();
                alphaWindow.setLocation(where);
                alphaWindow.setBackground(new Color(0,0,0,0));
            }
            else {
View Full Code Here

            int flags = user.GetWindowLong(hWnd, WinUser.GWL_EXSTYLE);
            flags |= WinUser.WS_EX_LAYERED;
            user.SetWindowLong(hWnd, WinUser.GWL_EXSTYLE, flags);
            Window parent = alphaWindow.getOwner();
            Point where = parent.getLocationOnScreen();
            where.translate(parent.getWidth(), 0);
            alphaWindow.setLocation(where);
        }
        else {
            hWnd = getHwnd(alphaWindow);
        }
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

         *
         * @param coords the mouse coordinates in the client space
         */
        protected Point getScreenMouseLocation(Point coords) {
            Point screen = new Point(ua.getClientAreaLocationOnScreen());
            screen.translate(coords.x, coords.y);
            return screen;
        }

        /**
         * Returns the element that is the target of the specified
View Full Code Here

        moveToCenterOfComponent(r, b);
        r.mousePress(InputEvent.BUTTON1_MASK);
        r.mouseRelease(InputEvent.BUTTON1_MASK);

        Point p = f.getLocationOnScreen();
        p.translate(f.getWidth() / 2, 5);
        r.mouseMove((int) p.getX(), (int) p.getY());
        r.mousePress(InputEvent.BUTTON1_MASK);
        for (int i = 0; i < 100; i++) {
            r.mouseMove((int) p.getX() + i, (int) p.getY() + i);
        }
View Full Code Here

        });
    }

    private static final void moveToCenterOfComponent(Robot r, Component c) {
        Point p = c.getLocationOnScreen();
        p.translate(c.getWidth() / 2, c.getHeight() / 2);
        r.mouseMove((int) p.getX(), (int) p.getY());
    }
}
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    Point p = new Point(1, 2);
    p.translate(3, 4);
    harness.check(p.x, 4);
    harness.check(p.y, 6);
  }


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.