Package java.awt

Examples of java.awt.Point.translate()


          .getHeight() / 2 + (y > 0 ? absLinkY : -absLinkY));
    }
    else {
      linkPoint = new Point((x > 0 ? getContent().getWidth() : 0), (getContent().getHeight() / 2));
    }
    linkPoint.translate(getContent().getX(), getContent().getY());
    convertPointToMap(linkPoint);
    return linkPoint;
  }

  public MainView getMainView() {
View Full Code Here


      return;
    }
    if (isSourceVisible() && !connectorModel.getStartArrow().equals(ArrowType.NONE)) {
      Point p1 = edgeView.getStart();
      Point p2 = new Point(p1);
      p2.translate(5, 0);
      paintArrow(graphics, p2, p1);
    }
    if (isTargetVisible() && !connectorModel.getEndArrow().equals(ArrowType.NONE)) {
      Point p1 = edgeView.getEnd();
      Point p2 = new Point(p1);
View Full Code Here

      paintArrow(graphics, p2, p1);
    }
    if (isTargetVisible() && !connectorModel.getEndArrow().equals(ArrowType.NONE)) {
      Point p1 = edgeView.getEnd();
      Point p2 = new Point(p1);
      p2.translate(5, 0);
      paintArrow(graphics, p2, p1);
    }
   
  }
View Full Code Here

      final Point viewPosition = getViewPosition();
          int dx = p.x - viewPosition.x;
          int dy = p.y - viewPosition.y;
          int slowDx = calcScrollIncrement(dx);
          int slowDy = calcScrollIncrement(dy);
          viewPosition.translate(slowDx, slowDy);
          super.setViewPosition(viewPosition);
          if(slowDx == dx && slowDy == dy)
              return;
          timer = new Timer(20, new ActionListener() {
        public void actionPerformed(ActionEvent e) {
View Full Code Here

        return r;
    }

    private Point getModelDefaultPaintLocation(int resolution) {
        Point location = new Point((int) pos.getX(), (int) pos.getY());
        location.translate((int) Math.round(-(float) model.getWidth(resolution) / 2f), -model.getHeight(resolution) + model.getFloorDiff(resolution));
        return location;
    }

    public AnimationHandler getCurrentAnimation() {
        return model.GLgetCurrentAnim();
View Full Code Here

                if (player.getGui().isDebugEnabled()) {
                    if (isDebugEnabled()) {
                        System.out.println("location point tx : " + resTx + " location : " + location);
                    }
                }
                resLocMap.translate(location.x, location.y);
                location = resLocMap;
            }
        }
        return 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

      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);
        }
        selectAndPossiblyCenter(textArea, regExPos.x, regExPos.y);
        return true;
      }
    }
View Full Code Here

    scroll.setHorizontalScrollBarPolicy(policy);
  }

  public void moveTo(int moveX, int moveY) {
    final Point newViewPos = scroll.getViewport().getViewPosition();
    newViewPos.translate(moveX, moveY);

    int offsetX = scroll.getVerticalScrollBar().getWidth();
    if (!scroll.getVerticalScrollBar().isVisible()) {
      offsetX = 0;
    }
View Full Code Here

      aboutMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          JDialog aboutDialog = getAboutDialog();
          aboutDialog.pack();
          Point loc = getJFrame().getLocation();
          loc.translate(50, 50);
          aboutDialog.setLocation(loc);
          aboutDialog.setVisible(true);
        }
      });
    }
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.