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

The following examples show how to use org.eclipse.swt.widgets.Control#getLocation() . 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
Source File: CellEditorControlAdapter.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@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 File: ShakeEffect.java    From nebula with 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
Source File: MoveControlEffect.java    From nebula with 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 MoveControlEffect(w, oldSize.x, x, oldSize.y, y,
			duration, movement, onStop, onCancel);
	runner.runEffect(effect);
}
 
Example 4
Source File: MoveControl.java    From nebula with 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 File: Shake.java    From nebula with 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);
}