Java Code Examples for org.eclipse.swt.widgets.Control#getLocation()

The following examples show how to use org.eclipse.swt.widgets.Control#getLocation() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public void controlMoved(final ControlEvent event) {
    if (control.equals(event.widget)) {
        final Control movedControl = (Control) event.widget;
        final Point location = movedControl.getLocation();
        if (location.x != OFFSET) {
            final int offset = OFFSET - location.x;
            movedControl.setLocation(OFFSET, location.y);
            movedControl.setSize(movedControl.getSize().x - offset, movedControl.getSize().y);
        }
    }

}
 
Example 2
Source Project: nebula   File: ShakeEffect.java    License: Eclipse Public License 2.0 3 votes vote down vote up
/**
 * @deprecated
 * @param w
 * @param duration
 * @param movement
 * @param onStop
 * @param onCancel
 */
public static void shake(AnimationRunner runner, Control w, int duration,
		IMovement movement, Runnable onStop, Runnable onCancel) {
	IEffect effect = new ShakeEffect(w, w.getLocation(), new Point(w
			.getLocation().x + 10, w.getLocation().y + 10), duration,
			movement, onStop, onCancel);
	runner.runEffect(effect);
}
 
Example 3
/**
 * @deprecated
 * @param w
 * @param x
 * @param y
 * @param duration
 * @param movement
 * @param onStop
 * @param onCancel
 */
public static void move(AnimationRunner runner, Control w, int x, int y,
		int duration, IMovement movement, Runnable onStop, Runnable onCancel) {
	Point oldSize = w.getLocation();
	IEffect effect = new MoveControlEffect(w, oldSize.x, x, oldSize.y, y,
			duration, movement, onStop, onCancel);
	runner.runEffect(effect);
}
 
Example 4
Source Project: nebula   File: MoveControl.java    License: Eclipse Public License 2.0 3 votes vote down vote up
/**
 * @deprecated
 * @param w
 * @param x
 * @param y
 * @param duration
 * @param movement
 * @param onStop
 * @param onCancel
 */
public static void move(AnimationRunner runner, Control w, int x, int y,
		int duration, IMovement movement, Runnable onStop, Runnable onCancel) {
	Point oldSize = w.getLocation();
	IEffect effect = new MoveControl(w, oldSize.x, x, oldSize.y, y,
			duration, movement, onStop, onCancel);
	runner.runEffect(effect);
}
 
Example 5
Source Project: nebula   File: Shake.java    License: Eclipse Public License 2.0 3 votes vote down vote up
/**
 * @deprecated
 * @param w
 * @param duration
 * @param movement
 * @param onStop
 * @param onCancel
 */
public static void shake(AnimationRunner runner, Control w, int duration,
		IMovement movement, Runnable onStop, Runnable onCancel) {
	IEffect effect = new Shake(w, w.getLocation(), new Point(w
			.getLocation().x + 10, w.getLocation().y + 10), duration,
			movement, onStop, onCancel);
	runner.runEffect(effect);
}