Java Code Examples for org.eclipse.swt.widgets.Shell#getAlpha()

The following examples show how to use org.eclipse.swt.widgets.Shell#getAlpha() . 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: Notifier.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @param shell shell that will disappear
 * @param fast if true, the fading is much faster
 * @return a runnable
 */
private static Runnable fadeOut(final Shell shell, final boolean fast) {
	return new Runnable() {

		@Override
		public void run() {
			if (shell == null || shell.isDisposed()) {
				return;
			}

			int currentAlpha = shell.getAlpha();
			currentAlpha -= FADE_OUT_STEP * (fast ? 8 : 1);

			if (currentAlpha <= 0) {
				shell.setAlpha(0);
				shell.dispose();
				return;
			}

			shell.setAlpha(currentAlpha);

			Display.getDefault().timerExec(FADE_TIMER, this);

		}

	};
}
 
Example 2
Source File: AlphaEffect.java    From nebula with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * @deprecated
 * @param w
 * @param alpha
 * @param duration
 * @param movement
 * @param onStop
 * @param onCancel
 */
public static void setAlpha(AnimationRunner runner, Shell w, int alpha,
		int duration, IMovement movement, Runnable onStop,
		Runnable onCancel) {
	AlphaEffect effect = new AlphaEffect(w, w.getAlpha(), alpha, duration,
			movement, onStop, onCancel);
	runner.runEffect(effect);
}
 
Example 3
Source File: SetAlpha.java    From nebula with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * @deprecated
 * @param w
 * @param alpha
 * @param duration
 * @param movement
 * @param onStop
 * @param onCancel
 */
public static void setAlpha(AnimationRunner runner, Shell w, int alpha,
		int duration, IMovement movement, Runnable onStop, Runnable onCancel) {
	SetAlpha effect = new SetAlpha(w, w.getAlpha(), alpha, duration,
			movement, onStop, onCancel);
	runner.runEffect(effect);
}