Package java.awt

Examples of java.awt.Point.translate()


    this.setTitle("About AnImOSY");
    this.setModal(true);
    this.setLayout(new BorderLayout());
    Point loc = PanelRepository.get(PanelRepository.MAIN_WINDOW).getLocation();
   
    loc.translate((PanelRepository.get(PanelRepository.MAIN_WINDOW).getWidth()-300)/2, 50);
    this.setLocation( loc );
   
    StringBuilder aboutMsg = new StringBuilder();
   
    aboutMsg.append("\n");
View Full Code Here


    this.setResizable(false);
    this.setTitle("AnImOSY game options");
    this.setModal(true);
    Point loc = PanelRepository.get(PanelRepository.MAIN_WINDOW).getLocation();
   
    loc.translate((PanelRepository.get(PanelRepository.MAIN_WINDOW).getWidth()-300)/2, 50);
    this.setLocation( loc );
   
    // springs for the buttons
    Spring buttonWidth = Spring.constant(100);
    Spring buttonHeight = Spring.constant(20);
View Full Code Here

     * @param y The y coordinate of the point where the mouse is being moved to.
     */
    @Override
    protected void mouseMoved(final Component ultimate, final int x, final int y) {
        final Point dest = new Point(x, y);
        dest.translate(-ultimate.getLocationOnScreen().x, -ultimate.getLocationOnScreen().y);

        int mouseEventType = MouseEvent.MOUSE_MOVED;

        if (m_lastPressed != 0) {
            mouseEventType = MouseEvent.MOUSE_DRAGGED;
View Full Code Here

      if (regExPos!=null) {
        // Without this, if JTextArea isn't in focus, selection
        // won't appear selected.
        c.setSelectionVisible(true);
        if (forward) {
          regExPos.translate(start, start);
        }
        c.setDot(regExPos.x);
        c.moveDot(regExPos.y);
        return true;
      }
View Full Code Here

        }

        public Point getLocationOnScreen() {
            Point parentLocation = _parent.getLocationOnScreen();
            Point componentLocation = getLocation();
            componentLocation.translate(parentLocation.x, parentLocation.y);
            return componentLocation;
        }

        public Point getLocation() {
            Rectangle r = getBounds();
View Full Code Here

    System.out.println("[FB] processMouseReleased");
    if(isBeingRightClickDragged){
      isBeingRightClickDragged = false;
     
      Point p = evt.getPoint();
      p.translate(this.getX(), this.getY());
      Component c = getParent().getComponentAt(p);
      if(c != null && c instanceof FB && c != this){
        FB other = (FB)c;
        FBNetworkDialog fbDialog = new FBNetworkDialog((Element)elem.getParentNode(), evt);
        fbDialog.setSourceFBName(getFBName());
View Full Code Here

    Point convertPoint = SwingUtilities.convertPoint(
        graphView,
        (int) viewportPoint.getX(),
        (int) viewportPoint.getY(),
        MainWindow.getInstance());
    convertPoint.translate(-left, -top);
    return convertPoint;
  }
 
  /**
   * Takes a point relative to the window and returns a point relative to the global JGraph coordinate system.
View Full Code Here

   * @param graphPoint
   * @return the global point in pixels
   */
  public Point graphViewToGlobal(Point graphPoint) {
    Point zoomedGraphPoint = Point2DUtils.convertPoint(Point2DUtils.divide(graphPoint, getScale()));
    zoomedGraphPoint.translate(
        -(int)graphView.getGraph().getView().getTranslate().getX(),
        -(int)graphView.getGraph().getView().getTranslate().getY());
    return zoomedGraphPoint;
  }

View Full Code Here

      aboutMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          JDialog aboutDialog = getAboutDialog();
          aboutDialog.pack();
          Point loc = getJFrame().getLocation();
          loc.translate(20, 20);
          aboutDialog.setLocation(loc);
          aboutDialog.setVisible(true);
        }
      });
    }
View Full Code Here

        menu.setPopupMenuVisible(true);
        assertTrue(menu.isPopupMenuVisible());
        assertSame(menu, menu.getPopupMenu().getInvoker());
        assertEquals(new Point(), menu.getPopupMenu().getLocation());
        Point menuLocation = menu.getLocationOnScreen();
        menuLocation.translate(0, menu.getHeight());
        assertEquals(menuLocation, menu.getPopupMenu().getLocationOnScreen());
        menu.setPopupMenuVisible(false);
        assertFalse(menu.isPopupMenuVisible());
        frame.dispose();
    }
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.