diff options
Diffstat (limited to 'src/windows/classes/sun')
10 files changed, 417 insertions, 140 deletions
diff --git a/src/windows/classes/sun/awt/Win32GraphicsConfig.java b/src/windows/classes/sun/awt/Win32GraphicsConfig.java index 2eefb33f1..92bd3b8af 100644 --- a/src/windows/classes/sun/awt/Win32GraphicsConfig.java +++ b/src/windows/classes/sun/awt/Win32GraphicsConfig.java @@ -332,9 +332,7 @@ public class Win32GraphicsConfig extends GraphicsConfiguration // the rest of the flip actions are not supported } - /* @Override - */ public boolean isTranslucencyCapable() { //XXX: worth checking if 8-bit? Anyway, it doesn't hurt. return true; diff --git a/src/windows/classes/sun/awt/windows/WComponentPeer.java b/src/windows/classes/sun/awt/windows/WComponentPeer.java index 6ad608452..d5e451903 100644 --- a/src/windows/classes/sun/awt/windows/WComponentPeer.java +++ b/src/windows/classes/sun/awt/windows/WComponentPeer.java @@ -970,11 +970,12 @@ public abstract class WComponentPeer extends WObjectPeer * * Conditions which could prevent hw acceleration include the toplevel * window containing this component being - * {@link com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT TRANSLUCENT}. + * {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT + * PERPIXEL_TRANSLUCENT}. * * @return {@code true} if this component is capable of being hw * accelerated, {@code false} otherwise - * @see com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT + * @see GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT */ public boolean isAccelCapable() { boolean isTranslucent = diff --git a/src/windows/classes/sun/awt/windows/WDialogPeer.java b/src/windows/classes/sun/awt/windows/WDialogPeer.java index 96cdb26f6..4424f1cc8 100644 --- a/src/windows/classes/sun/awt/windows/WDialogPeer.java +++ b/src/windows/classes/sun/awt/windows/WDialogPeer.java @@ -114,12 +114,10 @@ class WDialogPeer extends WWindowPeer implements DialogPeer { } public void reshape(int x, int y, int width, int height) { - Rectangle newBounds = constrainBounds(x, y, width, height); - if (((Dialog)target).isUndecorated()) { - super.reshape(newBounds.x, newBounds.y, newBounds.width, newBounds.height); + super.reshape(x, y, width, height); } else { - reshapeFrame(newBounds.x, newBounds.y, newBounds.width, newBounds.height); + reshapeFrame(x, y, width, height); } } diff --git a/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java b/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java index 2e1e6e618..2ed17f60f 100644 --- a/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java +++ b/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java @@ -68,12 +68,6 @@ public class WEmbeddedFramePeer extends WFramePeer { public native void synthesizeWmActivate(boolean doActivate); @Override - Rectangle constrainBounds(int x, int y, int width, int height) { - // We don't constrain the bounds of the EmbeddedFrames - return new Rectangle(x, y, width, height); - } - - @Override public boolean isAccelCapable() { // REMIND: Temp workaround for issues with using HW acceleration // in the browser on Vista when DWM is enabled diff --git a/src/windows/classes/sun/awt/windows/WFramePeer.java b/src/windows/classes/sun/awt/windows/WFramePeer.java index 79bf6b77e..86bde2658 100644 --- a/src/windows/classes/sun/awt/windows/WFramePeer.java +++ b/src/windows/classes/sun/awt/windows/WFramePeer.java @@ -89,12 +89,10 @@ class WFramePeer extends WWindowPeer implements FramePeer { } public void reshape(int x, int y, int width, int height) { - Rectangle newBounds = constrainBounds(x, y, width, height); - if (((Frame)target).isUndecorated()) { - super.reshape(newBounds.x, newBounds.y, newBounds.width, newBounds.height); + super.reshape(x, y, width, height); } else { - reshapeFrame(newBounds.x, newBounds.y, newBounds.width, newBounds.height); + reshapeFrame(x, y, width, height); } } diff --git a/src/windows/classes/sun/awt/windows/WPanelPeer.java b/src/windows/classes/sun/awt/windows/WPanelPeer.java index 10ca42314..3b4af6dd1 100644 --- a/src/windows/classes/sun/awt/windows/WPanelPeer.java +++ b/src/windows/classes/sun/awt/windows/WPanelPeer.java @@ -99,45 +99,4 @@ class WPanelPeer extends WCanvasPeer implements PanelPeer { public Insets insets() { return getInsets(); } - - private native void pRestack(Object[] peers); - private void restack(Container cont, Vector peers) { - for (int i = 0; i < cont.getComponentCount(); i++) { - Component comp = cont.getComponent(i); - if (!comp.isLightweight()) { - ComponentPeer peer = comp.getPeer(); - if (peer != null && (peer instanceof WComponentPeer)) - { - peers.add(peer); - } else { - if (log.isLoggable(Level.FINE)) { - log.log(Level.FINE, - "peer of a {0} is null or not a WComponentPeer: {1}.", - new Object[]{comp, peer}); - } - } - } - if (comp.isLightweight() && comp instanceof Container) { - restack((Container)comp, peers); - } - } - } - - /** - * @see java.awt.peer.ContainerPeer#restack - */ - public void restack() { - Vector peers = new Vector(); - peers.add(this); - Container cont = (Container)target; - restack(cont, peers); - pRestack(peers.toArray()); - } - - /** - * @see java.awt.peer.ContainerPeer#isRestackSupported - */ - public boolean isRestackSupported() { - return true; - } } diff --git a/src/windows/classes/sun/awt/windows/WWindowPeer.java b/src/windows/classes/sun/awt/windows/WWindowPeer.java index 3c6240209..8de4390f8 100644 --- a/src/windows/classes/sun/awt/windows/WWindowPeer.java +++ b/src/windows/classes/sun/awt/windows/WWindowPeer.java @@ -335,16 +335,14 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, } private void updateShape() { - // Shape shape = ((Window)target).getShape(); - Shape shape = AWTAccessor.getWindowAccessor().getShape((Window)target); + Shape shape = ((Window)target).getShape(); if (shape != null) { applyShape(Region.getInstance(shape, null)); } } private void updateOpacity() { - // float opacity = ((Window)target).getOpacity(); - float opacity = AWTAccessor.getWindowAccessor().getOpacity((Window)target); + float opacity = ((Window)target).getOpacity(); if (opacity < 1.0f) { setOpacity(opacity); } @@ -546,81 +544,16 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, private volatile int sysW = 0; private volatile int sysH = 0; - Rectangle constrainBounds(int x, int y, int width, int height) { - GraphicsConfiguration gc = this.winGraphicsConfig; - - // We don't restrict the setBounds() operation if the code is trusted. - if (!hasWarningWindow() || gc == null) { - return new Rectangle(x, y, width, height); - } - - int newX = x; - int newY = y; - int newW = width; - int newH = height; - - Rectangle sB = gc.getBounds(); - Insets sIn = Toolkit.getDefaultToolkit().getScreenInsets(gc); - - int screenW = sB.width - sIn.left - sIn.right; - int screenH = sB.height - sIn.top - sIn.bottom; - - // If it's undecorated or is not currently visible - if (!AWTAccessor.getComponentAccessor().isVisible_NoClientCode( - (Component)target) || isTargetUndecorated()) - { - // Now check each point is within the visible part of the screen - int screenX = sB.x + sIn.left; - int screenY = sB.y + sIn.top; - - // First make sure the size is within the visible part of the screen - if (newW > screenW) { - newW = screenW; - } - if (newH > screenH) { - newH = screenH; - } - - // Tweak the location if needed - if (newX < screenX) { - newX = screenX; - } else if (newX + newW > screenX + screenW) { - newX = screenX + screenW - newW; - } - if (newY < screenY) { - newY = screenY; - } else if (newY + newH > screenY + screenH) { - newY = screenY + screenH - newH; - } - } else { - int maxW = Math.max(screenW, sysW); - int maxH = Math.max(screenH, sysH); - - // Make sure the size is withing the visible part of the screen - // OR less that the current size of the window. - if (newW > maxW) { - newW = maxW; - } - if (newH > maxH) { - newH = maxH; - } - } - - return new Rectangle(newX, newY, newW, newH); - } - public native void repositionSecurityWarning(); @Override public void setBounds(int x, int y, int width, int height, int op) { - Rectangle newBounds = constrainBounds(x, y, width, height); + sysX = x; + sysY = y; + sysW = width; + sysH = height; - sysX = newBounds.x; - sysY = newBounds.y; - sysW = newBounds.width; - sysH = newBounds.height; - - super.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height, op); + super.setBounds(x, y, width, height, op); } @Override @@ -675,11 +608,13 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, public void setOpaque(boolean isOpaque) { Window target = (Window)getTarget(); - SunToolkit sunToolkit = (SunToolkit)target.getToolkit(); - if (!sunToolkit.isWindowTranslucencySupported() || - !sunToolkit.isTranslucencyCapable(target.getGraphicsConfiguration())) - { - return; + if (!isOpaque) { + SunToolkit sunToolkit = (SunToolkit)target.getToolkit(); + if (!sunToolkit.isWindowTranslucencySupported() || + !sunToolkit.isTranslucencyCapable(target.getGraphicsConfiguration())) + { + return; + } } boolean opaqueChanged = this.isOpaque != isOpaque; @@ -713,9 +648,9 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, // its shape only. To restore the correct visual appearance // of the window (i.e. w/ the correct shape) we have to reset // the shape. - Shape shape = AWTAccessor.getWindowAccessor().getShape(target); + Shape shape = ((Window)target).getShape(); if (shape != null) { - AWTAccessor.getWindowAccessor().setShape(target, shape); + ((Window)target).setShape(shape); } } @@ -729,6 +664,11 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, return; } + Component target = (Component)this.target; + if (target.getWidth() <= 0 || target.getHeight() <= 0) { + return; + } + TranslucentWindowPainter currentPainter = painter; if (currentPainter != null) { currentPainter.updateWindow(backBuffer); diff --git a/src/windows/classes/sun/nio/ch/SctpChannelImpl.java b/src/windows/classes/sun/nio/ch/SctpChannelImpl.java new file mode 100644 index 000000000..4a06a07dd --- /dev/null +++ b/src/windows/classes/sun/nio/ch/SctpChannelImpl.java @@ -0,0 +1,150 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package sun.nio.ch; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.ByteBuffer; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.Association; +import com.sun.nio.sctp.MessageInfo; +import com.sun.nio.sctp.NotificationHandler; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpChannelImpl extends SctpChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public Association association() { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel bind(SocketAddress local) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean connect(SocketAddress remote) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean connect(SocketAddress remote, int maxOutStreams, + int maxInStreams) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean isConnectionPending() { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean finishConnect() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set<SocketAddress> getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set<SocketAddress> getRemoteAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel shutdown() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public <T> T getOption(SctpSocketOption<T> name) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public <T> SctpChannel setOption(SctpSocketOption<T> name, T value) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set<SctpSocketOption<?>> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + public <T> MessageInfo receive(ByteBuffer dst, T attachment, + NotificationHandler<T> handler) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public int send(ByteBuffer src, MessageInfo messageInfo) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/src/windows/classes/sun/nio/ch/SctpMultiChannelImpl.java b/src/windows/classes/sun/nio/ch/SctpMultiChannelImpl.java new file mode 100644 index 000000000..372a0616d --- /dev/null +++ b/src/windows/classes/sun/nio/ch/SctpMultiChannelImpl.java @@ -0,0 +1,137 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package sun.nio.ch; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.ByteBuffer; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.Association; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.MessageInfo; +import com.sun.nio.sctp.NotificationHandler; +import com.sun.nio.sctp.SctpMultiChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpMultiChannelImpl extends SctpMultiChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpMultiChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public Set<Association> associations() { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel bind(SocketAddress local, + int backlog) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set<SocketAddress> getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set<SocketAddress> getRemoteAddresses + (Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel shutdown(Association association) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public <T> T getOption(SctpSocketOption<T> name, + Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public <T> SctpMultiChannel setOption(SctpSocketOption<T> name, + T value, Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set<SctpSocketOption<?>> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + public <T> MessageInfo receive(ByteBuffer buffer, T attachment, + NotificationHandler<T> handler) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public int send(ByteBuffer buffer, MessageInfo messageInfo) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel branch(Association association) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/src/windows/classes/sun/nio/ch/SctpServerChannelImpl.java b/src/windows/classes/sun/nio/ch/SctpServerChannelImpl.java new file mode 100644 index 000000000..36fbbcfd9 --- /dev/null +++ b/src/windows/classes/sun/nio/ch/SctpServerChannelImpl.java @@ -0,0 +1,102 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package sun.nio.ch; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.SctpServerChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpServerChannelImpl extends SctpServerChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpServerChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel accept() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel bind(SocketAddress local, + int backlog) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set<SocketAddress> getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public <T> T getOption(SctpSocketOption<T> name) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public <T> SctpServerChannel setOption(SctpSocketOption<T> name, + T value) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set<SctpSocketOption<?>> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} |