Package java.awt

Examples of java.awt.Point.translate()


    public void testSetFloatingLocation() {
        prepareToTestFloating();
        Point origin = new Point(100, 200);
        Point position1 = frame.getLocation();
        position1.translate(frame.getWidth() + 1, 0);
        ui.dragTo(position1, origin);
        Point p = new Point(100, 200);
        ui.setFloatingLocation(p.x, p.y);
        ui.setFloating(true, null);
        if (isHarmony()) {
View Full Code Here


      // Now have to see if the component is a JComponent before
      // getting the tip
      if (component instanceof JComponent) {
        // Convert the event to the renderer's coordinate system
        java.awt.Rectangle cellRect = getCellRect(hitRowIndex, hitColumnIndex, false);
        p.translate(-cellRect.x, -cellRect.y);
        MouseEvent newEvent = new MouseEvent(component, event.getID(),
            event.getWhen(), event.getModifiers(),
            p.x, p.y,
            event.getClickCount(),
            event.isPopupTrigger(),
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

      v.setLocation(v.getX() + e.getX() - start.x, v.getY() + e.getY() - start.y);
      canvas.repaint();
    }
    if(dragTempEdge) {
      Point p = e.getPoint();
      p.translate(v.getX(), v.getY());
      updateTempEdge(p);
    }
  }
  @Override
  public void mouseReleased(MouseEvent e) {
View Full Code Here

    v.changing = false;
    v.fireVertexLocationChanged();
    start = null;
    if(dragTempEdge) {
      Point p = e.getPoint();
      p.translate(v.getX(), v.getY());
      releaseTempEdge();
      dragTempEdge = false;
    }
  }
  private void releaseTempEdge() {
View Full Code Here

      // Now have to see if the component is a JComponent before
      // getting the tip
      if (component instanceof JComponent) {
        // Convert the event to the renderer's coordinate system
        java.awt.Rectangle cellRect = getCellRect(hitRowIndex, hitColumnIndex, false);
        p.translate(-cellRect.x, -cellRect.y);
        MouseEvent newEvent = new MouseEvent(component, event.getID(),
            event.getWhen(), event.getModifiers(),
            p.x, p.y,
            event.getClickCount(),
            event.isPopupTrigger(),
View Full Code Here

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


  /**
 
View Full Code Here

      // Now have to see if the component is a JComponent before
      // getting the tip
      if (component instanceof JComponent) {
        // Convert the event to the renderer's coordinate system
        java.awt.Rectangle cellRect = getCellRect(hitRowIndex, hitColumnIndex, false);
        p.translate(-cellRect.x, -cellRect.y);
        MouseEvent newEvent = new MouseEvent(component, event.getID(),
            event.getWhen(), event.getModifiers(),
            p.x, p.y,
            event.getClickCount(),
            event.isPopupTrigger(),
View Full Code Here

    this.setTitle("AnImOSY Help");
    this.setModal(true);
    this.setLayout(new BorderLayout());
    Point loc = PanelRepository.get(PanelRepository.MAIN_WINDOW).getLocation();
   
    loc.translate((PanelRepository.get(PanelRepository.MAIN_WINDOW).getWidth()-640)/2, 75);
    this.setLocation( loc );
   
    htmlBox.setEditorKit(new HTMLEditorKit());

    FileHandler htmlFile = new FileHandler(filename);
View Full Code Here

    this.setResizable(false);
    this.setTitle("AnImOSY - movement history");
    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 );

    htm.fill();

    JTable movementHistory = new JTable(htm);
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.