Package java.awt

Examples of java.awt.Point.translate()


    }

    private void centerVideoPanel() {
  Point controlLocation = getLocation();
  int xPos = (WIDTH - videoPanel.getSize().width) / 2;
  controlLocation.translate(xPos, - 5 - videoPanel.getSize().height);
  videoPanel.setLocation(controlLocation);
    }

    public void controllerUpdate(ControllerEvent ce) {
  if (ce instanceof RealizeCompleteEvent) {
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

                    assert viewPort != null;
                    Rectangle rect = viewPort.getViewRect();
                    if (rect.contains(ev.getPoint()))
                    {
                        Point pt = new Point(viewPort.getViewPosition());
                        pt.translate(m_moveStartPoint.x - ev.getPoint().x, m_moveStartPoint.y - ev.getPoint().y);
                        setViewPosition(pt);
                    }
                }
            }
        });
View Full Code Here

    private void scrollImg(int dx, int dy)
    {
        JViewport viewPort = (JViewport)getParent();
        assert viewPort != null;
        Point pt = new Point(viewPort.getViewPosition());
        pt.translate(dx, dy);
        setViewPosition(pt);
    }
   
    private boolean doSetViewPosition(Point _pt, boolean bForceSet)
    {
View Full Code Here

  public static @Nullable Point translate(@Nonnull Component c, int x, int y) {
    Point p = locationOnScreenOf(c);
    if (p == null) {
      return null;
    }
    p.translate(x, y);
    return p;
  }

  /**
   * Returns a point at the center of the visible area of the given AWT or Swing {@code Component}.
View Full Code Here

        // Make the popup menu visible in the new locatio
        popupCell = cell;
        Component component = event.getComponent();
        Point parentPoint = new Point(component.getLocationOnScreen());
        parentPoint.translate(event.getX(), event.getY());
        contextMenu.setLocation(parentPoint);
        contextMenu.setVisible(true);
        contextMenu.toFront();
        contextMenu.pack();
        contextMenu.repaint();
View Full Code Here

         * Thread.
         */
        private void setLabelPosition(MouseEvent mouseEvent) {
            Component component = mouseEvent.getComponent();
            Point parentPoint = new Point(component.getLocationOnScreen());
            parentPoint.translate(mouseEvent.getX() + 10, mouseEvent.getY() - 15);
            labelFrame.setLocation(parentPoint);
        }

        /**
         * Shows the rotation label, properly in an AWT Event THread
View Full Code Here

         * Thread.
         */
        private void setLabelPosition(MouseEvent mouseEvent) {
            Component component = mouseEvent.getComponent();
            Point parentPoint = new Point(component.getLocationOnScreen());
            parentPoint.translate(mouseEvent.getX() + 10, mouseEvent.getY() - 15);
            labelFrame.setLocation(parentPoint);
        }
       
        /**
         * Shows the position label, properly in an AWT Event THread
View Full Code Here

         * Thread.
         */
        private void setLabelPosition(MouseEvent mouseEvent) {
            Component component = mouseEvent.getComponent();
            Point parentPoint = new Point(component.getLocationOnScreen());
            parentPoint.translate(mouseEvent.getX() + 10, mouseEvent.getY() - 15);
            labelFrame.setLocation(parentPoint);
        }

        /**
         * Shows the resize label, properly in an AWT Event THread
View Full Code Here

            return;
        }
        add(feedbackComponent, new Integer(FEEDBACK_LAYER));
        Point overlayPosition = getFeedbackComponentOrigin(feedbackComponent,
                contentComponent);
        overlayPosition.translate(xOffset, yOffset);
        feedbackComponent.setLocation(overlayPosition);
    }

    /**
     * Returns the ValidationResult associated with the given component using
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.