コード例 #1
0
ファイル: ContentManager.java プロジェクト: jeffedlund/JF3d
  public void moveDown(TextAppearance appearance) {
    synchronized (content) {
      if (activeLine == null) return;

      Point currentPos = activeLine.getActivePosition(appearance);

      if (activeLine.getSelectedLine() != null) {
        currentPos.setY(
            activeLineY + currentPos.getY() + (activeLine.getSelectedLine().getSize().getHeight()));
        if (currentPos.getY() > getSize().getHeight()) {
          currentPos.setY(getSize().getHeight());
        }
        activeAtom = findAtomOnPosition(currentPos.getX(), currentPos.getY(), appearance);
        setActiveAtom(this.activeAtom);
      }
    }
  }
コード例 #2
0
ファイル: Widget.java プロジェクト: georules/tehgame
 /* (non-Javadoc)
  * @see org.fenggui.IWidget#getX()
  */
 public int getX() {
   return position.getX();
 }
コード例 #3
0
  private void translate(Point current, Point destination, Point speed) {
    if (current.getX() > destination.getX()) {
      current.setX(current.getX() - speed.getX());
      if (current.getX() < destination.getX()) {
        current.setX(destination.getX());
      }
    } else {
      current.setX(current.getX() + speed.getX());
      if (current.getX() > destination.getX()) {
        current.setX(destination.getX());
      }
    }

    if (current.getY() > destination.getY()) {
      current.setX(current.getY() - speed.getY());
      if (current.getY() < destination.getY()) {
        current.setX(destination.getY());
      }
    } else {
      current.setX(current.getY() + speed.getY());
      if (current.getY() > destination.getY()) {
        current.setY(destination.getY());
      }
    }
  }