Removed opacity, since it wasn't being used (and over-complicated
things)
This commit is contained in:
parent
659da35c10
commit
80b5c54e41
|
@ -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;
|
||||
|
|
|
@ -19,7 +19,6 @@ import dorkbox.tweenengine.TweenAccessor;
|
|||
|
||||
class NotifyPopupAccessor implements TweenAccessor<NotifyPopup> {
|
||||
|
||||
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<NotifyPopup> {
|
|||
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<NotifyPopup> {
|
|||
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;
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user