From 80b5c54e41d4969649d3e3cadb1a3e08346f4a27 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 16 Feb 2017 00:03:32 +0100 Subject: [PATCH] Removed opacity, since it wasn't being used (and over-complicated things) --- src/dorkbox/notify/NotifyPopup.java | 20 ----------- src/dorkbox/notify/NotifyPopupAccessor.java | 7 ---- src/dorkbox/notify/WindowUtil.java | 23 ------------- src/dorkbox/notify/WindowUtil_Java6.java | 35 -------------------- src/dorkbox/notify/WindowUtil_Java7plus.java | 33 ------------------ 5 files changed, 118 deletions(-) delete mode 100644 src/dorkbox/notify/WindowUtil.java delete mode 100644 src/dorkbox/notify/WindowUtil_Java6.java delete mode 100644 src/dorkbox/notify/WindowUtil_Java7plus.java diff --git a/src/dorkbox/notify/NotifyPopup.java b/src/dorkbox/notify/NotifyPopup.java index 9b75c2f..654b7d6 100644 --- a/src/dorkbox/notify/NotifyPopup.java +++ b/src/dorkbox/notify/NotifyPopup.java @@ -48,7 +48,6 @@ import dorkbox.tweenengine.TweenCallback; import dorkbox.tweenengine.TweenEquations; import dorkbox.tweenengine.TweenManager; import dorkbox.util.ActionHandlerLong; -import dorkbox.util.OS; import dorkbox.util.Property; import dorkbox.util.ScreenUtil; import dorkbox.util.SwingUtil; @@ -81,8 +80,6 @@ class NotifyPopup extends JFrame { private static final TweenManager tweenManager = new TweenManager(); private static ActionHandlerLong frameStartHandler; - private static WindowUtil opacity_compat; - static { // this is for updating the tween engine during active-rendering frameStartHandler = new ActionHandlerLong() { @@ -92,12 +89,6 @@ class NotifyPopup extends JFrame { NotifyPopup.tweenManager.update(deltaInNanos); } }; - - if (OS.javaVersion == 6) { - opacity_compat = new WindowUtil_Java6(); - } else { - opacity_compat = new WindowUtil_Java7plus(); - } } private static final int WIDTH = 300; @@ -158,7 +149,6 @@ class NotifyPopup extends JFrame { setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setUndecorated(true); - setOpacity_Compat(1.0F); setAlwaysOnTop(false); setAlwaysOnTop(true); setLayout(null); @@ -640,16 +630,6 @@ class NotifyPopup extends JFrame { tweenManager.add(tween); } - - void setOpacity_Compat(float opacity) { - opacity_compat.setOpacity(this, opacity); - } - - public - float getOpacity_Compat() { - return opacity_compat.getOpacity(this); - } - public int getProgress() { return progress; diff --git a/src/dorkbox/notify/NotifyPopupAccessor.java b/src/dorkbox/notify/NotifyPopupAccessor.java index d12c059..0d5a2bc 100644 --- a/src/dorkbox/notify/NotifyPopupAccessor.java +++ b/src/dorkbox/notify/NotifyPopupAccessor.java @@ -19,7 +19,6 @@ import dorkbox.tweenengine.TweenAccessor; class NotifyPopupAccessor implements TweenAccessor { - static final int OPACITY = 0; static final int Y_POS = 1; static final int X_Y_POS = 2; static final int PROGRESS = 3; @@ -32,9 +31,6 @@ class NotifyPopupAccessor implements TweenAccessor { public int getValues(final NotifyPopup target, final int tweenType, final float[] returnValues) { switch (tweenType) { - case OPACITY: - returnValues[0] = target.getOpacity_Compat(); - return 1; case Y_POS: returnValues[0] = (float) target.getY(); return 1; @@ -54,9 +50,6 @@ class NotifyPopupAccessor implements TweenAccessor { public void setValues(final NotifyPopup target, final int tweenType, final float[] newValues) { switch (tweenType) { - case OPACITY: - target.setOpacity_Compat(newValues[0]); - return; case Y_POS: target.setY((int) newValues[0]); return; diff --git a/src/dorkbox/notify/WindowUtil.java b/src/dorkbox/notify/WindowUtil.java deleted file mode 100644 index dc51880..0000000 --- a/src/dorkbox/notify/WindowUtil.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2015 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package dorkbox.notify; - -import java.awt.Window; - -public interface WindowUtil { - float getOpacity(final Window window); - void setOpacity(final Window window, final float opacity); -} diff --git a/src/dorkbox/notify/WindowUtil_Java6.java b/src/dorkbox/notify/WindowUtil_Java6.java deleted file mode 100644 index ead35e9..0000000 --- a/src/dorkbox/notify/WindowUtil_Java6.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2015 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package dorkbox.notify; - -import java.awt.Window; - -import com.sun.awt.AWTUtilities; - -class WindowUtil_Java6 implements WindowUtil { - - @Override - public - float getOpacity(final Window window) { - return AWTUtilities.getWindowOpacity(window); - } - - @Override - public - void setOpacity(final Window window, final float opacity) { - AWTUtilities.setWindowOpacity(window, opacity); - } -} diff --git a/src/dorkbox/notify/WindowUtil_Java7plus.java b/src/dorkbox/notify/WindowUtil_Java7plus.java deleted file mode 100644 index 21ca460..0000000 --- a/src/dorkbox/notify/WindowUtil_Java7plus.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2015 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package dorkbox.notify; - -import java.awt.Window; - -class WindowUtil_Java7plus implements WindowUtil { - - @Override - public - float getOpacity(final Window window) { - return window.getOpacity(); - } - - @Override - public - void setOpacity(final Window window, final float opacity) { - window.setOpacity(opacity); - } -}