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); } } }
/* (non-Javadoc) * @see org.fenggui.IWidget#getX() */ public int getX() { return position.getX(); }
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()); } } }