|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* This file is part of libbluray
|
|
Packit |
5e46da |
* Copyright (C) 2012 Petri Hintukainen <phintuka@users.sourceforge.net>
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* This library is free software; you can redistribute it and/or
|
|
Packit |
5e46da |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
5e46da |
* License as published by the Free Software Foundation; either
|
|
Packit |
5e46da |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
5e46da |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
5e46da |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
5e46da |
* Lesser General Public License for more details.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
5e46da |
* License along with this library. If not, see
|
|
Packit |
5e46da |
* <http://www.gnu.org/licenses/>.
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
package java.awt.peer;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
import java.awt.*;
|
|
Packit |
5e46da |
import java.awt.event.*;
|
|
Packit |
5e46da |
import java.awt.image.BufferedImage;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
import java.security.AccessController;
|
|
Packit |
5e46da |
import java.security.PrivilegedAction;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
import org.videolan.Logger;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public class BDFramePeer extends BDComponentPeer implements FramePeer
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
public BDFramePeer(Frame frame, BDRootWindow rootWindow) {
|
|
Packit |
5e46da |
super(frame.getToolkit(), frame);
|
|
Packit |
5e46da |
this.rootWindow = rootWindow;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public Rectangle getBoundsPrivate() {
|
|
Packit |
5e46da |
return null;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public int getState() {
|
|
Packit |
5e46da |
return Frame.NORMAL;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setBoundsPrivate(int a, int b, int c, int d) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setMaximizedBounds(Rectangle bounds) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setMenuBar(MenuBar mb) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setResizable(boolean resizeable) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setState(int state) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setTitle(String title) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Java 8 */
|
|
Packit |
5e46da |
public void emulateActivation(boolean doActivate) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
//
|
|
Packit |
5e46da |
// ContainerPeer
|
|
Packit |
5e46da |
//
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void beginLayout() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void beginValidate() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void endLayout() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void endValidate() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public Insets getInsets() {
|
|
Packit |
5e46da |
return insets;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* java 1.6 only */
|
|
Packit |
5e46da |
public Insets insets() {
|
|
Packit |
5e46da |
return getInsets();
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* java 1.6 only */
|
|
Packit |
5e46da |
public boolean isPaintPending() {
|
|
Packit |
5e46da |
return false;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* java 1.6 only */
|
|
Packit |
5e46da |
public boolean isRestackSupported() {
|
|
Packit |
5e46da |
return false;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* java 1.6 only */
|
|
Packit |
5e46da |
public void restack() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
//
|
|
Packit |
5e46da |
// WindowPeer
|
|
Packit |
5e46da |
//
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void repositionSecurityWarning() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Removed in java 1.6 update 45 */
|
|
Packit |
5e46da |
public void setAlwaysOnTop(boolean b) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* java 1.6 update 45. Also in java 7 / 8. */
|
|
Packit |
5e46da |
public void updateAlwaysOnTopState() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setModalBlocked(Dialog d,boolean b) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setOpacity(float f) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setOpaque(boolean b) {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void toBack() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void toFront() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void updateFocusableWindowState() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void updateIconImages() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void updateMinimumSize() {
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void updateWindow(BufferedImage b) {
|
|
Packit |
5e46da |
logger.unimplemented("updateWindow");
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* java 1.7 ? */
|
|
Packit |
5e46da |
public void updateWindow() {
|
|
Packit |
5e46da |
logger.unimplemented("updateWindow");
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* java 1.6 only */
|
|
Packit |
5e46da |
public boolean requestWindowFocus() {
|
|
Packit |
5e46da |
return true;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
//
|
|
Packit |
5e46da |
// ComponentPeer
|
|
Packit |
5e46da |
//
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
//public Rectangle getBounds() {
|
|
Packit |
5e46da |
// return rootWindow.getBounds();
|
|
Packit |
5e46da |
//}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public Graphics getGraphics() {
|
|
Packit |
5e46da |
return new BDWindowGraphics(rootWindow);
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public Image createImage(int width, int height) {
|
|
Packit |
5e46da |
return ((BDToolkit)BDToolkit.getDefaultToolkit()).createImage((Component)null, width, height);
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public boolean requestFocus(Component c, boolean a, boolean b, long l, sun.awt.CausedFocusEvent.Cause d) {
|
|
Packit |
5e46da |
if (c == null) {
|
|
Packit |
5e46da |
return true;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
final FocusEvent focusEvent = new FocusEvent(c, FocusEvent.FOCUS_GAINED);
|
|
Packit |
5e46da |
AccessController.doPrivileged(
|
|
Packit |
5e46da |
new PrivilegedAction() {
|
|
Packit |
5e46da |
public Object run() {
|
|
Packit |
5e46da |
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(focusEvent);
|
|
Packit |
5e46da |
return null;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
});
|
|
Packit |
5e46da |
return true;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void setVisible(boolean b) {
|
|
Packit |
5e46da |
//Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new WindowEvent((Frame)component, WindowEvent.WINDOW_ACTIVATED));
|
|
Packit |
5e46da |
if (b == true) {
|
|
Packit |
5e46da |
Graphics g = getGraphics();
|
|
Packit |
5e46da |
component.paint(g);
|
|
Packit |
5e46da |
g.dispose();
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
public void dispose() {
|
|
Packit |
5e46da |
super.dispose();
|
|
Packit |
5e46da |
rootWindow = null;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
private BDRootWindow rootWindow;
|
|
Packit |
5e46da |
private Insets insets = new Insets(0, 0, 0, 0);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
private static final Logger logger = Logger.getLogger(BDFramePeer.class.getName());
|
|
Packit |
5e46da |
}
|