mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-15 18:33:41 +00:00
8355790: Enhance code consistency: java.desktop/unix:sun.awt
Reviewed-by: achung, prr
This commit is contained in:
parent
436960308c
commit
97d2a37927
@ -103,6 +103,7 @@ public class FcFontManager extends SunFontManager {
|
||||
|
||||
native String getFontPathNative(boolean noType1Fonts, boolean isX11GE);
|
||||
|
||||
@Override
|
||||
protected synchronized String getFontPath(boolean noType1Fonts) {
|
||||
return getFontPathNative(noType1Fonts, false);
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ import java.io.File;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.Toolkit;
|
||||
|
||||
public class PlatformGraphicsInfo {
|
||||
public final class PlatformGraphicsInfo {
|
||||
|
||||
public static GraphicsEnvironment createGE() {
|
||||
return new X11GraphicsEnvironment();
|
||||
|
||||
@ -70,7 +70,7 @@ public abstract class UNIXToolkit extends SunToolkit
|
||||
ANY(0),
|
||||
GTK3(Constants.GTK3_MAJOR_NUMBER);
|
||||
|
||||
static class Constants {
|
||||
static final class Constants {
|
||||
static final int GTK3_MAJOR_NUMBER = 3;
|
||||
}
|
||||
|
||||
|
||||
@ -154,6 +154,7 @@ final class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer {
|
||||
// have delegated to FileDialog#setFile
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void requestXFocus(long time, boolean timeProvided) {
|
||||
if(standaloneWindow == 0) {
|
||||
super.requestXFocus(time, timeProvided);
|
||||
|
||||
@ -78,6 +78,7 @@ public abstract class InfoWindow extends Window {
|
||||
closer = new Closer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component add(Component c) {
|
||||
container.add(c, BorderLayout.CENTER);
|
||||
return c;
|
||||
@ -114,15 +115,17 @@ public abstract class InfoWindow extends Window {
|
||||
closer.schedule();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void hide() {
|
||||
closer.close();
|
||||
}
|
||||
|
||||
private class Closer implements Runnable {
|
||||
private final class Closer implements Runnable {
|
||||
Runnable action;
|
||||
int time;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
doClose();
|
||||
}
|
||||
@ -166,7 +169,7 @@ public abstract class InfoWindow extends Window {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
public static class Tooltip extends InfoWindow {
|
||||
public static final class Tooltip extends InfoWindow {
|
||||
|
||||
public interface LiveArguments extends InfoWindow.LiveArguments {
|
||||
/** The tooltip to be displayed. */
|
||||
@ -254,7 +257,7 @@ public abstract class InfoWindow extends Window {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
public static class Balloon extends InfoWindow {
|
||||
public static final class Balloon extends InfoWindow {
|
||||
|
||||
public interface LiveArguments extends InfoWindow.LiveArguments {
|
||||
/** The action to be performed upon clicking the balloon. */
|
||||
@ -422,6 +425,7 @@ public abstract class InfoWindow extends Window {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
displayer.thread.interrupt();
|
||||
super.dispose();
|
||||
@ -451,7 +455,8 @@ public abstract class InfoWindow extends Window {
|
||||
}
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
private class ActionPerformer extends MouseAdapter {
|
||||
private final class ActionPerformer extends MouseAdapter {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
// hide the balloon by any click
|
||||
hide();
|
||||
@ -464,7 +469,7 @@ public abstract class InfoWindow extends Window {
|
||||
}
|
||||
}
|
||||
|
||||
private class Displayer implements Runnable {
|
||||
private final class Displayer implements Runnable {
|
||||
final int MAX_CONCURRENT_MSGS = 10;
|
||||
|
||||
ArrayBlockingQueue<Message> messageQueue = new ArrayBlockingQueue<Message>(MAX_CONCURRENT_MSGS);
|
||||
@ -511,7 +516,7 @@ public abstract class InfoWindow extends Window {
|
||||
}
|
||||
}
|
||||
|
||||
private static class Message {
|
||||
private static final class Message {
|
||||
String caption, text, messageType;
|
||||
|
||||
Message(String caption, String text, String messageType) {
|
||||
@ -522,4 +527,3 @@ public abstract class InfoWindow extends Window {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ import sun.awt.OSInfo;
|
||||
*
|
||||
*/
|
||||
|
||||
class MotifColorUtilities {
|
||||
final class MotifColorUtilities {
|
||||
|
||||
|
||||
static final float XmRED_LUMINOSITY=0.30f;
|
||||
|
||||
@ -38,7 +38,7 @@ import jdk.internal.misc.Unsafe;
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
class MotifDnDConstants {
|
||||
final class MotifDnDConstants {
|
||||
// utility class can not be instantiated
|
||||
private MotifDnDConstants() {}
|
||||
// Note that offsets in all native structures below do not depend on the
|
||||
|
||||
@ -40,7 +40,7 @@ import jdk.internal.misc.Unsafe;
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
final class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
implements XEventDispatcher {
|
||||
|
||||
private static final Unsafe unsafe = XlibWrapper.unsafe;
|
||||
@ -61,10 +61,12 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
return new MotifDnDDragSourceProtocol(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProtocolName() {
|
||||
return XDragAndDropProtocols.MotifDnD;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initializeDragImpl(int actions, Transferable contents,
|
||||
Map<Long, DataFlavor> formatMap, long[] formats)
|
||||
throws InvalidDnDOperationException,
|
||||
@ -95,6 +97,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
*
|
||||
* @return true if the event was successfully processed.
|
||||
*/
|
||||
@Override
|
||||
public boolean processClientMessage(XClientMessageEvent xclient) {
|
||||
if (xclient.get_message_type() !=
|
||||
MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom()) {
|
||||
@ -173,6 +176,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetWindowInfo getTargetWindowInfo(long window) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -232,6 +236,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendEnterMessage(long[] formats,
|
||||
int sourceAction, int sourceActions, long time) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
@ -273,6 +278,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMoveMessage(int xRoot, int yRoot,
|
||||
int sourceAction, int sourceActions, long time) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
@ -311,6 +317,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendLeaveMessage(long time) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
assert getTargetWindow() != 0;
|
||||
@ -342,6 +349,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendDropMessage(int xRoot, int yRoot,
|
||||
int sourceAction, int sourceActions,
|
||||
long time) {
|
||||
@ -388,17 +396,20 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processProxyModeEvent(XClientMessageEvent xclient,
|
||||
long sourceWindow) {
|
||||
// Motif DnD for XEmbed is not implemented.
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanupTargetInfo() {
|
||||
super.cleanupTargetInfo();
|
||||
targetEnterServerTime = XConstants.CurrentTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchEvent(XEvent ev) {
|
||||
switch (ev.get_type()) {
|
||||
case XConstants.SelectionRequest:
|
||||
|
||||
@ -40,7 +40,7 @@ import jdk.internal.misc.Unsafe;
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
final class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
private static final Unsafe unsafe = XlibWrapper.unsafe;
|
||||
|
||||
private long sourceWindow = 0;
|
||||
@ -68,22 +68,26 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return new MotifDnDDropTargetProtocol(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProtocolName() {
|
||||
return XDragAndDropProtocols.MotifDnD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDropTarget(long window) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
MotifDnDConstants.writeDragReceiverInfoStruct(window);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterDropTarget(long window) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
MotifDnDConstants.XA_MOTIF_ATOM_0.DeleteProperty(window);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerEmbedderDropSite(long embedder) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -185,6 +189,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
putEmbedderRegistryEntry(embedder, overridden, version, proxy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterEmbedderDropSite(long embedder) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -261,6 +266,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
* Gets and stores in the registry the embedder's Motif DnD drop site info
|
||||
* from the embedded.
|
||||
*/
|
||||
@Override
|
||||
public void registerEmbeddedDropSite(long embedded) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -317,6 +323,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
putEmbedderRegistryEntry(embedded, overridden, version, proxy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProtocolSupported(long window) {
|
||||
WindowPropertyGetter wpg =
|
||||
new WindowPropertyGetter(window,
|
||||
@ -677,6 +684,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMessageType(XClientMessageEvent xclient) {
|
||||
if (xclient.get_message_type() !=
|
||||
MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom()) {
|
||||
@ -703,6 +711,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean processClientMessageImpl(XClientMessageEvent xclient) {
|
||||
if (xclient.get_message_type() !=
|
||||
MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom()) {
|
||||
@ -751,26 +760,31 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
* Currently we don't synthesize enter/leave messages for Motif DnD
|
||||
* protocol. See comments in XDropTargetProtocol.postProcessClientMessage.
|
||||
*/
|
||||
@Override
|
||||
protected void sendEnterMessageToToplevel(long win,
|
||||
XClientMessageEvent xclient) {
|
||||
throw new Error("UNIMPLEMENTED");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendLeaveMessageToToplevel(long win,
|
||||
XClientMessageEvent xclient) {
|
||||
throw new Error("UNIMPLEMENTED");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean forwardEventToEmbedded(long embedded, long ctxt,
|
||||
int eventID) {
|
||||
// UNIMPLEMENTED.
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isXEmbedSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendResponse(long ctxt, int eventID, int action) {
|
||||
XClientMessageEvent xclient = new XClientMessageEvent(ctxt);
|
||||
if (xclient.get_message_type() !=
|
||||
@ -890,6 +904,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getData(long ctxt, long format)
|
||||
throws IllegalArgumentException, IOException {
|
||||
XClientMessageEvent xclient = new XClientMessageEvent(ctxt);
|
||||
@ -941,6 +956,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return selection.getData(format, time_stamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendDropDone(long ctxt, boolean success, int dropAction) {
|
||||
XClientMessageEvent xclient = new XClientMessageEvent(ctxt);
|
||||
|
||||
@ -1004,6 +1020,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long getSourceWindow() {
|
||||
return sourceWindow;
|
||||
}
|
||||
@ -1011,6 +1028,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
/**
|
||||
* Reset the state of the object.
|
||||
*/
|
||||
@Override
|
||||
public void cleanup() {
|
||||
// Clear the reference to this protocol.
|
||||
XDropTargetEventProcessor.reset();
|
||||
@ -1046,6 +1064,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
topLevelLeavePostponed = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDragOverComponent() {
|
||||
return targetXWindow != null;
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ import java.util.Vector;
|
||||
* native data types on different platforms similarly.
|
||||
*/
|
||||
|
||||
class Native {
|
||||
final class Native {
|
||||
|
||||
private static Unsafe unsafe = XlibWrapper.unsafe;
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ package sun.awt.X11;
|
||||
import jdk.internal.misc.Unsafe;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord {
|
||||
final class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord {
|
||||
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.UnsafeXDisposerRecord");
|
||||
private static Unsafe unsafe = XlibWrapper.unsafe;
|
||||
final long[] unsafe_ptrs, x_ptrs;
|
||||
@ -55,6 +55,7 @@ class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
|
||||
@ -26,7 +26,7 @@ package sun.awt.X11;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
class WindowDimensions {
|
||||
final class WindowDimensions {
|
||||
private Point loc;
|
||||
private Dimension size;
|
||||
private Insets insets;
|
||||
@ -160,10 +160,12 @@ class WindowDimensions {
|
||||
return isClientSizeSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[" + loc + ", " + size + "(" +(isClientSizeSet?"client":"bounds") + ")+" + insets + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof WindowDimensions)) {
|
||||
return false;
|
||||
@ -174,6 +176,7 @@ class WindowDimensions {
|
||||
&& (getBounds().equals(dims.getBounds()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ((insets == null)? (0):(insets.hashCode())) ^ getClientRect().hashCode() ^ getBounds().hashCode();
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ package sun.awt.X11;
|
||||
import java.util.*;
|
||||
import jdk.internal.misc.Unsafe;
|
||||
|
||||
public class WindowPropertyGetter {
|
||||
public final class WindowPropertyGetter {
|
||||
private static Unsafe unsafe = XlibWrapper.unsafe;
|
||||
private final long actual_type = unsafe.allocateMemory(8);
|
||||
private final long actual_format = unsafe.allocateMemory(4);
|
||||
|
||||
@ -39,7 +39,7 @@ import com.sun.java.swing.plaf.motif.*;
|
||||
import sun.awt.X11.XComponentPeer;
|
||||
|
||||
@SuppressWarnings({"serial", "removal"}) // JDK-implementation class
|
||||
class XAWTLookAndFeel extends MotifLookAndFeel {
|
||||
final class XAWTLookAndFeel extends MotifLookAndFeel {
|
||||
|
||||
/**
|
||||
* Load the SystemColors into the defaults table. The keys
|
||||
@ -49,6 +49,7 @@ class XAWTLookAndFeel extends MotifLookAndFeel {
|
||||
* values, otherwise we create color objects whose values match
|
||||
* the default CDE/Motif colors.
|
||||
*/
|
||||
@Override
|
||||
protected void initSystemColorDefaults(UIDefaults table) {
|
||||
String[] defaultSystemColors = {
|
||||
"desktop", "#005C5C", /* Color of the desktop background */
|
||||
@ -83,6 +84,7 @@ class XAWTLookAndFeel extends MotifLookAndFeel {
|
||||
loadSystemColors(table, defaultSystemColors, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initComponentDefaults(UIDefaults table) {
|
||||
super.initComponentDefaults(table);
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ import sun.awt.XSettings;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
|
||||
class XAWTXSettings extends XSettings implements XMSelectionListener {
|
||||
final class XAWTXSettings extends XSettings implements XMSelectionListener {
|
||||
|
||||
private final XAtom xSettingsPropertyAtom = XAtom.get("_XSETTINGS_SETTINGS");
|
||||
|
||||
@ -67,6 +67,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
|
||||
settings.removeSelectionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ownerDeath(int screen, XMSelection sel, long deadOwner) {
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
log.fine("Owner " + deadOwner + " died for selection " + sel + " screen "+ screen);
|
||||
@ -74,12 +75,14 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void ownerChanged(int screen, XMSelection sel, long newOwner, long data, long timestamp) {
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
log.fine("New Owner "+ newOwner + " for selection = " + sel + " screen " +screen );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectionChanged(int screen, XMSelection sel, long owner , XPropertyEvent event) {
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
log.fine("Selection changed on sel " + sel + " screen = " + screen + " owner = " + owner + " event = " + event);
|
||||
|
||||
@ -209,6 +209,7 @@ public final class XAtom {
|
||||
void register() {
|
||||
register(this);
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
if (name != null) {
|
||||
return name + ":" + atom;
|
||||
@ -769,6 +770,7 @@ public final class XAtom {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof XAtom)) {
|
||||
return false;
|
||||
@ -776,6 +778,7 @@ public final class XAtom {
|
||||
XAtom ot = (XAtom)o;
|
||||
return (atom == ot.atom && display == ot.display);
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int)((atom ^ display)& 0xFFFFL);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ import java.util.*;
|
||||
/**
|
||||
* Helper class to ease the work with the lists of atoms.
|
||||
*/
|
||||
class XAtomList {
|
||||
final class XAtomList {
|
||||
Set<XAtom> atoms = new HashSet<XAtom>();
|
||||
|
||||
/**
|
||||
@ -151,6 +151,7 @@ class XAtomList {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append("[");
|
||||
|
||||
@ -35,7 +35,7 @@ package sun.awt.X11;
|
||||
import java.awt.Component;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
class XAwtState {
|
||||
final class XAwtState {
|
||||
/**
|
||||
* The mouse is over this component.
|
||||
* If the component is not disabled, it received MOUSE_ENTERED but no MOUSE_EXITED.
|
||||
|
||||
@ -153,6 +153,7 @@ public abstract class XBaseMenuWindow extends XWindow {
|
||||
this.items = new XMenuItemPeer[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
@ -227,6 +228,7 @@ public abstract class XBaseMenuWindow extends XWindow {
|
||||
/**
|
||||
* Overrides XBaseWindow.instantPreInit
|
||||
*/
|
||||
@Override
|
||||
void instantPreInit(XCreateWindowParams params) {
|
||||
super.instantPreInit(params);
|
||||
items = new ArrayList<>();
|
||||
@ -894,6 +896,7 @@ public abstract class XBaseMenuWindow extends XWindow {
|
||||
/**
|
||||
* Filters X events
|
||||
*/
|
||||
@Override
|
||||
protected boolean isEventDisabled(XEvent e) {
|
||||
switch (e.get_type()) {
|
||||
case XConstants.Expose :
|
||||
@ -913,6 +916,7 @@ public abstract class XBaseMenuWindow extends XWindow {
|
||||
/**
|
||||
* Invokes disposal procedure on eventHandlerThread
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
setDisposed(true);
|
||||
|
||||
@ -943,6 +947,7 @@ public abstract class XBaseMenuWindow extends XWindow {
|
||||
* XBaseMenuWindow has no corresponding component
|
||||
* so events cannot be processed using standard means
|
||||
*/
|
||||
@Override
|
||||
void postEvent(final AWTEvent event) {
|
||||
InvocationEvent ev = new InvocationEvent(event.getSource(), new Runnable() {
|
||||
public void run() {
|
||||
@ -969,6 +974,7 @@ public abstract class XBaseMenuWindow extends XWindow {
|
||||
* Save location of pointer for further use
|
||||
* then invoke superclass
|
||||
*/
|
||||
@Override
|
||||
public boolean grabInput() {
|
||||
int rootX;
|
||||
int rootY;
|
||||
|
||||
@ -117,7 +117,7 @@ public class XBaseWindow {
|
||||
|
||||
// internal lock for synchronizing state changes and paint calls, initialized in preInit.
|
||||
// the order with other locks: AWTLock -> stateLock
|
||||
static class StateLock { }
|
||||
static final class StateLock { }
|
||||
protected StateLock state_lock;
|
||||
|
||||
/**
|
||||
@ -1235,6 +1235,7 @@ public class XBaseWindow {
|
||||
}
|
||||
return (XWindowPeer)bw;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + "(" + Long.toString(getWindow(), 16) + ")";
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ import java.awt.event.ActionEvent;
|
||||
import javax.swing.plaf.basic.*;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.SwingConstants;
|
||||
public class XButtonPeer extends XComponentPeer implements ButtonPeer {
|
||||
public final class XButtonPeer extends XComponentPeer implements ButtonPeer {
|
||||
private boolean pressed;
|
||||
private boolean armed;
|
||||
private Insets focusInsets;
|
||||
@ -51,6 +51,7 @@ public class XButtonPeer extends XComponentPeer implements ButtonPeer {
|
||||
return propertyPrefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
borderInsets = new Insets(2,2,2,2);
|
||||
@ -67,6 +68,7 @@ public class XButtonPeer extends XComponentPeer implements ButtonPeer {
|
||||
updateMotifColors(getPeerBackground());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
synchronized (target)
|
||||
{
|
||||
@ -75,6 +77,7 @@ public class XButtonPeer extends XComponentPeer implements ButtonPeer {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFocusable() {
|
||||
return true;
|
||||
}
|
||||
@ -90,11 +93,13 @@ public class XButtonPeer extends XComponentPeer implements ButtonPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBackground(Color c) {
|
||||
updateMotifColors(c);
|
||||
super.setBackground(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
void handleJavaMouseEvent(MouseEvent e) {
|
||||
super.handleJavaMouseEvent(e);
|
||||
int id = e.getID();
|
||||
@ -151,16 +156,19 @@ public class XButtonPeer extends XComponentPeer implements ButtonPeer {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
super.focusGained(e);
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
super.focusLost(e);
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
void handleJavaKeyEvent(KeyEvent e) {
|
||||
int id = e.getID();
|
||||
switch (id) {
|
||||
@ -191,6 +199,7 @@ public class XButtonPeer extends XComponentPeer implements ButtonPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
FontMetrics fm = getFontMetrics(getPeerFont());
|
||||
if ( label == null ) {
|
||||
|
||||
@ -46,6 +46,7 @@ class XCanvasPeer extends XComponentPeer implements CanvasPeer {
|
||||
super(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
if (SunToolkit.getSunAwtNoerasebackground()) {
|
||||
@ -56,6 +57,7 @@ class XCanvasPeer extends XComponentPeer implements CanvasPeer {
|
||||
/* Get a GraphicsConfig with the same visual on the new
|
||||
* screen, which should be easy in Xinerama mode.
|
||||
*/
|
||||
@Override
|
||||
public GraphicsConfiguration getAppropriateGraphicsConfiguration(
|
||||
GraphicsConfiguration gc)
|
||||
{
|
||||
@ -97,6 +99,7 @@ class XCanvasPeer extends XComponentPeer implements CanvasPeer {
|
||||
public void disableBackgroundErase() {
|
||||
eraseBackgroundDisabled = true;
|
||||
}
|
||||
@Override
|
||||
protected boolean doEraseBackground() {
|
||||
return !eraseBackgroundDisabled;
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ import java.util.Objects;
|
||||
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||
final class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||
|
||||
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XCheckboxPeer");
|
||||
|
||||
@ -82,6 +82,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||
updateMotifColors(getPeerBackground());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(XCreateWindowParams params) {
|
||||
// Put this here so it is executed before layout() is called from
|
||||
// setFont() in XComponent.postInit()
|
||||
@ -90,14 +91,17 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||
super.preInit(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFocusable() { return true; }
|
||||
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
// TODO: only need to paint the focus bit
|
||||
super.focusGained(e);
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
// TODO: only need to paint the focus bit?
|
||||
super.focusLost(e);
|
||||
@ -105,6 +109,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
void handleJavaKeyEvent(KeyEvent e) {
|
||||
int i = e.getID();
|
||||
switch (i) {
|
||||
@ -148,6 +153,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void handleJavaMouseEvent(MouseEvent e) {
|
||||
super.handleJavaMouseEvent(e);
|
||||
int i = e.getID();
|
||||
@ -241,6 +247,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||
|
||||
public void mouseClicked(MouseEvent e) {}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
/*
|
||||
* Spacing (number of pixels between check mark and label text) is
|
||||
@ -263,6 +270,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||
return (fm.getHeight() * 76 / 100) - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBackground(Color c) {
|
||||
updateMotifColors(c);
|
||||
super.setBackground(c);
|
||||
@ -271,6 +279,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer {
|
||||
/*
|
||||
* Layout the checkbox/radio button and text label
|
||||
*/
|
||||
@Override
|
||||
public void layout() {
|
||||
Dimension size = getPeerSize();
|
||||
Font f = getPeerFont();
|
||||
|
||||
@ -144,6 +144,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
super(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
Choice target = (Choice)this.target;
|
||||
@ -164,6 +165,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
SCROLLBAR_WIDTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
Choice target = (Choice)this.target;
|
||||
@ -181,11 +183,13 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
updateMotifColors(getPeerBackground());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFocusable() { return true; }
|
||||
|
||||
// 6399679. check if super.setBounds() actually changes the size of the
|
||||
// component and then compare current Choice size with a new one. If
|
||||
// they differ then hide dropdown menu
|
||||
@Override
|
||||
public void setBounds(int x, int y, int width, int height, int op) {
|
||||
int oldX = this.x;
|
||||
int oldY = this.y;
|
||||
@ -197,6 +201,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
// TODO: only need to paint the focus bit
|
||||
super.focusGained(e);
|
||||
@ -208,6 +213,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
* if setEnabled(false) invoked we should close opened choice in
|
||||
* order to prevent keyboard/mouse lock.
|
||||
*/
|
||||
@Override
|
||||
public void setEnabled(boolean value) {
|
||||
super.setEnabled(value);
|
||||
helper.updateColors(getGUIcolors());
|
||||
@ -216,12 +222,14 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
// TODO: only need to paint the focus bit?
|
||||
super.focusLost(e);
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
void ungrabInputImpl() {
|
||||
if (unfurled) {
|
||||
unfurled = false;
|
||||
@ -233,6 +241,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
super.ungrabInputImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
void handleJavaKeyEvent(KeyEvent e) {
|
||||
if (e.getID() == KeyEvent.KEY_PRESSED) {
|
||||
keyPressed(e);
|
||||
@ -345,8 +354,10 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handlesWheelScrolling() { return true; }
|
||||
|
||||
@Override
|
||||
void handleJavaMouseWheelEvent(MouseWheelEvent e) {
|
||||
if (unfurled && helper.isVSBVisible()) {
|
||||
if (ListHelper.doWheelScroll(helper.getVSB(), null, e)) {
|
||||
@ -355,6 +366,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void handleJavaMouseEvent(MouseEvent e) {
|
||||
super.handleJavaMouseEvent(e);
|
||||
int i = e.getID();
|
||||
@ -528,6 +540,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
}
|
||||
|
||||
// Stolen from TinyChoicePeer
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public Dimension getMinimumSize() {
|
||||
// TODO: move this impl into ListHelper?
|
||||
@ -544,6 +557,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
/*
|
||||
* Layout the...
|
||||
*/
|
||||
@Override
|
||||
public void layout() {
|
||||
/*
|
||||
Dimension size = target.getSize();
|
||||
@ -631,17 +645,20 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
* ChoicePeer methods stolen from TinyChoicePeer
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void select(int index) {
|
||||
helper.select(index);
|
||||
helper.setFocusedIndex(index);
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(String item, int index) {
|
||||
helper.add(item, index);
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(int index) {
|
||||
boolean selected = (index == helper.getSelectedIndex());
|
||||
boolean visibled = (index >= helper.firstDisplayedIndex() && index <= helper.lastDisplayedIndex());
|
||||
@ -694,6 +711,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAll() {
|
||||
helper.removeAll();
|
||||
helper.select(-1);
|
||||
@ -707,16 +725,19 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFont(Font font) {
|
||||
super.setFont(font);
|
||||
helper.setFont(this.font);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setForeground(Color c) {
|
||||
super.setForeground(c);
|
||||
helper.updateColors(getGUIcolors());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBackground(Color c) {
|
||||
super.setBackground(c);
|
||||
unfurledChoice.setBackground(c);
|
||||
@ -750,6 +771,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
* In this case we should hide pop-down menu.
|
||||
*/
|
||||
//calls from XWindowPeer. Could accept X-styled state events
|
||||
@Override
|
||||
public void stateChangedICCCM(int oldState, int newState) {
|
||||
if (unfurled && oldState != newState){
|
||||
hidePopdownMenu();
|
||||
@ -757,6 +779,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
}
|
||||
|
||||
//calls from XFramePeer. Could accept Frame's states.
|
||||
@Override
|
||||
public void stateChangedJava(int oldState, int newState) {
|
||||
if (unfurled && oldState != newState){
|
||||
hidePopdownMenu();
|
||||
@ -790,6 +813,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
}
|
||||
|
||||
// Override so we can do our own create()
|
||||
@Override
|
||||
public void preInit(XCreateWindowParams params) {
|
||||
// A parent of this window is the target, at this point: wrong.
|
||||
// Remove parent window; in the following preInit() call we'll calculate as a default
|
||||
@ -856,6 +880,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
return new Rectangle(x, y, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toFront() {
|
||||
// see 6240074 for more information
|
||||
if (choiceListener != null)
|
||||
@ -1035,11 +1060,15 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
* Overridden from XWindow() because we don't want to send
|
||||
* ComponentEvents
|
||||
*/
|
||||
@Override
|
||||
public void handleConfigureNotifyEvent(XEvent xev) {}
|
||||
@Override
|
||||
public void handleMapNotifyEvent(XEvent xev) {}
|
||||
@Override
|
||||
public void handleUnmapNotifyEvent(XEvent xev) {}
|
||||
} //UnfurledChoice
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (unfurledChoice != null) {
|
||||
unfurledChoice.destroy();
|
||||
@ -1057,6 +1086,7 @@ public final class XChoicePeer extends XComponentPeer implements ChoicePeer, Top
|
||||
* To be compatible with Motif we should handle all KeyEvents in
|
||||
* Choice if it is opened. KeyEvents should be sent into Java if Choice is not opened.
|
||||
*/
|
||||
@Override
|
||||
boolean prePostEvent(final AWTEvent e) {
|
||||
if (unfurled){
|
||||
// fix for 6253211: PIT: MouseWheel events not triggered for Choice drop down in XAWT
|
||||
|
||||
@ -73,6 +73,7 @@ public final class XClipboard extends SunClipboard implements OwnershipListener
|
||||
* NOTE: This method may be called by privileged threads.
|
||||
* DO NOT INVOKE CLIENT CODE ON THIS THREAD!
|
||||
*/
|
||||
@Override
|
||||
public void ownershipChanged(final boolean isOwner) {
|
||||
if (isOwner) {
|
||||
checkChangeHere(contents);
|
||||
@ -81,6 +82,7 @@ public final class XClipboard extends SunClipboard implements OwnershipListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected synchronized void setContentsNative(Transferable contents) {
|
||||
SortedMap<Long,DataFlavor> formatMap =
|
||||
DataTransferer.getInstance().getFormatsForTransferable
|
||||
@ -94,6 +96,7 @@ public final class XClipboard extends SunClipboard implements OwnershipListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getID() {
|
||||
return selection.getSelectionAtom().getAtom();
|
||||
}
|
||||
@ -107,15 +110,18 @@ public final class XClipboard extends SunClipboard implements OwnershipListener
|
||||
}
|
||||
|
||||
/* Caller is synchronized on this. */
|
||||
@Override
|
||||
protected void clearNativeContext() {
|
||||
selection.reset();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected long[] getClipboardFormats() {
|
||||
return selection.getTargets(XToolkit.getCurrentServerTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected byte[] getClipboardData(long format) throws IOException {
|
||||
return selection.getData(format, XToolkit.getCurrentServerTime());
|
||||
}
|
||||
@ -148,6 +154,7 @@ public final class XClipboard extends SunClipboard implements OwnershipListener
|
||||
return targetsPropertyAtom;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerClipboardViewerChecked() {
|
||||
// for XConvertSelection() to be called for the first time in getTargetsDelayed()
|
||||
isSelectionNotifyProcessed = true;
|
||||
@ -174,7 +181,8 @@ public final class XClipboard extends SunClipboard implements OwnershipListener
|
||||
}
|
||||
}
|
||||
|
||||
private static class CheckChangeTimerTask implements Runnable {
|
||||
private static final class CheckChangeTimerTask implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
for (XClipboard clpbrd : targetsAtom2Clipboard.values()) {
|
||||
clpbrd.getTargetsDelayed();
|
||||
@ -188,7 +196,8 @@ public final class XClipboard extends SunClipboard implements OwnershipListener
|
||||
}
|
||||
}
|
||||
|
||||
private static class SelectionNotifyHandler implements XEventDispatcher {
|
||||
private static final class SelectionNotifyHandler implements XEventDispatcher {
|
||||
@Override
|
||||
public void dispatchEvent(XEvent ev) {
|
||||
if (ev.get_type() == XConstants.SelectionNotify) {
|
||||
final XSelectionEvent xse = ev.get_xselection();
|
||||
@ -209,6 +218,7 @@ public final class XClipboard extends SunClipboard implements OwnershipListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void unregisterClipboardViewerChecked() {
|
||||
isSelectionNotifyProcessed = false;
|
||||
synchronized (XClipboard.classLock) {
|
||||
|
||||
@ -123,10 +123,12 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
boundsOperation = DEFAULT_OPERATION;
|
||||
}
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
|
||||
@ -152,6 +154,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reparent(ContainerPeer newNativeParent) {
|
||||
XComponentPeer newPeer = (XComponentPeer)newNativeParent;
|
||||
XToolkit.awtLock();
|
||||
@ -164,10 +167,12 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
XToolkit.awtUnlock();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean isReparentSupported() {
|
||||
return System.getProperty("sun.awt.X11.XComponentPeer.reparentNotSupported", "false").equals("false");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isObscured() {
|
||||
Container container = (target instanceof Container) ?
|
||||
(Container)target : target.getParent();
|
||||
@ -192,6 +197,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDetermineObscurity() {
|
||||
return true;
|
||||
}
|
||||
@ -233,6 +239,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
bHasFocus = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFocusable() {
|
||||
/* should be implemented by other sub-classes */
|
||||
return false;
|
||||
@ -243,6 +250,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
}
|
||||
|
||||
// TODO: consider moving it to KeyboardFocusManagerPeerImpl
|
||||
@Override
|
||||
public final boolean requestFocus(Component lightweightChild, boolean temporary,
|
||||
boolean focusedWindowChangeAllowed, long time,
|
||||
FocusEvent.Cause cause)
|
||||
@ -342,6 +350,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean b) {
|
||||
xSetVisible(b);
|
||||
}
|
||||
@ -353,6 +362,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
/**
|
||||
* @see java.awt.peer.ComponentPeer
|
||||
*/
|
||||
@Override
|
||||
public void setEnabled(final boolean value) {
|
||||
if (enableLog.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
enableLog.fine("{0}ing {1}", (value ? "Enabl" : "Disabl"), this);
|
||||
@ -400,9 +410,11 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
target.paint(g);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Graphics getGraphics() {
|
||||
return getGraphics(surfaceData, getPeerForeground(), getPeerBackground(), getPeerFont());
|
||||
}
|
||||
@Override
|
||||
public void print(Graphics g) {
|
||||
// clear rect here to emulate X clears rect before Expose
|
||||
g.setColor(target.getBackground());
|
||||
@ -414,6 +426,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
target.print(g);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBounds(int x, int y, int width, int height, int op) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
@ -424,10 +437,12 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
layout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reshape(int x, int y, int width, int height) {
|
||||
setBounds(x, y, width, height, SET_BOUNDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void coalescePaintEvent(PaintEvent e) {
|
||||
Rectangle r = e.getUpdateRect();
|
||||
if (!(e instanceof IgnorePaintEvent)) {
|
||||
@ -516,6 +531,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("fallthrough")
|
||||
public void handleEvent(java.awt.AWTEvent e) {
|
||||
if ((e instanceof InputEvent) && !((InputEvent)e).isConsumed() && target.isEnabled()) {
|
||||
@ -567,14 +583,17 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return target.getSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return getMinimumSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layout() {}
|
||||
|
||||
void updateMotifColors(Color bg) {
|
||||
@ -644,6 +663,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
* @see Toolkit#getFontMetrics(Font)
|
||||
* @since 1.0
|
||||
*/
|
||||
@Override
|
||||
public FontMetrics getFontMetrics(Font font) {
|
||||
if (fontLog.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
fontLog.fine("Getting font metrics for " + font);
|
||||
@ -672,6 +692,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
return font;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCursorImmediately() {
|
||||
XGlobalCursorManager.getCursorManager().updateCursorImmediately();
|
||||
}
|
||||
@ -708,10 +729,12 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image createImage(int width, int height) {
|
||||
return graphicsConfig.createAcceleratedImage(target, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VolatileImage createVolatileImage(int width, int height) {
|
||||
return new SunVolatileImage(target, width, height);
|
||||
}
|
||||
@ -732,6 +755,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
return paintPending && isLayouting;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handlesWheelScrolling() {
|
||||
return false;
|
||||
}
|
||||
@ -753,6 +777,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
isLayouting = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getWinBackground() {
|
||||
return getPeerBackground();
|
||||
}
|
||||
@ -1102,6 +1127,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
|
||||
private BufferCapabilities backBufferCaps;
|
||||
|
||||
@Override
|
||||
public void createBuffers(int numBuffers, BufferCapabilities caps)
|
||||
throws AWTException
|
||||
{
|
||||
@ -1120,6 +1146,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
return backBufferCaps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flip(int x1, int y1, int x2, int y2,
|
||||
BufferCapabilities.FlipContents flipAction)
|
||||
{
|
||||
@ -1133,6 +1160,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
x1, y1, x2, y2, flipAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getBackBuffer() {
|
||||
if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
buffersLog.fine("getBackBuffer()");
|
||||
@ -1143,6 +1171,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
return xBackBuffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyBuffers() {
|
||||
if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
buffersLog.fine("destroyBuffers()");
|
||||
@ -1178,6 +1207,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
* Currently if target component is disabled the following event will be disabled on window:
|
||||
* ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify
|
||||
*/
|
||||
@Override
|
||||
protected boolean isEventDisabled(XEvent e) {
|
||||
if (enableLog.isLoggable(PlatformLogger.Level.FINEST)) {
|
||||
enableLog.finest("Component is {1}, checking for disabled event {0}", e, (isEnabled()?"enabled":"disable"));
|
||||
@ -1249,6 +1279,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
* Lowers this component at the bottom of the above HW peer. If the above parameter
|
||||
* is null then the method places this component at the top of the Z-order.
|
||||
*/
|
||||
@Override
|
||||
public void setZOrder(ComponentPeer above) {
|
||||
long aboveWindow = (above != null) ? ((XComponentPeer)above).getWindow() : 0;
|
||||
|
||||
@ -1280,6 +1311,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
|
||||
/****** DropTargetPeer implementation ********************/
|
||||
|
||||
@Override
|
||||
public void addDropTarget(DropTarget dt) {
|
||||
Component comp = target;
|
||||
while(!(comp == null || comp instanceof Window)) {
|
||||
@ -1294,6 +1326,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeDropTarget(DropTarget dt) {
|
||||
Component comp = target;
|
||||
while(!(comp == null || comp instanceof Window)) {
|
||||
@ -1313,6 +1346,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
* Applies the shape to the X-window.
|
||||
* @since 1.7
|
||||
*/
|
||||
@Override
|
||||
public void applyShape(Region shape) {
|
||||
if (XlibUtil.isShapingSupported()) {
|
||||
if (shapeLog.isLoggable(PlatformLogger.Level.FINER)) {
|
||||
@ -1357,6 +1391,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateGraphicsData(GraphicsConfiguration gc) {
|
||||
int oldVisual = -1, newVisual = -1;
|
||||
|
||||
|
||||
@ -73,6 +73,7 @@ public final class XContentWindow extends XWindow {
|
||||
this.parentFrame = parentFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
params.putIfNull(BIT_GRAVITY, Integer.valueOf(XConstants.NorthWestGravity));
|
||||
@ -83,9 +84,11 @@ public final class XContentWindow extends XWindow {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getWMName() {
|
||||
return "Content window";
|
||||
}
|
||||
@Override
|
||||
protected boolean isEventDisabled(XEvent e) {
|
||||
switch (e.get_type()) {
|
||||
// Override parentFrame to receive MouseEnter/Exit
|
||||
@ -159,6 +162,7 @@ public final class XContentWindow extends XWindow {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void postPaintEvent(Component target, int x, int y, int w, int h) {
|
||||
// TODO: ?
|
||||
// get rid of 'instanceof' by subclassing:
|
||||
@ -188,7 +192,7 @@ public final class XContentWindow extends XWindow {
|
||||
iconifiedExposeEvents.clear();
|
||||
}
|
||||
|
||||
private static class SavedExposeEvent {
|
||||
private static final class SavedExposeEvent {
|
||||
Component target;
|
||||
int x, y, w, h;
|
||||
SavedExposeEvent(Component target, int x, int y, int w, int h) {
|
||||
@ -200,6 +204,7 @@ public final class XContentWindow extends XWindow {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + "[" + getBounds() + "]";
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ package sun.awt.X11;
|
||||
import java.util.HashMap;
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
public class XCreateWindowParams extends HashMap<Object, Object> {
|
||||
public final class XCreateWindowParams extends HashMap<Object, Object> {
|
||||
public XCreateWindowParams() {
|
||||
}
|
||||
public XCreateWindowParams(Object[] map) {
|
||||
@ -78,6 +78,7 @@ public class XCreateWindowParams extends HashMap<Object, Object> {
|
||||
remove(key);
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (Entry<Object, Object> entry : entrySet()) {
|
||||
|
||||
@ -36,7 +36,7 @@ import java.awt.*;
|
||||
* @author Bino George
|
||||
*/
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
public class XCustomCursor extends X11CustomCursor {
|
||||
public final class XCustomCursor extends X11CustomCursor {
|
||||
|
||||
public XCustomCursor(Image cursor, Point hotSpot, String name)
|
||||
throws IndexOutOfBoundsException {
|
||||
@ -74,6 +74,7 @@ public class XCustomCursor extends X11CustomCursor {
|
||||
return d;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createCursor(byte[] xorMask, byte[] andMask,
|
||||
int width, int height,
|
||||
int fcolor, int bcolor,
|
||||
|
||||
@ -61,7 +61,7 @@ import java.io.ByteArrayOutputStream;
|
||||
/**
|
||||
* Platform-specific support for the data transfer subsystem.
|
||||
*/
|
||||
public class XDataTransferer extends DataTransferer {
|
||||
public final class XDataTransferer extends DataTransferer {
|
||||
static final XAtom FILE_NAME_ATOM = XAtom.get("FILE_NAME");
|
||||
static final XAtom DT_NET_FILE_ATOM = XAtom.get("_DT_NETFILE");
|
||||
static final XAtom PNG_ATOM = XAtom.get("PNG");
|
||||
@ -161,6 +161,7 @@ public class XDataTransferer extends DataTransferer {
|
||||
return getTargetNameForAtom(format);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToolkitThreadBlockedHandler getToolkitThreadBlockedHandler() {
|
||||
return XToolkitThreadBlockedHandler.getToolkitThreadBlockedHandler();
|
||||
}
|
||||
|
||||
@ -71,10 +71,12 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
return window;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getContentWindow() {
|
||||
return (content == null) ? window : content.getWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
winAttr.initialFocus = true;
|
||||
@ -98,6 +100,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
params.add(EVENT_MASK, Long.valueOf(eventMask.longValue() & ~(XConstants.FocusChangeMask | XConstants.KeyPressMask | XConstants.KeyReleaseMask)));
|
||||
}
|
||||
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
// The size hints must be set BEFORE mapping the window (see 6895647)
|
||||
updateSizeHints(dimensions);
|
||||
@ -115,6 +118,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
focusProxy = createFocusProxy();
|
||||
}
|
||||
|
||||
@Override
|
||||
void setIconHints(java.util.List<IconInfo> icons) {
|
||||
if (!XWM.getWM().setNetWMIcon(this, icons)) {
|
||||
if (icons.size() > 0) {
|
||||
@ -126,6 +130,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMinimumSize() {
|
||||
super.updateMinimumSize();
|
||||
XToolkit.awtLock();
|
||||
@ -177,6 +182,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
return new XFocusProxyWindow(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected XAtomList getWMProtocols() {
|
||||
XAtomList protocols = super.getWMProtocols();
|
||||
protocols.add(wm_delete_window);
|
||||
@ -184,6 +190,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
return protocols;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Graphics getGraphics() {
|
||||
AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
|
||||
return getGraphics(content.surfaceData,
|
||||
@ -205,6 +212,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getWMName() {
|
||||
if (winAttr.title == null || winAttr.title.trim().isEmpty()) {
|
||||
return " ";
|
||||
@ -213,6 +221,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void updateWMName() {
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
@ -232,16 +241,19 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
|
||||
// NOTE: This method may be called by privileged threads.
|
||||
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
|
||||
@Override
|
||||
public void handleIconify() {
|
||||
postEvent(new WindowEvent((Window)target, WindowEvent.WINDOW_ICONIFIED));
|
||||
}
|
||||
|
||||
// NOTE: This method may be called by privileged threads.
|
||||
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
|
||||
@Override
|
||||
public void handleDeiconify() {
|
||||
postEvent(new WindowEvent((Window)target, WindowEvent.WINDOW_DEICONIFIED));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleFocusEvent(XEvent xev) {
|
||||
super.handleFocusEvent(xev);
|
||||
XFocusChangeEvent xfe = xev.get_xfocus();
|
||||
@ -258,6 +270,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
* I N S E T S C O D E
|
||||
**************************************************************************************/
|
||||
|
||||
@Override
|
||||
protected boolean isInitialReshape() {
|
||||
return false;
|
||||
}
|
||||
@ -317,6 +330,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePropertyNotify(XEvent xev) {
|
||||
super.handlePropertyNotify(xev);
|
||||
|
||||
@ -394,6 +408,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
|
||||
long reparent_serial = 0;
|
||||
|
||||
@Override
|
||||
public void handleReparentNotifyEvent(XEvent xev) {
|
||||
XReparentEvent xe = xev.get_xreparent();
|
||||
if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
@ -552,6 +567,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
return currentInsets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getInsets() {
|
||||
Insets in = copy(getRealInsets());
|
||||
in.top += getMenuBarHeight();
|
||||
@ -576,6 +592,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
updateSizeHints(rec.x, rec.y, rec.width, rec.height);
|
||||
}
|
||||
|
||||
@Override
|
||||
void updateSizeHints() {
|
||||
updateSizeHints(dimensions);
|
||||
}
|
||||
@ -720,6 +737,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
/**
|
||||
* @see java.awt.peer.ComponentPeer#setBounds
|
||||
*/
|
||||
@Override
|
||||
public void setBounds(int x, int y, int width, int height, int op) {
|
||||
// TODO: Rewrite with WindowDimensions
|
||||
XToolkit.awtLock();
|
||||
@ -741,6 +759,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
}
|
||||
|
||||
boolean no_reparent_artifacts = false;
|
||||
@Override
|
||||
public void handleConfigureNotifyEvent(XEvent xev) {
|
||||
if (XWM.getWMID() == XWM.UNITY_COMPIZ_WM && !insets_corrected) {
|
||||
return;
|
||||
@ -936,18 +955,22 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
return dimensions.getClientRect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle getBounds() {
|
||||
return dimensions.getBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getSize() {
|
||||
return dimensions.getSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getX() {
|
||||
return dimensions.getLocation().x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getY() {
|
||||
return dimensions.getLocation().y;
|
||||
}
|
||||
@ -956,20 +979,24 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
return dimensions.getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAbsoluteX() {
|
||||
// NOTE: returning this peer's location which is shell location
|
||||
return dimensions.getScreenBounds().x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAbsoluteY() {
|
||||
// NOTE: returning this peer's location which is shell location
|
||||
return dimensions.getScreenBounds().y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return getSize().width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return getSize().height;
|
||||
}
|
||||
@ -978,6 +1005,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getLocationOnScreen() {
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
@ -1000,6 +1028,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
* END OF I N S E T S C O D E
|
||||
**************************************************************************************/
|
||||
|
||||
@Override
|
||||
protected boolean isEventDisabled(XEvent e) {
|
||||
switch (e.get_type()) {
|
||||
// Do not generate MOVED/RESIZED events since we generate them by ourselves
|
||||
@ -1023,6 +1052,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
return winAttr.functions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean vis) {
|
||||
if (log.isLoggable(PlatformLogger.Level.FINER)) {
|
||||
log.finer("Setting {0} to visible {1}", this, Boolean.valueOf(vis));
|
||||
@ -1041,6 +1071,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void suppressWmTakeFocus(boolean doSuppress) {
|
||||
XAtomList protocols = getWMProtocols();
|
||||
if (doSuppress) {
|
||||
@ -1051,6 +1082,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
wm_protocols.setAtomListProperty(this, protocols);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (content != null) {
|
||||
content.destroy();
|
||||
@ -1064,6 +1096,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClientMessage(XEvent xev) {
|
||||
super.handleClientMessage(xev);
|
||||
XClientMessageEvent cl = xev.get_xclient();
|
||||
@ -1102,6 +1135,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
* Requests focus to this decorated top-level by requesting X input focus
|
||||
* to the shell window.
|
||||
*/
|
||||
@Override
|
||||
protected void requestXFocus(long time, boolean timeProvided) {
|
||||
// We have proxied focus mechanism - instead of shell the focus is held
|
||||
// by "proxy" - invisible mapped window. When we want to set X input focus to
|
||||
@ -1198,6 +1232,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
return Window.Type.POPUP.equals(getWindowType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requestWindowFocus(long time, boolean timeProvided) {
|
||||
focusLog.fine("Request for decorated window focus");
|
||||
// If this is Frame or Dialog we can't assure focus request success - but we still can try
|
||||
@ -1258,6 +1293,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
}
|
||||
|
||||
XWindowPeer actualFocusedWindow = null;
|
||||
@Override
|
||||
void setActualFocusedWindow(XWindowPeer actualFocusedWindow) {
|
||||
synchronized(getStateLock()) {
|
||||
this.actualFocusedWindow = actualFocusedWindow;
|
||||
@ -1270,6 +1306,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
setActualFocusedWindow(actualFocusedWindow);
|
||||
return requestWindowFocus(time, timeProvided);
|
||||
}
|
||||
@Override
|
||||
public void handleWindowFocusIn(long serial) {
|
||||
if (null == actualFocusedWindow) {
|
||||
super.handleWindowFocusIn(serial);
|
||||
@ -1302,6 +1339,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleWindowFocusOut(Window oppositeWindow, long serial) {
|
||||
Window actualFocusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ import java.util.List;
|
||||
*
|
||||
* @see DesktopPeer
|
||||
*/
|
||||
public class XDesktopPeer implements DesktopPeer {
|
||||
public final class XDesktopPeer implements DesktopPeer {
|
||||
|
||||
// supportedActions may be changed from native within an init() call
|
||||
private static final List<Action> supportedActions
|
||||
@ -78,10 +78,12 @@ public class XDesktopPeer implements DesktopPeer {
|
||||
return nativeLibraryLoaded && !supportedActions.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSupported(Action type) {
|
||||
return supportedActions.contains(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(File file) throws IOException {
|
||||
try {
|
||||
launch(file.toURI());
|
||||
@ -90,20 +92,24 @@ public class XDesktopPeer implements DesktopPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(File file) throws IOException {
|
||||
throw new UnsupportedOperationException("The current platform " +
|
||||
"doesn't support the EDIT action.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(File file) throws IOException {
|
||||
throw new UnsupportedOperationException("The current platform " +
|
||||
"doesn't support the PRINT action.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mail(URI uri) throws IOException {
|
||||
launch(uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void browse(URI uri) throws IOException {
|
||||
launch(uri);
|
||||
}
|
||||
|
||||
@ -40,6 +40,7 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer {
|
||||
super(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
|
||||
@ -58,6 +59,7 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer {
|
||||
winAttr.initialState = XWindowAttributesData.NORMAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean vis) {
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
@ -89,6 +91,7 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
int getDecorations() {
|
||||
int d = super.getDecorations();
|
||||
// remove minimize and maximize buttons for dialogs
|
||||
@ -100,6 +103,7 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer {
|
||||
return d;
|
||||
}
|
||||
|
||||
@Override
|
||||
int getFunctions() {
|
||||
int f = super.getFunctions();
|
||||
// remove minimize and maximize functions for dialogs
|
||||
@ -111,6 +115,7 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer {
|
||||
return f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blockWindows(java.util.List<Window> toBlock) {
|
||||
Vector<XWindowPeer> javaToplevels = null;
|
||||
XToolkit.awtLock();
|
||||
@ -134,6 +139,7 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer {
|
||||
* The focused window can't be blocked at the time it's focused.
|
||||
* Thus we don't have to perform any transitive (a blocker of a blocker) checks.
|
||||
*/
|
||||
@Override
|
||||
boolean isFocusedWindowModalBlocker() {
|
||||
Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
|
||||
XWindowPeer focusedWindowPeer = null;
|
||||
|
||||
@ -32,7 +32,7 @@ import java.awt.dnd.DnDConstants;
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
class XDnDConstants {
|
||||
final class XDnDConstants {
|
||||
static final XAtom XA_XdndActionCopy = XAtom.get("XdndActionCopy");
|
||||
static final XAtom XA_XdndActionMove = XAtom.get("XdndActionMove");
|
||||
static final XAtom XA_XdndActionLink = XAtom.get("XdndActionLink");
|
||||
|
||||
@ -42,7 +42,7 @@ import jdk.internal.misc.Unsafe;
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
final class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
private static final PlatformLogger logger =
|
||||
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDragSourceProtocol");
|
||||
|
||||
@ -61,6 +61,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
return new XDnDDragSourceProtocol(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProtocolName() {
|
||||
return XDragAndDropProtocols.XDnD;
|
||||
}
|
||||
@ -70,6 +71,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
*
|
||||
* @return true if the initialized successfully.
|
||||
*/
|
||||
@Override
|
||||
protected void initializeDragImpl(int actions, Transferable contents,
|
||||
Map<Long, DataFlavor> formatMap, long[] formats)
|
||||
throws InvalidDnDOperationException,
|
||||
@ -179,6 +181,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processClientMessage(XClientMessageEvent xclient) {
|
||||
if (xclient.get_message_type() == XDnDConstants.XA_XdndStatus.getAtom()) {
|
||||
return processXdndStatus(xclient);
|
||||
@ -189,6 +192,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetWindowInfo getTargetWindowInfo(long window) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -276,6 +280,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendEnterMessage(long[] formats,
|
||||
int sourceAction, int sourceActions, long time) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
@ -305,6 +310,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMoveMessage(int xRoot, int yRoot,
|
||||
int sourceAction, int sourceActions, long time) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
@ -330,6 +336,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendLeaveMessage(long time) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
assert getTargetWindow() != 0;
|
||||
@ -354,6 +361,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendDropMessage(int xRoot, int yRoot,
|
||||
int sourceAction, int sourceActions,
|
||||
long time) {
|
||||
@ -380,6 +388,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processProxyModeEvent(XClientMessageEvent xclient,
|
||||
long sourceWindow) {
|
||||
if (xclient.get_message_type() == XDnDConstants.XA_XdndStatus.getAtom() ||
|
||||
|
||||
@ -50,7 +50,7 @@ import sun.awt.X11GraphicsConfig;
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
final class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
private static final PlatformLogger logger =
|
||||
PlatformLogger.getLogger("sun.awt.X11.xembed.xdnd.XDnDDropTargetProtocol");
|
||||
|
||||
@ -84,10 +84,12 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return new XDnDDropTargetProtocol(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProtocolName() {
|
||||
return XDragAndDropProtocols.XDnD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDropTarget(long window) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -110,12 +112,14 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterDropTarget(long window) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
XDnDConstants.XA_XdndAware.DeleteProperty(window);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerEmbedderDropSite(long embedder) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -267,6 +271,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
putEmbedderRegistryEntry(embedder, overridden, version, proxy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterEmbedderDropSite(long embedder) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -317,6 +322,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
* Gets and stores in the registry the embedder's XDnD drop site info
|
||||
* from the embedded.
|
||||
*/
|
||||
@Override
|
||||
public void registerEmbeddedDropSite(long embedded) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -405,6 +411,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
putEmbedderRegistryEntry(embedded, overridden, version, proxy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProtocolSupported(long window) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -715,6 +722,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMessageType(XClientMessageEvent xclient) {
|
||||
long messageType = xclient.get_message_type();
|
||||
|
||||
@ -731,6 +739,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean processClientMessageImpl(XClientMessageEvent xclient) {
|
||||
long messageType = xclient.get_message_type();
|
||||
|
||||
@ -747,6 +756,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendEnterMessageToToplevel(long toplevel,
|
||||
XClientMessageEvent xclient) {
|
||||
/* flags */
|
||||
@ -785,6 +795,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sendLeaveMessageToToplevel(long toplevel,
|
||||
XClientMessageEvent xclient) {
|
||||
sendLeaveMessageToToplevelImpl(toplevel, xclient.get_data(0));
|
||||
@ -809,6 +820,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendResponse(long ctxt, int eventID, int action) {
|
||||
XClientMessageEvent xclient = new XClientMessageEvent(ctxt);
|
||||
|
||||
@ -858,6 +870,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getData(long ctxt, long format)
|
||||
throws IllegalArgumentException, IOException {
|
||||
XClientMessageEvent xclient = new XClientMessageEvent(ctxt);
|
||||
@ -879,6 +892,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return XDnDConstants.XDnDSelection.getData(format, time_stamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendDropDone(long ctxt, boolean success, int dropAction) {
|
||||
XClientMessageEvent xclient = new XClientMessageEvent(ctxt);
|
||||
|
||||
@ -963,6 +977,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long getSourceWindow() {
|
||||
return sourceWindow;
|
||||
}
|
||||
@ -970,6 +985,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
/**
|
||||
* Reset the state of the object.
|
||||
*/
|
||||
@Override
|
||||
public void cleanup() {
|
||||
// Clear the reference to this protocol.
|
||||
XDropTargetEventProcessor.reset();
|
||||
@ -1004,10 +1020,12 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
targetXWindow = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDragOverComponent() {
|
||||
return targetXWindow != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustEventForForwarding(XClientMessageEvent xclient,
|
||||
EmbedderRegistryEntry entry) {
|
||||
/* Adjust the event to match the XDnD protocol version. */
|
||||
@ -1077,6 +1095,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
* dispatch thread.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean forwardEventToEmbedded(long embedded, long ctxt,
|
||||
int eventID) {
|
||||
if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
|
||||
@ -1225,6 +1244,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isXEmbedSupported() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -114,6 +114,7 @@ public final class XDragSourceContextPeer
|
||||
return theInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startDrag(Transferable transferable,
|
||||
long[] formats, Map<Long, DataFlavor> formatMap) {
|
||||
Component component = getTrigger().getComponent();
|
||||
@ -256,6 +257,7 @@ public final class XDragSourceContextPeer
|
||||
* set cursor
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void setCursor(Cursor c) throws InvalidDnDOperationException {
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
@ -265,6 +267,7 @@ public final class XDragSourceContextPeer
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setNativeCursor(long nativeCtxt, Cursor c, int cType) {
|
||||
assert XToolkit.isAWTLockHeldByCurrentThread();
|
||||
|
||||
@ -304,6 +307,7 @@ public final class XDragSourceContextPeer
|
||||
/**
|
||||
* The caller must own awtLock.
|
||||
*/
|
||||
@Override
|
||||
public void cleanup(long time) {
|
||||
if (dndInProgress) {
|
||||
if (dragProtocol != null) {
|
||||
@ -794,18 +798,21 @@ public final class XDragSourceContextPeer
|
||||
|
||||
/* XDragSourceProtocolListener implementation */
|
||||
|
||||
@Override
|
||||
public void handleDragReply(int action) {
|
||||
// NOTE: we have to use the current pointer location, since
|
||||
// the target didn't specify the coordinates for the reply.
|
||||
handleDragReply(action, xRoot, yRoot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDragReply(int action, int x, int y) {
|
||||
// NOTE: we have to use the current modifiers state, since
|
||||
// the target didn't specify the modifiers state for the reply.
|
||||
handleDragReply(action, xRoot, yRoot, XWindow.getModifiers(eventState,0,0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDragReply(int action, int x, int y, int modifiers) {
|
||||
if (action == DnDConstants.ACTION_NONE &&
|
||||
targetAction != DnDConstants.ACTION_NONE) {
|
||||
@ -826,23 +833,27 @@ public final class XDragSourceContextPeer
|
||||
targetAction = action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDragFinished() {
|
||||
/* Assume that the drop was successful. */
|
||||
handleDragFinished(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDragFinished(boolean success) {
|
||||
/* Assume that the performed drop action is the latest drop action
|
||||
accepted by the drop target. */
|
||||
handleDragFinished(true, targetAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDragFinished(boolean success, int action) {
|
||||
// NOTE: we have to use the current pointer location, since
|
||||
// the target didn't specify the coordinates for the reply.
|
||||
handleDragFinished(success, action, xRoot, yRoot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDragFinished(boolean success, int action, int x, int y) {
|
||||
dragDropFinished(success, action, x, y);
|
||||
|
||||
|
||||
@ -241,7 +241,7 @@ abstract class XDragSourceProtocol {
|
||||
return targetProtocolVersion;
|
||||
}
|
||||
|
||||
public static class TargetWindowInfo {
|
||||
public static final class TargetWindowInfo {
|
||||
private final long proxyWindow;
|
||||
private final int protocolVersion;
|
||||
public TargetWindowInfo(long proxy, int version) {
|
||||
|
||||
@ -82,6 +82,7 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||
/*
|
||||
* @param returnValue the drop action selected by the Java drop target.
|
||||
*/
|
||||
@Override
|
||||
protected void eventProcessed(SunDropTargetEvent e, int returnValue,
|
||||
boolean dispatcherDone) {
|
||||
/* The native context is the pointer to the XClientMessageEvent
|
||||
@ -109,6 +110,7 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doDropDone(boolean success, int dropAction,
|
||||
boolean isLocal) {
|
||||
/* The native context is the pointer to the XClientMessageEvent
|
||||
@ -134,6 +136,7 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object getNativeData(long format)
|
||||
throws IOException {
|
||||
/* The native context is the pointer to the XClientMessageEvent
|
||||
@ -161,18 +164,21 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||
private void cleanup() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processEnterMessage(SunDropTargetEvent event) {
|
||||
if (!processSunDropTargetEvent(event)) {
|
||||
super.processEnterMessage(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processExitMessage(SunDropTargetEvent event) {
|
||||
if (!processSunDropTargetEvent(event)) {
|
||||
super.processExitMessage(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processMotionMessage(SunDropTargetEvent event,
|
||||
boolean operationChanged) {
|
||||
if (!processSunDropTargetEvent(event)) {
|
||||
@ -180,6 +186,7 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processDropMessage(SunDropTargetEvent event) {
|
||||
if (!processSunDropTargetEvent(event)) {
|
||||
super.processDropMessage(event);
|
||||
@ -247,6 +254,7 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||
return theInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDropTargetNotification(XWindow xwindow, int x, int y,
|
||||
int dropAction, int actions,
|
||||
long[] formats, long nativeCtxt,
|
||||
|
||||
@ -35,7 +35,7 @@ import sun.util.logging.PlatformLogger;
|
||||
import java.util.*;
|
||||
import static sun.awt.X11.XEmbedHelper.*;
|
||||
|
||||
public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener, KeyEventPostProcessor, ModalityListener, WindowIDProvider {
|
||||
public final class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener, KeyEventPostProcessor, ModalityListener, WindowIDProvider {
|
||||
private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed.XEmbedCanvasPeer");
|
||||
|
||||
boolean applicationActive; // Whether the application is active(has focus)
|
||||
@ -56,6 +56,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
super(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
|
||||
@ -68,6 +69,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
target.setFocusTraversalKeysEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
|
||||
@ -168,6 +170,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
xembed.handle = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(AWTEvent e) {
|
||||
super.handleEvent(e);
|
||||
if (isXEmbedActive()) {
|
||||
@ -188,6 +191,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchEvent(XEvent ev) {
|
||||
super.dispatchEvent(ev);
|
||||
switch (ev.get_type()) {
|
||||
@ -233,6 +237,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
if (isXEmbedActive()) {
|
||||
XToolkit.awtLock();
|
||||
@ -250,6 +255,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
return super.getPreferredSize();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
if (isXEmbedActive()) {
|
||||
XToolkit.awtLock();
|
||||
@ -267,6 +273,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
return super.getMinimumSize();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (isXEmbedActive()) {
|
||||
detachChild();
|
||||
@ -282,6 +289,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
|
||||
// Focusable is true in order to enable focus traversal through this Canvas
|
||||
@Override
|
||||
public boolean isFocusable() {
|
||||
return true;
|
||||
}
|
||||
@ -407,6 +415,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
xembed.handle = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowGainedFocus(WindowEvent e) {
|
||||
applicationActive = true;
|
||||
if (isXEmbedActive()) {
|
||||
@ -415,6 +424,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowLostFocus(WindowEvent e) {
|
||||
applicationActive = false;
|
||||
if (isXEmbedActive()) {
|
||||
@ -577,6 +587,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean postProcessKeyEvent(KeyEvent e) {
|
||||
// Processing events only if we are in the focused window but
|
||||
// we are not focus owner since otherwise we will get
|
||||
@ -632,14 +643,17 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modalityPushed(ModalityEvent ev) {
|
||||
xembed.sendMessage(xembed.handle, XEMBED_MODALITY_ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modalityPopped(ModalityEvent ev) {
|
||||
xembed.sendMessage(xembed.handle, XEMBED_MODALITY_OFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClientMessage(XEvent xev) {
|
||||
super.handleClientMessage(xev);
|
||||
XClientMessageEvent msg = xev.get_xclient();
|
||||
@ -681,7 +695,8 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
private static class XEmbedDropTarget extends DropTarget {
|
||||
private static final class XEmbedDropTarget extends DropTarget {
|
||||
@Override
|
||||
public void addDropTargetListener(DropTargetListener dtl)
|
||||
throws TooManyListenersException {
|
||||
// Drop target listeners registered with this target will never be
|
||||
@ -730,7 +745,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
}
|
||||
|
||||
class XEmbedServer extends XEmbedHelper implements XEventDispatcher {
|
||||
final class XEmbedServer extends XEmbedHelper implements XEventDispatcher {
|
||||
long handle; // Handle to XEmbed client
|
||||
long version;
|
||||
long flags;
|
||||
@ -814,6 +829,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void dispatchEvent(XEvent xev) {
|
||||
int type = xev.get_type();
|
||||
switch (type) {
|
||||
@ -830,7 +846,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
}
|
||||
|
||||
static class GrabbedKey {
|
||||
static final class GrabbedKey {
|
||||
long keysym;
|
||||
long modifiers;
|
||||
GrabbedKey(long keysym, long modifiers) {
|
||||
@ -867,10 +883,12 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int)keysym & 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof GrabbedKey)) {
|
||||
return false;
|
||||
@ -879,6 +897,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
|
||||
return (keysym == key.keysym && modifiers == key.modifiers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Key combination[keysym=" + keysym + ", mods=" + modifiers + "]";
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ import java.awt.Toolkit;
|
||||
import sun.awt.AWTAccessor;
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
public class XEmbedChildProxy extends Component {
|
||||
public final class XEmbedChildProxy extends Component {
|
||||
long handle;
|
||||
XEmbeddingContainer container;
|
||||
public XEmbedChildProxy(XEmbeddingContainer container, long handle) {
|
||||
@ -38,6 +38,7 @@ public class XEmbedChildProxy extends Component {
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotify() {
|
||||
synchronized(getTreeLock()) {
|
||||
if (AWTAccessor.getComponentAccessor().getPeer(this) == null) {
|
||||
|
||||
@ -54,7 +54,7 @@ import java.awt.peer.ContainerPeer;
|
||||
|
||||
import sun.java2d.pipe.Region;
|
||||
|
||||
public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
public final class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
XEmbeddingContainer container;
|
||||
XEmbedChildProxy proxy;
|
||||
long handle;
|
||||
@ -77,8 +77,11 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
}
|
||||
container.notifyChildEmbedded(handle);
|
||||
}
|
||||
@Override
|
||||
public boolean isObscured() { return false; }
|
||||
@Override
|
||||
public boolean canDetermineObscurity() { return false; }
|
||||
@Override
|
||||
public void setVisible(boolean b) {
|
||||
if (!b) {
|
||||
XToolkit.awtLock();
|
||||
@ -98,9 +101,13 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void setEnabled(boolean b) {}
|
||||
@Override
|
||||
public void paint(Graphics g) {}
|
||||
@Override
|
||||
public void print(Graphics g) {}
|
||||
@Override
|
||||
public void setBounds(int x, int y, int width, int height, int op) {
|
||||
// Unimplemented: Check for min/max hints for non-resizable
|
||||
XToolkit.awtLock();
|
||||
@ -111,6 +118,7 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
XToolkit.awtUnlock();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void handleEvent(AWTEvent e) {
|
||||
switch (e.getID()) {
|
||||
case FocusEvent.FOCUS_GAINED:
|
||||
@ -129,7 +137,9 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void coalescePaintEvent(PaintEvent e) {}
|
||||
@Override
|
||||
public Point getLocationOnScreen() {
|
||||
XWindowAttributes attr = new XWindowAttributes();
|
||||
XToolkit.awtLock();
|
||||
@ -141,6 +151,7 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
attr.dispose();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
XToolkit.awtLock();
|
||||
long p_hints = XlibWrapper.XAllocSizeHints();
|
||||
@ -154,6 +165,7 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
XToolkit.awtUnlock();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
XToolkit.awtLock();
|
||||
long p_hints = XlibWrapper.XAllocSizeHints();
|
||||
@ -167,17 +179,25 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
XToolkit.awtUnlock();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ColorModel getColorModel() { return null; }
|
||||
public Toolkit getToolkit() { return Toolkit.getDefaultToolkit(); }
|
||||
|
||||
@Override
|
||||
public Graphics getGraphics() { return null; }
|
||||
@Override
|
||||
public FontMetrics getFontMetrics(Font font) { return null; }
|
||||
@Override
|
||||
public void dispose() {
|
||||
container.detachChild(handle);
|
||||
}
|
||||
@Override
|
||||
public void setForeground(Color c) {}
|
||||
@Override
|
||||
public void setBackground(Color c) {}
|
||||
@Override
|
||||
public void setFont(Font f) {}
|
||||
@Override
|
||||
public void updateCursorImmediately() {}
|
||||
|
||||
void postEvent(AWTEvent event) {
|
||||
@ -209,6 +229,7 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requestFocus(Component lightweightChild,
|
||||
boolean temporary,
|
||||
boolean focusedWindowChangeAllowed,
|
||||
@ -263,18 +284,27 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isFocusable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image createImage(int width, int height) { return null; }
|
||||
@Override
|
||||
public VolatileImage createVolatileImage(int width, int height) { return null; }
|
||||
@Override
|
||||
public GraphicsConfiguration getGraphicsConfiguration() { return null; }
|
||||
@Override
|
||||
public boolean handlesWheelScrolling() { return true; }
|
||||
@Override
|
||||
public void createBuffers(int numBuffers, BufferCapabilities caps)
|
||||
throws AWTException { }
|
||||
@Override
|
||||
public Image getBackBuffer() { return null; }
|
||||
@Override
|
||||
public void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction) { }
|
||||
@Override
|
||||
public void destroyBuffers() { }
|
||||
|
||||
/**
|
||||
@ -282,6 +312,7 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
* its sub-elements. For instance, a lightweight Checkbox needs to layout
|
||||
* the box, as well as the text label.
|
||||
*/
|
||||
@Override
|
||||
public void layout() {}
|
||||
|
||||
Window getTopLevel(Component comp) {
|
||||
@ -310,6 +341,7 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
void handleConfigureNotify(XEvent xev) {
|
||||
childResized();
|
||||
}
|
||||
@Override
|
||||
public void dispatchEvent(XEvent xev) {
|
||||
int type = xev.get_type();
|
||||
switch (type) {
|
||||
@ -330,8 +362,10 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
}));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reparent(ContainerPeer newNativeParent) {
|
||||
}
|
||||
@Override
|
||||
public boolean isReparentSupported() {
|
||||
return false;
|
||||
}
|
||||
@ -349,12 +383,15 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
|
||||
public void setBoundsOperation(int operation) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyShape(Region shape) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setZOrder(ComponentPeer above) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateGraphicsData(GraphicsConfiguration gc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ import sun.awt.X11GraphicsDevice;
|
||||
* Window which wants to participate in a protocol should create an instance,
|
||||
* call install and forward all XClientMessageEvents to it.
|
||||
*/
|
||||
public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher {
|
||||
public final class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher {
|
||||
private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed.XEmbedClientHelper");
|
||||
|
||||
private XEmbeddedFramePeer embedded; // XEmbed client
|
||||
@ -164,6 +164,7 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchEvent(XEvent xev) {
|
||||
switch(xev.get_type()) {
|
||||
case XConstants.ClientMessage:
|
||||
|
||||
@ -36,7 +36,7 @@ import java.util.LinkedList;
|
||||
* Test XEmbed server implementation. See file:///home/dom/bugs/4931668/test_plan.html for
|
||||
* specification and references.
|
||||
*/
|
||||
public class XEmbedServerTester implements XEventDispatcher {
|
||||
public final class XEmbedServerTester implements XEventDispatcher {
|
||||
private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed.XEmbedServerTester");
|
||||
private final Object EVENT_LOCK = new Object();
|
||||
static final int SYSTEM_EVENT_MASK = 0x8000;
|
||||
@ -647,6 +647,7 @@ public class XEmbedServerTester implements XEventDispatcher {
|
||||
xembed.sendMessage(parent, message, detail, data1, data2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchEvent(XEvent ev) {
|
||||
if (ev.get_type() == ClientMessage) {
|
||||
XClientMessageEvent msg = ev.get_xclient();
|
||||
|
||||
@ -66,6 +66,7 @@ public class XEmbeddedFrame extends EmbeddedFrame {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotify()
|
||||
{
|
||||
if (!isDisplayable()) {
|
||||
@ -82,6 +83,7 @@ public class XEmbeddedFrame extends EmbeddedFrame {
|
||||
/*
|
||||
* The method shouldn't be called in case of active XEmbed.
|
||||
*/
|
||||
@Override
|
||||
public boolean traverseIn(boolean direction) {
|
||||
XEmbeddedFramePeer peer = AWTAccessor.getComponentAccessor()
|
||||
.getPeer(this);
|
||||
@ -95,6 +97,7 @@ public class XEmbeddedFrame extends EmbeddedFrame {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean traverseOut(boolean direction) {
|
||||
XEmbeddedFramePeer xefp = AWTAccessor.getComponentAccessor()
|
||||
.getPeer(this);
|
||||
@ -110,6 +113,7 @@ public class XEmbeddedFrame extends EmbeddedFrame {
|
||||
/*
|
||||
* The method shouldn't be called in case of active XEmbed.
|
||||
*/
|
||||
@Override
|
||||
public void synthesizeWindowActivation(boolean doActivate) {
|
||||
XEmbeddedFramePeer peer = AWTAccessor.getComponentAccessor()
|
||||
.getPeer(this);
|
||||
@ -122,6 +126,7 @@ public class XEmbeddedFrame extends EmbeddedFrame {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerAccelerator(AWTKeyStroke stroke) {
|
||||
XEmbeddedFramePeer xefp = AWTAccessor.getComponentAccessor()
|
||||
.getPeer(this);
|
||||
@ -130,6 +135,7 @@ public class XEmbeddedFrame extends EmbeddedFrame {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterAccelerator(AWTKeyStroke stroke) {
|
||||
XEmbeddedFramePeer xefp = AWTAccessor.getComponentAccessor()
|
||||
.getPeer(this);
|
||||
|
||||
@ -36,7 +36,7 @@ import sun.awt.SunToolkit;
|
||||
|
||||
import static sun.awt.X11.XConstants.*;
|
||||
|
||||
public class XEmbeddedFramePeer extends XFramePeer {
|
||||
public final class XEmbeddedFramePeer extends XFramePeer {
|
||||
|
||||
private static final PlatformLogger xembedLog = PlatformLogger.getLogger("sun.awt.X11.xembed.XEmbeddedFramePeer");
|
||||
|
||||
@ -53,6 +53,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
EMBEDDED, Boolean.TRUE}));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
strokes = new ArrayList<>();
|
||||
@ -60,6 +61,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
embedder = new XEmbedClientHelper();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
if (embedder != null) {
|
||||
@ -89,9 +91,11 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMinimumSize() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getWMName() {
|
||||
return "JavaEmbeddedFrame";
|
||||
}
|
||||
@ -104,6 +108,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
return ((EmbeddedFrame)target).supportsXEmbed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requestWindowFocus(long time, boolean timeProvided) {
|
||||
// Should check for active state of host application
|
||||
if (embedder != null && embedder.isActive()) {
|
||||
@ -115,6 +120,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void requestInitialFocus() {
|
||||
if (embedder != null && supportsXEmbed()) {
|
||||
embedder.requestFocus();
|
||||
@ -123,6 +129,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEventDisabled(XEvent e) {
|
||||
if (embedder != null && embedder.isActive()) {
|
||||
switch (e.get_type()) {
|
||||
@ -134,6 +141,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
return super.isEventDisabled(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleConfigureNotifyEvent(XEvent xev)
|
||||
{
|
||||
assert (SunToolkit.isAWTLockHeldByCurrentThread());
|
||||
@ -187,6 +195,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
}
|
||||
|
||||
// don't use getLocationOnScreen() inherited from XDecoratedPeer
|
||||
@Override
|
||||
public Point getLocationOnScreen() {
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
@ -197,14 +206,17 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
}
|
||||
|
||||
// don't use getBounds() inherited from XDecoratedPeer
|
||||
@Override
|
||||
public Rectangle getBounds() {
|
||||
return new Rectangle(x, y, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoundsPrivate(int x, int y, int width, int height) {
|
||||
setBounds(x, y, width, height, SET_BOUNDS | NO_EMBEDDED_CHECK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle getBoundsPrivate() {
|
||||
int x = 0, y = 0;
|
||||
int w = 0, h = 0;
|
||||
@ -262,6 +274,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
long getFocusTargetWindow() {
|
||||
return getWindow();
|
||||
}
|
||||
@ -270,6 +283,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
return embedder != null && embedder.isActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAbsoluteX()
|
||||
{
|
||||
Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
|
||||
@ -278,6 +292,7 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
return absoluteLoc != null ? absoluteLoc.x : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAbsoluteY()
|
||||
{
|
||||
Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
|
||||
@ -286,19 +301,23 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
return absoluteLoc != null ? absoluteLoc.y : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getSize() {
|
||||
return new Dimension(width, height);
|
||||
}
|
||||
|
||||
// override XWindowPeer's method to let the embedded frame to block
|
||||
// the containing window
|
||||
@Override
|
||||
public void setModalBlocked(Dialog blocker, boolean blocked) {
|
||||
super.setModalBlocked(blocker, blocked);
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ import java.util.HashMap;
|
||||
import java.awt.event.KeyEvent;
|
||||
import sun.awt.AWTAccessor;
|
||||
|
||||
public class XEmbeddingContainer extends XEmbedHelper implements XEventDispatcher {
|
||||
public final class XEmbeddingContainer extends XEmbedHelper implements XEventDispatcher {
|
||||
HashMap<Long, java.awt.peer.ComponentPeer> children = new HashMap<>();
|
||||
|
||||
XEmbeddingContainer() {
|
||||
@ -120,6 +120,7 @@ public class XEmbeddingContainer extends XEmbedHelper implements XEventDispatche
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void dispatchEvent(XEvent xev) {
|
||||
switch(xev.get_type()) {
|
||||
case XConstants.ClientMessage:
|
||||
|
||||
@ -47,7 +47,7 @@ public abstract class XErrorHandler {
|
||||
* but temporary install this function as the error handler to ignore
|
||||
* BadWindow error.
|
||||
*/
|
||||
public static class IgnoreBadWindowHandler extends XBaseErrorHandler {
|
||||
public static final class IgnoreBadWindowHandler extends XBaseErrorHandler {
|
||||
@Override
|
||||
public int handleError(long display, XErrorEvent err) {
|
||||
if (err.get_error_code() == XConstants.BadWindow) {
|
||||
@ -62,7 +62,7 @@ public abstract class XErrorHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static class VerifyChangePropertyHandler extends XBaseErrorHandler {
|
||||
public static final class VerifyChangePropertyHandler extends XBaseErrorHandler {
|
||||
@Override
|
||||
public int handleError(long display, XErrorEvent err) {
|
||||
if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
|
||||
|
||||
@ -31,7 +31,7 @@ package sun.awt.X11;
|
||||
* @since 1.5
|
||||
*/
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
public class XException extends RuntimeException {
|
||||
public final class XException extends RuntimeException {
|
||||
public XException() {
|
||||
super();
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ import sun.awt.AWTAccessor.ComponentAccessor;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
import sun.awt.AWTAccessor;
|
||||
|
||||
class XFileDialogPeer extends XDialogPeer
|
||||
final class XFileDialogPeer extends XDialogPeer
|
||||
implements FileDialogPeer, ActionListener, ItemListener,
|
||||
KeyEventDispatcher, XChoicePeerListener {
|
||||
|
||||
@ -313,9 +313,11 @@ class XFileDialogPeer extends XDialogPeer
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMinimumSize() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateIconImages() {
|
||||
if (winAttr.icons == null){
|
||||
winAttr.iconsInherited = false;
|
||||
@ -544,6 +546,7 @@ class XFileDialogPeer extends XDialogPeer
|
||||
* @see java.awt.event.ItemEvent
|
||||
* ItemEvent.ITEM_STATE_CHANGED
|
||||
*/
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent itemEvent){
|
||||
if (itemEvent.getID() != ItemEvent.ITEM_STATE_CHANGED ||
|
||||
itemEvent.getStateChange() == ItemEvent.DESELECTED) {
|
||||
@ -603,6 +606,7 @@ class XFileDialogPeer extends XDialogPeer
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed( ActionEvent actionEvent ) {
|
||||
String actionCommand = actionEvent.getActionCommand();
|
||||
Object source = actionEvent.getSource();
|
||||
@ -639,6 +643,7 @@ class XFileDialogPeer extends XDialogPeer
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
|
||||
int id = keyEvent.getID();
|
||||
int keyCode = keyEvent.getKeyCode();
|
||||
@ -673,6 +678,7 @@ class XFileDialogPeer extends XDialogPeer
|
||||
/**
|
||||
* set the file
|
||||
*/
|
||||
@Override
|
||||
public void setFile(String file) {
|
||||
|
||||
if (file == null) {
|
||||
@ -706,6 +712,7 @@ class XFileDialogPeer extends XDialogPeer
|
||||
* since 'setDirectory' will be ignored
|
||||
* We can't update savedDir here now since it used very often
|
||||
*/
|
||||
@Override
|
||||
public void setDirectory(String dir) {
|
||||
|
||||
if (dir == null) {
|
||||
@ -763,11 +770,13 @@ class XFileDialogPeer extends XDialogPeer
|
||||
* set filenameFilter
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void setFilenameFilter(FilenameFilter filter) {
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
FileDialog fd = (FileDialog)fileDialog;
|
||||
if (fd != null) {
|
||||
@ -777,6 +786,7 @@ class XFileDialogPeer extends XDialogPeer
|
||||
}
|
||||
|
||||
// 03/02/2005 b5097243 Pressing 'ESC' on a file dlg does not dispose the dlg on Xtoolkit
|
||||
@Override
|
||||
public void setVisible(boolean b){
|
||||
if (fileDialog == null) {
|
||||
init(target);
|
||||
@ -823,6 +833,7 @@ class XFileDialogPeer extends XDialogPeer
|
||||
* Refresh the unfurled choice at the time of the opening choice according to the text of the path field
|
||||
* See 6240074 for more information
|
||||
*/
|
||||
@Override
|
||||
public void unfurledChoiceOpening(ListHelper choiceHelper){
|
||||
|
||||
// When the unfurled choice is opening the first time, we need only to add elements, otherwise we've got exception
|
||||
@ -843,6 +854,7 @@ class XFileDialogPeer extends XDialogPeer
|
||||
* Refresh the file dialog at the time of the closing choice according to the selected item of the choice
|
||||
* See 6240074 for more information
|
||||
*/
|
||||
@Override
|
||||
public void unfurledChoiceClosing(){
|
||||
// This is the exactly same code as invoking later at the time of the itemStateChanged
|
||||
// Here is we restore Windows behaviour: change current directory if user press 'ESC'
|
||||
@ -852,7 +864,7 @@ class XFileDialogPeer extends XDialogPeer
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
class Separator extends Canvas {
|
||||
final class Separator extends Canvas {
|
||||
public static final int HORIZONTAL = 0;
|
||||
public static final int VERTICAL = 1;
|
||||
int orientation;
|
||||
@ -869,6 +881,7 @@ class Separator extends Canvas {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void paint(Graphics g) {
|
||||
int x1, y1, x2, y2;
|
||||
@ -903,7 +916,7 @@ class Separator extends Canvas {
|
||||
* are displayed in the dialog. This filter is generally specified as a regular
|
||||
* expression. The class is used to implement Motif-like filtering.
|
||||
*/
|
||||
class FileDialogFilter implements FilenameFilter {
|
||||
final class FileDialogFilter implements FilenameFilter {
|
||||
|
||||
String filter;
|
||||
|
||||
@ -914,6 +927,7 @@ class FileDialogFilter implements FilenameFilter {
|
||||
/*
|
||||
* Tells whether or not the specified file should be included in a file list
|
||||
*/
|
||||
@Override
|
||||
public boolean accept(File dir, String fileName) {
|
||||
|
||||
File f = new File(dir, fileName);
|
||||
|
||||
@ -32,7 +32,7 @@ import java.awt.*;
|
||||
* it instead sets focus to this proxy. This proxy is mapped but invisible(it is kept at (-1,-1))
|
||||
* and therefore X doesn't control focus after we have set it to proxy.
|
||||
*/
|
||||
public class XFocusProxyWindow extends XBaseWindow {
|
||||
public final class XFocusProxyWindow extends XBaseWindow {
|
||||
XWindowPeer owner;
|
||||
|
||||
public XFocusProxyWindow(XWindowPeer owner) {
|
||||
@ -45,12 +45,14 @@ public class XFocusProxyWindow extends XBaseWindow {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(XCreateWindowParams params){
|
||||
super.postInit(params);
|
||||
setWMClass(getWMClass());
|
||||
xSetVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getWMName() {
|
||||
return "FocusProxy";
|
||||
}
|
||||
@ -62,6 +64,7 @@ public class XFocusProxyWindow extends XBaseWindow {
|
||||
return owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchEvent(XEvent ev) {
|
||||
int type = ev.get_type();
|
||||
switch (type)
|
||||
@ -78,10 +81,12 @@ public class XFocusProxyWindow extends XBaseWindow {
|
||||
owner.handleFocusEvent(xev);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleKeyPress(XEvent xev) {
|
||||
owner.handleKeyPress(xev);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleKeyRelease(XEvent xev) {
|
||||
owner.handleKeyRelease(xev);
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ final class XFontPeer extends PlatformFont {
|
||||
super(name, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected char getMissingGlyphCharacter() {
|
||||
return '\u274F';
|
||||
}
|
||||
|
||||
@ -59,6 +59,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
super(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
Frame target = (Frame)(this.target);
|
||||
@ -111,6 +112,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
return decorations;
|
||||
}
|
||||
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
setupState(true);
|
||||
@ -137,6 +139,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
setExtendedState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMenuBar(MenuBar mb) {
|
||||
// state_lock should always be the second after awt_lock
|
||||
XToolkit.awtLock();
|
||||
@ -170,6 +173,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
return menubarPeer;
|
||||
}
|
||||
|
||||
@Override
|
||||
int getMenuBarHeight() {
|
||||
if (menubarPeer != null) {
|
||||
return menubarPeer.getDesiredHeight();
|
||||
@ -178,6 +182,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void updateChildrenSizes() {
|
||||
super.updateChildrenSizes();
|
||||
int height = getMenuBarHeight();
|
||||
@ -238,6 +243,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaximizedBounds(Rectangle b) {
|
||||
if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
insLog.fine("Setting maximized bounds to " + b);
|
||||
@ -267,12 +273,14 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getState() {
|
||||
synchronized(getStateLock()) {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setState(int newState) {
|
||||
synchronized(getStateLock()) {
|
||||
if (!isShowing()) {
|
||||
@ -336,6 +344,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
super.toFront();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePropertyNotify(XEvent xev) {
|
||||
super.handlePropertyNotify(xev);
|
||||
XPropertyEvent ev = xev.get_xproperty();
|
||||
@ -389,6 +398,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
|
||||
// NOTE: This method may be called by privileged threads.
|
||||
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
|
||||
@Override
|
||||
public void handleStateChange(int oldState, int newState) {
|
||||
super.handleStateChange(oldState, newState);
|
||||
for (ToplevelStateListener topLevelListenerTmp : toplevelStateListeners) {
|
||||
@ -396,6 +406,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean vis) {
|
||||
if (vis) {
|
||||
setupState(false);
|
||||
@ -426,6 +437,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (menubarPeer != null) {
|
||||
menubarPeer.dispose();
|
||||
@ -433,6 +445,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isMaximized() {
|
||||
return (state & (Frame.MAXIMIZED_VERT | Frame.MAXIMIZED_HORIZ)) != 0;
|
||||
}
|
||||
@ -481,6 +494,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
* of Component (and thus it has no "print" method which gets called by
|
||||
* default).
|
||||
*/
|
||||
@Override
|
||||
public void print(Graphics g) {
|
||||
super.print(g);
|
||||
|
||||
@ -703,14 +717,17 @@ class XFramePeer extends XDecoratedPeer implements FramePeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoundsPrivate(int x, int y, int width, int height) {
|
||||
setBounds(x, y, width, height, SET_BOUNDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle getBoundsPrivate() {
|
||||
return getBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void emulateActivation(boolean doActivate) {
|
||||
if (doActivate) {
|
||||
handleWindowFocusIn(0);
|
||||
|
||||
@ -61,6 +61,7 @@ public final class XGlobalCursorManager extends GlobalCursorManager {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void setCursor(Component comp, Cursor cursor, boolean useCache) {
|
||||
if (comp == null) {
|
||||
return;
|
||||
@ -108,6 +109,7 @@ public final class XGlobalCursorManager extends GlobalCursorManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateCursorOutOfJava() {
|
||||
// in case we have grabbed input for Swing we need to reset cursor
|
||||
// when mouse pointer is out of any java toplevel.
|
||||
@ -115,6 +117,7 @@ public final class XGlobalCursorManager extends GlobalCursorManager {
|
||||
updateGrabbedCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCursorPos(Point p) {
|
||||
|
||||
if (!((XToolkit)Toolkit.getDefaultToolkit()).getLastCursorPos(p)) {
|
||||
@ -147,10 +150,12 @@ public final class XGlobalCursorManager extends GlobalCursorManager {
|
||||
/*
|
||||
* native method to call corresponding methods in Component
|
||||
*/
|
||||
@Override
|
||||
protected Point getLocationOnScreen(Component c) {
|
||||
return c.getLocationOnScreen();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component findHeavyweightUnderCursor(boolean useCache) {
|
||||
return findHeavyweightUnderCursor();
|
||||
}
|
||||
|
||||
@ -31,12 +31,13 @@ import java.awt.*;
|
||||
* A simple horizontal scroll bar. The scrollbar is made horizontal
|
||||
* by taking a vertical scrollbar and swapping the x and y coordinates.
|
||||
*/
|
||||
class XHorizontalScrollbar extends XScrollbar {
|
||||
final class XHorizontalScrollbar extends XScrollbar {
|
||||
|
||||
public XHorizontalScrollbar(XScrollbarClient sb) {
|
||||
super(ALIGNMENT_HORIZONTAL, sb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(int width, int height) {
|
||||
super.setSize(width, height);
|
||||
this.barWidth = height;
|
||||
@ -44,16 +45,19 @@ class XHorizontalScrollbar extends XScrollbar {
|
||||
calculateArrowWidth();
|
||||
rebuildArrows();
|
||||
}
|
||||
@Override
|
||||
protected void rebuildArrows() {
|
||||
firstArrow = createArrowShape(false, true);
|
||||
secondArrow = createArrowShape(false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean beforeThumb(int x, int y) {
|
||||
Rectangle pos = calculateThumbRect();
|
||||
return (x < pos.x);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Rectangle getThumbArea() {
|
||||
return new Rectangle(getArrowAreaWidth(), 2, width - 2*getArrowAreaWidth(), height-4);
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ import sun.awt.image.ImageRepresentation;
|
||||
import sun.awt.image.ToolkitImage;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
public class XIconWindow extends XBaseWindow {
|
||||
public final class XIconWindow extends XBaseWindow {
|
||||
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XIconWindow");
|
||||
XDecoratedPeer parent;
|
||||
Dimension size;
|
||||
@ -60,6 +60,7 @@ public class XIconWindow extends XBaseWindow {
|
||||
DELAYED, Boolean.TRUE}));
|
||||
}
|
||||
|
||||
@Override
|
||||
void instantPreInit(XCreateWindowParams params) {
|
||||
super.instantPreInit(params);
|
||||
this.parent = (XDecoratedPeer)params.get(PARENT);
|
||||
|
||||
@ -42,17 +42,19 @@ import sun.util.logging.PlatformLogger;
|
||||
*
|
||||
* @author JavaSoft International
|
||||
*/
|
||||
public class XInputMethod extends X11InputMethod {
|
||||
public final class XInputMethod extends X11InputMethod {
|
||||
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XInputMethod");
|
||||
|
||||
public XInputMethod() throws AWTException {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInputMethodContext(InputMethodContext context) {
|
||||
context.enableClientWindowNotification(this, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyClientWindowChange(Rectangle location) {
|
||||
XComponentPeer peer = (XComponentPeer)getPeer(clientComponentWindow);
|
||||
if (peer != null) {
|
||||
@ -60,10 +62,12 @@ public class XInputMethod extends X11InputMethod {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean openXIM() {
|
||||
return openXIMNative(XToolkit.getDisplay());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean createXIC() {
|
||||
XComponentPeer peer = (XComponentPeer)getPeer(clientComponentWindow);
|
||||
if (peer == null) {
|
||||
@ -75,6 +79,7 @@ public class XInputMethod extends X11InputMethod {
|
||||
|
||||
private static volatile long xicFocus;
|
||||
|
||||
@Override
|
||||
protected void setXICFocus(ComponentPeer peer,
|
||||
boolean value, boolean active) {
|
||||
if (peer == null) {
|
||||
@ -93,6 +98,7 @@ public class XInputMethod extends X11InputMethod {
|
||||
/* XAWT_HACK FIX ME!
|
||||
do NOT call client code!
|
||||
*/
|
||||
@Override
|
||||
protected Container getParent(Component client) {
|
||||
return client.getParent();
|
||||
}
|
||||
@ -101,6 +107,7 @@ public class XInputMethod extends X11InputMethod {
|
||||
* Returns peer of the given client component. If the given client component
|
||||
* doesn't have peer, peer of the native container of the client is returned.
|
||||
*/
|
||||
@Override
|
||||
protected ComponentPeer getPeer(Component client) {
|
||||
XComponentPeer peer;
|
||||
|
||||
@ -126,15 +133,18 @@ public class XInputMethod extends X11InputMethod {
|
||||
* Subclasses should override disposeImpl() instead of dispose(). Client
|
||||
* code should always invoke dispose(), never disposeImpl().
|
||||
*/
|
||||
@Override
|
||||
protected synchronized void disposeImpl() {
|
||||
super.disposeImpl();
|
||||
clientComponentWindow = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void awtLock() {
|
||||
XToolkit.awtLock();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void awtUnlock() {
|
||||
XToolkit.awtUnlock();
|
||||
}
|
||||
|
||||
@ -29,11 +29,12 @@ package sun.awt.X11;
|
||||
import java.awt.im.spi.InputMethod;
|
||||
import sun.awt.X11InputMethodDescriptor;
|
||||
|
||||
class XInputMethodDescriptor extends X11InputMethodDescriptor {
|
||||
final class XInputMethodDescriptor extends X11InputMethodDescriptor {
|
||||
|
||||
/**
|
||||
* @see java.awt.im.spi.InputMethodDescriptor#createInputMethod
|
||||
*/
|
||||
@Override
|
||||
public InputMethod createInputMethod() throws Exception {
|
||||
return new XInputMethod();
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ import java.awt.event.FocusEvent;
|
||||
import sun.awt.KeyboardFocusManagerPeerImpl;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
|
||||
public final class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
|
||||
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XKeyboardFocusManagerPeer");
|
||||
private static final XKeyboardFocusManagerPeer inst = new XKeyboardFocusManagerPeer();
|
||||
|
||||
|
||||
@ -42,11 +42,11 @@ import jdk.internal.misc.Unsafe;
|
||||
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
public class XKeysym {
|
||||
public final class XKeysym {
|
||||
|
||||
private XKeysym() {}
|
||||
|
||||
static class Keysym2JavaKeycode {
|
||||
static final class Keysym2JavaKeycode {
|
||||
int jkeycode;
|
||||
int keyLocation;
|
||||
int getJavaKeycode() {
|
||||
|
||||
@ -28,7 +28,7 @@ package sun.awt.X11;
|
||||
import java.awt.*;
|
||||
import java.awt.peer.*;
|
||||
|
||||
class XLabelPeer extends XComponentPeer implements LabelPeer {
|
||||
final class XLabelPeer extends XComponentPeer implements LabelPeer {
|
||||
/**
|
||||
* Create the label
|
||||
*/
|
||||
@ -49,6 +49,7 @@ class XLabelPeer extends XComponentPeer implements LabelPeer {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
Label target = (Label) this.target;
|
||||
@ -66,6 +67,7 @@ class XLabelPeer extends XComponentPeer implements LabelPeer {
|
||||
/**
|
||||
* Minimum size.
|
||||
*/
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
FontMetrics fm = getFontMetrics();
|
||||
int w;
|
||||
|
||||
@ -33,7 +33,7 @@ import sun.awt.OverrideNativeWindowHandle;
|
||||
import sun.swing.JLightweightFrame;
|
||||
import sun.swing.SwingAccessor;
|
||||
|
||||
public class XLightweightFramePeer extends XFramePeer implements OverrideNativeWindowHandle {
|
||||
public final class XLightweightFramePeer extends XFramePeer implements OverrideNativeWindowHandle {
|
||||
|
||||
XLightweightFramePeer(LightweightFrame target) {
|
||||
super(target);
|
||||
|
||||
@ -38,7 +38,7 @@ import sun.util.logging.PlatformLogger;
|
||||
|
||||
// TODO: some input actions should do nothing if Shift or Control are down
|
||||
|
||||
class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
final class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
|
||||
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XListPeer");
|
||||
|
||||
@ -135,6 +135,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
/**
|
||||
* Overridden from XWindow
|
||||
*/
|
||||
@Override
|
||||
public void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
|
||||
@ -150,6 +151,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
fgColorSet = target.isForegroundSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
initFontMetrics();
|
||||
@ -212,27 +214,33 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
hsb.setValues(0, 0, 0, 0, HORIZ_SCROLL_AMT, HORIZ_SCROLL_AMT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(String item, int index) {
|
||||
addItem(item, index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAll() {
|
||||
clear();
|
||||
maxLength = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMultipleMode (boolean b) {
|
||||
setMultipleSelections(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return getMinimumSize(DEFAULT_VISIBLE_ROWS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize(int rows) {
|
||||
return getMinimumSize(rows);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize(int rows) {
|
||||
FontMetrics fm = getFontMetrics(getFont());
|
||||
initFontMetrics();
|
||||
@ -281,11 +289,13 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
return fm.stringWidth(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setForeground(Color c) {
|
||||
fgColorSet = true;
|
||||
super.setForeground(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBackground(Color c) {
|
||||
bgColorSet = true;
|
||||
super.setBackground(c);
|
||||
@ -341,6 +351,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
return Math.min(items.size()-1, itemsInWindow()-1);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void repaintScrollbarRequest(XScrollbar scrollbar) {
|
||||
if (scrollbar == hsb) {
|
||||
repaint(PAINT_HSCROLL);
|
||||
@ -352,6 +363,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
/**
|
||||
* Overridden for performance
|
||||
*/
|
||||
@Override
|
||||
public void repaint() {
|
||||
repaint(getFirstVisibleItem(), getLastVisibleItem(), PAINT_ALL);
|
||||
}
|
||||
@ -397,14 +409,17 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
void paintPeer(final Graphics g) {
|
||||
painter.paint(g, getFirstVisibleItem(), getLastVisibleItem(), PAINT_ALL);
|
||||
}
|
||||
@Override
|
||||
public boolean isFocusable() { return true; }
|
||||
|
||||
// TODO: share/promote the Focus methods?
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
super.focusGained(e);
|
||||
repaint(PAINT_FOCUS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
super.focusLost(e);
|
||||
repaint(PAINT_FOCUS);
|
||||
@ -414,6 +429,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
* Layout the sub-components of the List - that is, the scrollbars and the
|
||||
* list of items.
|
||||
*/
|
||||
@Override
|
||||
public void layout() {
|
||||
int vis, maximum;
|
||||
boolean vsbWasVisible;
|
||||
@ -520,15 +536,18 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
return focusRect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleConfigureNotifyEvent(XEvent xev) {
|
||||
super.handleConfigureNotifyEvent(xev);
|
||||
|
||||
// Update buffer
|
||||
painter.invalidate();
|
||||
}
|
||||
@Override
|
||||
public boolean handlesWheelScrolling() { return true; }
|
||||
|
||||
// FIXME: need to support MouseWheel scrolling, too
|
||||
@Override
|
||||
void handleJavaMouseEvent(MouseEvent e) {
|
||||
super.handleJavaMouseEvent(e);
|
||||
int i = e.getID();
|
||||
@ -545,6 +564,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void handleJavaMouseWheelEvent(MouseWheelEvent e) {
|
||||
if (ListHelper.doWheelScroll(vsbVis ? vsb : null,
|
||||
hsbVis ? hsb : null, e)) {
|
||||
@ -781,6 +801,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void handleJavaKeyEvent(KeyEvent e) {
|
||||
switch(e.getID()) {
|
||||
case KeyEvent.KEY_PRESSED:
|
||||
@ -978,6 +999,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
/**
|
||||
* return value from the scrollbar
|
||||
*/
|
||||
@Override
|
||||
public void notifyValue(XScrollbar obj, int type, int v, boolean isAdjusting) {
|
||||
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
@ -1097,6 +1119,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
* if s < 0 then s = 0
|
||||
* if e >= items.size() then e = items.size() - 1
|
||||
*/
|
||||
@Override
|
||||
public void delItems(int s, int e) {
|
||||
// save the current state of the scrollbars
|
||||
boolean hsbWasVisible = hsbVis;
|
||||
@ -1208,6 +1231,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
/**
|
||||
* ListPeer method
|
||||
*/
|
||||
@Override
|
||||
public void select(int index) {
|
||||
// Programmatic select() should also set the focus index
|
||||
setFocusIndex(index);
|
||||
@ -1266,6 +1290,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
* ListPeer method
|
||||
* focusedIndex isn't updated according to native (Window, Motif) behaviour
|
||||
*/
|
||||
@Override
|
||||
public void deselect(int index) {
|
||||
deselectItem(index);
|
||||
}
|
||||
@ -1301,6 +1326,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
* if necessary, or doing nothing if the item is already visible.
|
||||
* The List must be repainted for changes to be visible.
|
||||
*/
|
||||
@Override
|
||||
public void makeVisible(int index) {
|
||||
if (index < 0 || index >= items.size()) {
|
||||
return;
|
||||
@ -1337,6 +1363,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
/**
|
||||
* return the selected indexes
|
||||
*/
|
||||
@Override
|
||||
public int[] getSelectedIndexes() {
|
||||
return selected;
|
||||
}
|
||||
@ -1598,6 +1625,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
* Returns true if the event has been handled and should not be
|
||||
* posted to Java
|
||||
*/
|
||||
@Override
|
||||
boolean prePostEvent(final AWTEvent e) {
|
||||
if (e instanceof MouseEvent) {
|
||||
return prePostMouseEvent((MouseEvent)e);
|
||||
@ -1662,6 +1690,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
* The bug is due to incorrect caching of the list item size
|
||||
* So we should recalculate font metrics on setFont
|
||||
*/
|
||||
@Override
|
||||
public void setFont(Font f) {
|
||||
if (!Objects.equals(getFont(), f)) {
|
||||
super.setFont(f);
|
||||
@ -1678,7 +1707,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
|
||||
* Painter -> awtLock
|
||||
* Since we can't guarantee the sequence, use awtLock.
|
||||
*/
|
||||
class ListPainter {
|
||||
final class ListPainter {
|
||||
VolatileImage buffer;
|
||||
Color[] colors;
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ package sun.awt.X11;
|
||||
import java.util.*;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
public class XMSelection {
|
||||
public final class XMSelection {
|
||||
|
||||
/*
|
||||
* A method for a subsystem to express its interest in a certain
|
||||
|
||||
@ -32,7 +32,7 @@ import java.util.Vector;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
import sun.awt.AWTAccessor;
|
||||
|
||||
public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
public final class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
|
||||
/************************************************
|
||||
*
|
||||
@ -76,7 +76,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
* XBaseMenuWindow's mappingData is extended with
|
||||
* desired height of menu bar
|
||||
*/
|
||||
static class MappingData extends XBaseMenuWindow.MappingData {
|
||||
static final class MappingData extends XBaseMenuWindow.MappingData {
|
||||
int desiredHeight;
|
||||
|
||||
MappingData(XMenuItemPeer[] items, int desiredHeight) {
|
||||
@ -115,6 +115,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
/*
|
||||
* From MenuComponentPeer
|
||||
*/
|
||||
@Override
|
||||
public void setFont(Font f) {
|
||||
resetMapping();
|
||||
setItemsFont(f);
|
||||
@ -147,11 +148,13 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
* Note that these functions don't perform
|
||||
* type checks and checks for nulls or duplicates
|
||||
*/
|
||||
@Override
|
||||
public void addMenu(Menu m) {
|
||||
addItem(m);
|
||||
postPaintEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delMenu(int index) {
|
||||
synchronized(getMenuTreeLock()) {
|
||||
XMenuItemPeer item = getItem(index);
|
||||
@ -163,6 +166,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
postPaintEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHelpMenu(Menu m) {
|
||||
XMenuPeer mp = AWTAccessor.getMenuComponentAccessor().getPeer(m);
|
||||
synchronized(getMenuTreeLock()) {
|
||||
@ -192,6 +196,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
/**
|
||||
* Overridden initialization
|
||||
*/
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
// Get menus from the target.
|
||||
@ -217,6 +222,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
* Menu bar is always root window in menu window's
|
||||
* hierarchy
|
||||
*/
|
||||
@Override
|
||||
protected XBaseMenuWindow getParentMenuWindow() {
|
||||
return null;
|
||||
}
|
||||
@ -224,6 +230,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
/**
|
||||
* @see XBaseMenuWindow#map
|
||||
*/
|
||||
@Override
|
||||
protected MappingData map() {
|
||||
XMenuItemPeer[] itemVector = copyItems();
|
||||
int itemCnt = itemVector.length;
|
||||
@ -296,6 +303,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
/**
|
||||
* @see XBaseMenuWindow#getSubmenuBounds
|
||||
*/
|
||||
@Override
|
||||
protected Rectangle getSubmenuBounds(Rectangle itemBounds, Dimension windowSize) {
|
||||
Rectangle globalBounds = toGlobal(itemBounds);
|
||||
Rectangle screenBounds = getCurrentGraphicsConfiguration().getBounds();
|
||||
@ -324,6 +332,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
* size of items has changed.
|
||||
* Invokes framePeer's updateChildrenSizes()
|
||||
*/
|
||||
@Override
|
||||
protected void updateSize() {
|
||||
resetMapping();
|
||||
if (framePeer != null) {
|
||||
@ -366,6 +375,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
/**
|
||||
* @see XBaseMenuWindow#doDispose()
|
||||
*/
|
||||
@Override
|
||||
protected void doDispose() {
|
||||
super.doDispose();
|
||||
XToolkit.targetDisposedPeer(menuBarTarget, this);
|
||||
@ -381,6 +391,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
* For menu bars this function is called from framePeer's
|
||||
* reshape(...) and updateChildrenSizes()
|
||||
*/
|
||||
@Override
|
||||
public void reshape(int x, int y, int width, int height) {
|
||||
if ((width != this.width) || (height != this.height)) {
|
||||
resetMapping();
|
||||
@ -392,6 +403,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
* Performs ungrabbing of input
|
||||
* @see XBaseWindow#ungrabInputImpl()
|
||||
*/
|
||||
@Override
|
||||
void ungrabInputImpl() {
|
||||
selectItem(null, false);
|
||||
super.ungrabInputImpl();
|
||||
@ -403,6 +415,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
* Overridden XWindow painting & printing
|
||||
*
|
||||
************************************************/
|
||||
@Override
|
||||
public void paintPeer(Graphics g) {
|
||||
resetColors();
|
||||
/* Calculate menubar dimension. */
|
||||
@ -453,6 +466,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
* Overridden XBaseMenuWindow event handling
|
||||
*
|
||||
************************************************/
|
||||
@Override
|
||||
protected void handleEvent(AWTEvent event) {
|
||||
// explicitly block all events except PaintEvent.PAINT for menus,
|
||||
// that are in the modal blocked window
|
||||
@ -520,6 +534,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer {
|
||||
* Now we override this function do disable F10 explicit
|
||||
* processing. All processing is done using KeyEvent.
|
||||
*/
|
||||
@Override
|
||||
public void handleKeyPress(XEvent xev) {
|
||||
XKeyEvent xkey = xev.get_xkey();
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
|
||||
@ -92,7 +92,7 @@ public class XMenuItemPeer implements MenuItemPeer {
|
||||
*/
|
||||
private TextMetrics textMetrics;
|
||||
|
||||
static class TextMetrics implements Cloneable {
|
||||
static final class TextMetrics implements Cloneable {
|
||||
/*
|
||||
* Calculated text size members
|
||||
*/
|
||||
@ -106,6 +106,7 @@ public class XMenuItemPeer implements MenuItemPeer {
|
||||
this.textBaseline = textBaseline;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
@ -145,10 +146,12 @@ public class XMenuItemPeer implements MenuItemPeer {
|
||||
/*
|
||||
* From MenuComponentPeer
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
//Empty function
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFont(Font font) {
|
||||
resetTextMetrics();
|
||||
repaintIfShowing();
|
||||
@ -156,11 +159,13 @@ public class XMenuItemPeer implements MenuItemPeer {
|
||||
/*
|
||||
* From MenuItemPeer
|
||||
*/
|
||||
@Override
|
||||
public void setLabel(String label) {
|
||||
resetTextMetrics();
|
||||
repaintIfShowing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean enabled) {
|
||||
repaintIfShowing();
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ import java.util.Vector;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
import sun.awt.AWTAccessor;
|
||||
|
||||
public class XMenuPeer extends XMenuItemPeer implements MenuPeer {
|
||||
public final class XMenuPeer extends XMenuItemPeer implements MenuPeer {
|
||||
|
||||
/************************************************
|
||||
*
|
||||
|
||||
@ -81,7 +81,7 @@ public class XMenuWindow extends XBaseMenuWindow {
|
||||
*
|
||||
************************************************/
|
||||
|
||||
static class MappingData extends XBaseMenuWindow.MappingData {
|
||||
static final class MappingData extends XBaseMenuWindow.MappingData {
|
||||
/**
|
||||
* Rectangle for the caption
|
||||
* Necessary to fix 6267144: PIT: Popup menu label is not shown, XToolkit
|
||||
@ -183,6 +183,7 @@ public class XMenuWindow extends XBaseMenuWindow {
|
||||
/*
|
||||
* Overridden initialization
|
||||
*/
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
//Fixed 6267182: PIT: Menu is not visible after
|
||||
@ -199,6 +200,7 @@ public class XMenuWindow extends XBaseMenuWindow {
|
||||
/**
|
||||
* @see XBaseMenuWindow#getParentMenuWindow()
|
||||
*/
|
||||
@Override
|
||||
protected XBaseMenuWindow getParentMenuWindow() {
|
||||
return (menuPeer != null) ? menuPeer.getContainer() : null;
|
||||
}
|
||||
@ -206,6 +208,7 @@ public class XMenuWindow extends XBaseMenuWindow {
|
||||
/**
|
||||
* @see XBaseMenuWindow#map()
|
||||
*/
|
||||
@Override
|
||||
protected MappingData map() {
|
||||
//TODO:Implement popup-menu caption mapping and painting and tear-off
|
||||
int itemCnt;
|
||||
@ -281,6 +284,7 @@ public class XMenuWindow extends XBaseMenuWindow {
|
||||
/**
|
||||
* @see XBaseMenuWindow#getSubmenuBounds
|
||||
*/
|
||||
@Override
|
||||
protected Rectangle getSubmenuBounds(Rectangle itemBounds, Dimension windowSize) {
|
||||
Rectangle globalBounds = toGlobal(itemBounds);
|
||||
Rectangle screenBounds = getCurrentGraphicsConfiguration().getBounds();
|
||||
@ -308,6 +312,7 @@ public class XMenuWindow extends XBaseMenuWindow {
|
||||
* It's likely that size of items was changed
|
||||
* invoke resizing of window on eventHandlerThread
|
||||
*/
|
||||
@Override
|
||||
protected void updateSize() {
|
||||
resetMapping();
|
||||
if (isShowing()) {
|
||||
|
||||
@ -50,7 +50,7 @@ import sun.awt.dnd.SunDragSourceContextPeer;
|
||||
* @see java.awt.dnd.DragSource
|
||||
*/
|
||||
|
||||
class XMouseDragGestureRecognizer extends MouseDragGestureRecognizer {
|
||||
final class XMouseDragGestureRecognizer extends MouseDragGestureRecognizer {
|
||||
|
||||
/**
|
||||
* Use serialVersionUID from JDK 1.5 for interoperability.
|
||||
@ -141,6 +141,7 @@ class XMouseDragGestureRecognizer extends MouseDragGestureRecognizer {
|
||||
* Invoked when the mouse has been clicked on a component.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
// do nothing
|
||||
}
|
||||
@ -149,6 +150,7 @@ class XMouseDragGestureRecognizer extends MouseDragGestureRecognizer {
|
||||
* Invoked when a mouse button has been pressed on a component.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
events.clear();
|
||||
|
||||
@ -166,6 +168,7 @@ class XMouseDragGestureRecognizer extends MouseDragGestureRecognizer {
|
||||
* Invoked when a mouse button has been released on a component.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
events.clear();
|
||||
}
|
||||
@ -174,6 +177,7 @@ class XMouseDragGestureRecognizer extends MouseDragGestureRecognizer {
|
||||
* Invoked when the mouse enters a component.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
events.clear();
|
||||
}
|
||||
@ -182,6 +186,7 @@ class XMouseDragGestureRecognizer extends MouseDragGestureRecognizer {
|
||||
* Invoked when the mouse exits a component.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
if (!events.isEmpty()) { // gesture pending
|
||||
int dragAction = mapDragOperationFromModifiers(e);
|
||||
@ -196,6 +201,7 @@ class XMouseDragGestureRecognizer extends MouseDragGestureRecognizer {
|
||||
* Invoked when a mouse button is pressed on a component.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
if (!events.isEmpty()) { // gesture pending
|
||||
int dop = mapDragOperationFromModifiers(e);
|
||||
@ -225,6 +231,7 @@ class XMouseDragGestureRecognizer extends MouseDragGestureRecognizer {
|
||||
* (with no buttons no down).
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ public final class XMouseInfoPeer implements MouseInfoPeer {
|
||||
XMouseInfoPeer() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fillPointWithCoords(Point point) {
|
||||
long display = XToolkit.getDisplay();
|
||||
GraphicsEnvironment ge = GraphicsEnvironment.
|
||||
@ -83,6 +84,7 @@ public final class XMouseInfoPeer implements MouseInfoPeer {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWindowUnderMouse(Window w) {
|
||||
if (w == null) {
|
||||
return false;
|
||||
|
||||
@ -43,10 +43,12 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
||||
/**
|
||||
* XStateProtocol
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsState(int state) {
|
||||
return doStateProtocol() ; // TODO - check for Frame constants
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setState(XWindowPeer window, int state) {
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
log.fine("Setting state of " + window + " to " + state);
|
||||
@ -132,6 +134,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getState(XWindowPeer window) {
|
||||
return getStateImpl(window);
|
||||
}
|
||||
@ -154,6 +157,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
||||
return java_state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStateChange(XPropertyEvent e) {
|
||||
boolean res = doStateProtocol() && (e.get_atom() == XA_NET_WM_STATE.getAtom()) ;
|
||||
|
||||
@ -168,6 +172,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
||||
/*
|
||||
* Work around for 4775545.
|
||||
*/
|
||||
@Override
|
||||
public void unshadeKludge(XWindowPeer window) {
|
||||
XAtomList net_wm_state = window.getNETWMState();
|
||||
net_wm_state.remove(XA_NET_WM_STATE_SHADED);
|
||||
@ -177,6 +182,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
||||
/**
|
||||
* XLayerProtocol
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsLayer(int layer) {
|
||||
return ((layer == LAYER_ALWAYS_ON_TOP) || (layer == LAYER_NORMAL)) && doLayerProtocol();
|
||||
}
|
||||
@ -244,6 +250,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
||||
XToolkit.XSync();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayer(XWindowPeer window, int layer) {
|
||||
setStateHelper(window, XA_NET_WM_STATE_ABOVE, layer == LAYER_ALWAYS_ON_TOP);
|
||||
}
|
||||
|
||||
@ -52,6 +52,7 @@ public class XPanelPeer extends XCanvasPeer implements PanelPeer {
|
||||
super(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
if (embedder != null) {
|
||||
@ -59,9 +60,11 @@ public class XPanelPeer extends XCanvasPeer implements PanelPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getInsets() {
|
||||
return new Insets(0, 0, 0, 0);
|
||||
}
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
super.paint(g);
|
||||
SunGraphicsCallback.PaintHeavyweightComponentsCallback.getInstance().
|
||||
@ -69,6 +72,7 @@ public class XPanelPeer extends XCanvasPeer implements PanelPeer {
|
||||
SunGraphicsCallback.LIGHTWEIGHTS |
|
||||
SunGraphicsCallback.HEAVYWEIGHTS);
|
||||
}
|
||||
@Override
|
||||
public void print(Graphics g) {
|
||||
super.print(g);
|
||||
SunGraphicsCallback.PrintHeavyweightComponentsCallback.getInstance().
|
||||
@ -78,6 +82,7 @@ public class XPanelPeer extends XCanvasPeer implements PanelPeer {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBackground(Color c) {
|
||||
Component comp;
|
||||
int i;
|
||||
@ -100,6 +105,7 @@ public class XPanelPeer extends XCanvasPeer implements PanelPeer {
|
||||
super.setBackground(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setForeground(Color c) {
|
||||
setForegroundForHierarchy((Container) target, c);
|
||||
}
|
||||
@ -126,6 +132,7 @@ public class XPanelPeer extends XCanvasPeer implements PanelPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (embedder != null) {
|
||||
embedder.deinstall();
|
||||
@ -133,6 +140,7 @@ public class XPanelPeer extends XCanvasPeer implements PanelPeer {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldFocusOnClick() {
|
||||
// Return false if this container has children so in that case it won't
|
||||
// be focused. Return true otherwise.
|
||||
|
||||
@ -45,7 +45,7 @@ import sun.awt.AWTAccessor;
|
||||
import sun.awt.SunToolkit;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer {
|
||||
public final class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer {
|
||||
|
||||
/************************************************
|
||||
*
|
||||
|
||||
@ -37,9 +37,9 @@ import java.util.*;
|
||||
* access to properties is rewritten using general mechanisms, caching
|
||||
* will be enabled.
|
||||
*/
|
||||
public class XPropertyCache {
|
||||
public final class XPropertyCache {
|
||||
|
||||
static class PropertyCacheEntry {
|
||||
static final class PropertyCacheEntry {
|
||||
private final int format;
|
||||
private final int numberOfItems;
|
||||
private final long bytesAfter;
|
||||
|
||||
@ -29,7 +29,7 @@ package sun.awt.X11;
|
||||
|
||||
import jdk.internal.misc.Unsafe;
|
||||
|
||||
public class XQueryTree {
|
||||
public final class XQueryTree {
|
||||
private static Unsafe unsafe = XlibWrapper.unsafe;
|
||||
private boolean __executed = false;
|
||||
long _w;
|
||||
|
||||
@ -45,6 +45,7 @@ final class XRepaintArea extends RepaintArea {
|
||||
/**
|
||||
* Calls {@code Component.update(Graphics)} with given Graphics.
|
||||
*/
|
||||
@Override
|
||||
protected void updateComponent(Component comp, Graphics g) {
|
||||
if (comp != null) {
|
||||
// We don't call peer.paintPeer() here, because we shouldn't paint
|
||||
@ -56,6 +57,7 @@ final class XRepaintArea extends RepaintArea {
|
||||
/**
|
||||
* Calls {@code Component.paint(Graphics)} with given Graphics.
|
||||
*/
|
||||
@Override
|
||||
protected void paintComponent(Component comp, Graphics g) {
|
||||
if (comp != null) {
|
||||
final XComponentPeer peer = AWTAccessor.getComponentAccessor()
|
||||
|
||||
@ -30,8 +30,8 @@ package sun.awt.X11;
|
||||
* Object of this class is singleton, all window reference it to have
|
||||
* common logical ancestor
|
||||
*/
|
||||
class XRootWindow extends XBaseWindow {
|
||||
private static class LazyHolder {
|
||||
final class XRootWindow extends XBaseWindow {
|
||||
private static final class LazyHolder {
|
||||
private static final XRootWindow xawtRootWindow;
|
||||
|
||||
static {
|
||||
@ -54,11 +54,13 @@ class XRootWindow extends XBaseWindow {
|
||||
EVENT_MASK, XConstants.StructureNotifyMask }));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(XCreateWindowParams params){
|
||||
super.postInit(params);
|
||||
setWMClass(getWMClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getWMName() {
|
||||
return XToolkit.getAWTAppClassName();
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ import java.lang.reflect.*;
|
||||
|
||||
import sun.awt.AWTAccessor;
|
||||
|
||||
class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollbarClient {
|
||||
final class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollbarClient {
|
||||
|
||||
public static final int MARGIN = 1;
|
||||
public static final int SCROLLBAR;
|
||||
@ -54,10 +54,11 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
int hsbSpace;
|
||||
int vsbSpace;
|
||||
|
||||
static class XScrollPaneContentWindow extends XWindow {
|
||||
static final class XScrollPaneContentWindow extends XWindow {
|
||||
XScrollPaneContentWindow(ScrollPane target, long parentWindow) {
|
||||
super(target, parentWindow);
|
||||
}
|
||||
@Override
|
||||
public String getWMName() {
|
||||
return "ScrollPane content";
|
||||
}
|
||||
@ -108,11 +109,13 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getContentWindow()
|
||||
{
|
||||
return (clip == null) ? window : clip.getWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBounds(int x, int y, int w, int h, int op) {
|
||||
super.setBounds(x, y, w, h, op);
|
||||
|
||||
@ -122,18 +125,22 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getInsets() {
|
||||
return new Insets(MARGIN, MARGIN, MARGIN+hsbSpace, MARGIN+vsbSpace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHScrollbarHeight() {
|
||||
return SCROLLBAR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVScrollbarWidth() {
|
||||
return SCROLLBAR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void childResized(int w, int h) {
|
||||
if (setScrollbarSpace()) {
|
||||
setViewportSize();
|
||||
@ -241,6 +248,7 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
height - (2*MARGIN) - hsbSpace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUnitIncrement(Adjustable adj, int u) {
|
||||
if (adj.getOrientation() == Adjustable.VERTICAL) {
|
||||
vsb.setUnitIncrement(u);
|
||||
@ -250,6 +258,7 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Adjustable adj, int v) {
|
||||
if (adj.getOrientation() == Adjustable.VERTICAL) {
|
||||
scroll(-1, v, VERTICAL);
|
||||
@ -259,6 +268,7 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScrollPosition(int x, int y) {
|
||||
scroll(x, y, VERTICAL | HORIZONTAL);
|
||||
}
|
||||
@ -361,6 +371,7 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void repaintScrollbarRequest(XScrollbar sb) {
|
||||
Graphics g = getGraphics();
|
||||
Color[] colors = getGUIcolors();
|
||||
@ -376,6 +387,7 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void handleEvent(java.awt.AWTEvent e) {
|
||||
super.handleEvent(e);
|
||||
|
||||
@ -467,6 +479,7 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
* MouseEvent.MOUSE_EXITED
|
||||
* MouseEvent.MOUSE_DRAGGED
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void handleJavaMouseEvent( MouseEvent mouseEvent ) {
|
||||
super.handleJavaMouseEvent(mouseEvent);
|
||||
@ -522,6 +535,7 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
/**
|
||||
* return value from the scrollbar
|
||||
*/
|
||||
@Override
|
||||
public void notifyValue(XScrollbar obj, int type, int v, boolean isAdjusting) {
|
||||
if (obj == vsb) {
|
||||
scroll(-1, v, VERTICAL, type);
|
||||
@ -572,6 +586,7 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb
|
||||
* ToDo(aim): needs to query native motif for more accurate size and
|
||||
* color information.
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void print(Graphics g) {
|
||||
ScrollPane sp = (ScrollPane)target;
|
||||
|
||||
@ -858,13 +858,14 @@ abstract class XScrollbar {
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass() + "[" + width + "x" + height + "," + barWidth + "x" + barLength + "]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class XScrollRepeater implements Runnable {
|
||||
final class XScrollRepeater implements Runnable {
|
||||
/**
|
||||
* Time to pause before the first scroll repeat.
|
||||
*/
|
||||
@ -922,6 +923,7 @@ class XScrollRepeater implements Runnable {
|
||||
newScroll = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run () {
|
||||
synchronized(this) {
|
||||
if (shouldSkip) {
|
||||
|
||||
@ -32,7 +32,7 @@ import java.awt.peer.*;
|
||||
import sun.awt.OSInfo;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbarClient {
|
||||
final class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbarClient {
|
||||
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XScrollbarPeer");
|
||||
|
||||
private static final int DEFAULT_LENGTH = 50;
|
||||
@ -45,6 +45,7 @@ class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbar
|
||||
DEFAULT_WIDTH_LINUX = XToolkit.getUIDefaults().getInt("ScrollBar.defaultWidth");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
@ -87,6 +88,7 @@ class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbar
|
||||
/**
|
||||
* Compute the minimum size for the scrollbar.
|
||||
*/
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
Scrollbar sb = (Scrollbar)target;
|
||||
return (sb.getOrientation() == Scrollbar.VERTICAL)
|
||||
@ -104,6 +106,7 @@ class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbar
|
||||
// paint the whole scrollbar
|
||||
}
|
||||
|
||||
@Override
|
||||
public void repaintScrollbarRequest(XScrollbar sb) {
|
||||
repaint();
|
||||
}
|
||||
@ -111,6 +114,7 @@ class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbar
|
||||
/**
|
||||
* The value has changed.
|
||||
*/
|
||||
@Override
|
||||
public void notifyValue(XScrollbar obj, int type, int value, boolean isAdjusting) {
|
||||
Scrollbar sb = (Scrollbar)target;
|
||||
sb.setValue(value);
|
||||
@ -128,6 +132,7 @@ class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbar
|
||||
* MouseEvent.MOUSE_EXITED
|
||||
* MouseEvent.MOUSE_DRAGGED
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void handleJavaMouseEvent( MouseEvent mouseEvent ) {
|
||||
super.handleJavaMouseEvent(mouseEvent);
|
||||
@ -158,6 +163,7 @@ class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbar
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleJavaKeyEvent(KeyEvent event) {
|
||||
super.handleJavaKeyEvent(event);
|
||||
if (log.isLoggable(PlatformLogger.Level.FINER)) {
|
||||
@ -206,20 +212,24 @@ class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbar
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int value, int visible, int minimum, int maximum) {
|
||||
|
||||
tsb.setValues(value, visible, minimum, maximum);
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineIncrement(int l) {
|
||||
tsb.setUnitIncrement(l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPageIncrement(int p) {
|
||||
tsb.setBlockIncrement(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layout() {
|
||||
super.layout();
|
||||
tsb.setSize(width, height);
|
||||
|
||||
@ -714,7 +714,8 @@ final class XSelection {
|
||||
}
|
||||
}
|
||||
|
||||
private static class SelectionEventHandler implements XEventDispatcher {
|
||||
private static final class SelectionEventHandler implements XEventDispatcher {
|
||||
@Override
|
||||
public void dispatchEvent(XEvent ev) {
|
||||
switch (ev.get_type()) {
|
||||
case XConstants.SelectionNotify: {
|
||||
@ -769,7 +770,7 @@ final class XSelection {
|
||||
}
|
||||
}
|
||||
|
||||
private static class IncrementalDataProvider implements XEventDispatcher {
|
||||
private static final class IncrementalDataProvider implements XEventDispatcher {
|
||||
private final long requestor;
|
||||
private final long property;
|
||||
private final long target;
|
||||
@ -808,6 +809,7 @@ final class XSelection {
|
||||
XToolkit.addEventDispatcher(requestor, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchEvent(XEvent ev) {
|
||||
switch (ev.get_type()) {
|
||||
case XConstants.PropertyNotify:
|
||||
@ -855,7 +857,8 @@ final class XSelection {
|
||||
}
|
||||
}
|
||||
|
||||
private static class IncrementalTransferHandler implements XEventDispatcher {
|
||||
private static final class IncrementalTransferHandler implements XEventDispatcher {
|
||||
@Override
|
||||
public void dispatchEvent(XEvent ev) {
|
||||
switch (ev.get_type()) {
|
||||
case XConstants.PropertyNotify:
|
||||
|
||||
@ -33,7 +33,7 @@ import sun.awt.AWTAccessor;
|
||||
import sun.awt.UNIXToolkit;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener {
|
||||
public final class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener {
|
||||
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XSystemTrayPeer");
|
||||
|
||||
SystemTray target;
|
||||
@ -70,6 +70,7 @@ public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ownerChanged(int screen, XMSelection sel, long newOwner, long data, long timestamp) {
|
||||
if (shouldDisableSystemTray) {
|
||||
return;
|
||||
@ -87,6 +88,7 @@ public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener {
|
||||
createTrayPeers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ownerDeath(int screen, XMSelection sel, long deadOwner) {
|
||||
if (shouldDisableSystemTray) {
|
||||
return;
|
||||
@ -102,9 +104,11 @@ public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectionChanged(int screen, XMSelection sel, long owner, XPropertyEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getTrayIconSize() {
|
||||
return new Dimension(XTrayIconPeer.TRAY_ICON_HEIGHT, XTrayIconPeer.TRAY_ICON_WIDTH);
|
||||
}
|
||||
|
||||
@ -1092,7 +1092,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
private static class AWTTextPane extends JScrollPane implements FocusListener {
|
||||
private static final class AWTTextPane extends JScrollPane implements FocusListener {
|
||||
|
||||
private final JTextArea jtext;
|
||||
private final XWindow xwin;
|
||||
@ -1189,7 +1189,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
static class BevelBorder extends AbstractBorder implements UIResource {
|
||||
static final class BevelBorder extends AbstractBorder implements UIResource {
|
||||
private Color darkShadow = SystemColor.controlDkShadow;
|
||||
private Color lightShadow = SystemColor.controlLtHighlight;
|
||||
private Color control = SystemColor.controlShadow;
|
||||
|
||||
@ -39,15 +39,19 @@ final class XToolkitThreadBlockedHandler implements
|
||||
static ToolkitThreadBlockedHandler getToolkitThreadBlockedHandler() {
|
||||
return priveleged_lock;
|
||||
}
|
||||
@Override
|
||||
public void lock() {
|
||||
XToolkit.awtLock();
|
||||
}
|
||||
@Override
|
||||
public void unlock() {
|
||||
XToolkit.awtUnlock();
|
||||
}
|
||||
@Override
|
||||
public void enter() {
|
||||
tk.run(XToolkit.SECONDARY_LOOP);
|
||||
}
|
||||
@Override
|
||||
public void exit() {
|
||||
XlibWrapper.ExitSecondaryLoop();
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ package sun.awt.X11;
|
||||
|
||||
import jdk.internal.misc.Unsafe;
|
||||
|
||||
public class XTranslateCoordinates {
|
||||
public final class XTranslateCoordinates {
|
||||
private static Unsafe unsafe = XlibWrapper.unsafe;
|
||||
private boolean __executed = false;
|
||||
long _scr_w;
|
||||
|
||||
@ -33,7 +33,7 @@ import java.awt.image.*;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
public class XTrayIconPeer implements TrayIconPeer,
|
||||
public final class XTrayIconPeer implements TrayIconPeer,
|
||||
InfoWindow.Balloon.LiveArguments,
|
||||
InfoWindow.Tooltip.LiveArguments
|
||||
{
|
||||
@ -267,6 +267,7 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
addListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (SunToolkit.isDispatchThreadForAppContext(target)) {
|
||||
disposeOnEDT();
|
||||
@ -310,14 +311,17 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
AWTAccessor.getWindowAccessor().setTrayIconWindow(w, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setToolTip(String tooltip) {
|
||||
tooltipString = tooltip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltipString() {
|
||||
return tooltipString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateImage() {
|
||||
Runnable r = new Runnable() {
|
||||
public void run() {
|
||||
@ -332,6 +336,7 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayMessage(String caption, String text, String messageType) {
|
||||
Point loc = getLocationOnScreen();
|
||||
Rectangle screen = eframe.getGraphicsConfiguration().getBounds();
|
||||
@ -345,6 +350,7 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
}
|
||||
|
||||
// It's synchronized with disposal by EDT.
|
||||
@Override
|
||||
public void showPopupMenu(int x, int y) {
|
||||
if (isDisposed())
|
||||
return;
|
||||
@ -405,6 +411,7 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
return eframe.getLocationOnScreen();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle getBounds() {
|
||||
Point loc = getLocationOnScreen();
|
||||
return new Rectangle(loc.x, loc.y, loc.x + TRAY_ICON_WIDTH, loc.y + TRAY_ICON_HEIGHT);
|
||||
@ -427,15 +434,17 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
.<XEmbeddedFramePeer>getPeer(eframe).getWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDisposed() {
|
||||
return isDisposed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getActionCommand() {
|
||||
return target.getActionCommand();
|
||||
}
|
||||
|
||||
static class TrayIconEventProxy implements MouseListener, MouseMotionListener {
|
||||
static final class TrayIconEventProxy implements MouseListener, MouseMotionListener {
|
||||
XTrayIconPeer xtiPeer;
|
||||
|
||||
TrayIconEventProxy(XTrayIconPeer xtiPeer) {
|
||||
@ -469,6 +478,7 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
e.setSource(xtiPeer.target);
|
||||
XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), e);
|
||||
}
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
if ((e.getClickCount() == 1 || xtiPeer.balloon.isVisible()) &&
|
||||
@ -484,23 +494,29 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
}
|
||||
handleEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
xtiPeer.tooltip.enter();
|
||||
handleEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
xtiPeer.tooltip.exit();
|
||||
handleEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
handleEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
handleEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
handleEvent(e);
|
||||
}
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
handleEvent(e);
|
||||
}
|
||||
@ -511,20 +527,23 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
// ***************************************
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
private static class XTrayIconEmbeddedFrame extends XEmbeddedFrame {
|
||||
private static final class XTrayIconEmbeddedFrame extends XEmbeddedFrame {
|
||||
public XTrayIconEmbeddedFrame(){
|
||||
super(XToolkit.getDefaultRootWindow(), true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUndecorated() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isResizable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// embedded frame for tray icon shouldn't be disposed by anyone except tray icon
|
||||
@Override
|
||||
public void dispose(){
|
||||
}
|
||||
|
||||
@ -538,7 +557,7 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
// ***************************************
|
||||
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
static class TrayIconCanvas extends IconCanvas {
|
||||
static final class TrayIconCanvas extends IconCanvas {
|
||||
TrayIcon target;
|
||||
boolean autosize;
|
||||
|
||||
@ -548,6 +567,7 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
}
|
||||
|
||||
// Invoke on EDT.
|
||||
@Override
|
||||
protected void repaintImage(boolean doClear) {
|
||||
boolean old_autosize = autosize;
|
||||
autosize = target.isImageAutoSize();
|
||||
@ -558,6 +578,7 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
super.repaintImage(doClear || (old_autosize != autosize));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
target = null;
|
||||
@ -608,6 +629,7 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
}
|
||||
|
||||
// Invoke on EDT.
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
if (g != null && curW > 0 && curH > 0) {
|
||||
BufferedImage bufImage = new BufferedImage(curW, curH, BufferedImage.TYPE_INT_ARGB);
|
||||
@ -627,7 +649,8 @@ public class XTrayIconPeer implements TrayIconPeer,
|
||||
}
|
||||
}
|
||||
|
||||
class IconObserver implements ImageObserver {
|
||||
final class IconObserver implements ImageObserver {
|
||||
@Override
|
||||
public boolean imageUpdate(final Image image, final int flags, int x, int y, int width, int height) {
|
||||
if (image != IconCanvas.this.image || // if the image has been changed
|
||||
!IconCanvas.this.isVisible())
|
||||
|
||||
@ -30,11 +30,12 @@ import java.awt.*;
|
||||
/**
|
||||
* A simple vertical scroll bar.
|
||||
*/
|
||||
class XVerticalScrollbar extends XScrollbar {
|
||||
final class XVerticalScrollbar extends XScrollbar {
|
||||
public XVerticalScrollbar(XScrollbarClient sb) {
|
||||
super(ALIGNMENT_VERTICAL, sb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(int width, int height) {
|
||||
super.setSize(width, height);
|
||||
this.barWidth = width;
|
||||
@ -43,16 +44,19 @@ class XVerticalScrollbar extends XScrollbar {
|
||||
rebuildArrows();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rebuildArrows() {
|
||||
firstArrow = createArrowShape(true, true);
|
||||
secondArrow = createArrowShape(true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean beforeThumb(int x, int y) {
|
||||
Rectangle pos = calculateThumbRect();
|
||||
return (y < pos.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Rectangle getThumbArea() {
|
||||
return new Rectangle(2, getArrowAreaWidth(), width-4, height - 2*getArrowAreaWidth());
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ package sun.awt.X11;
|
||||
import java.awt.*;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
||||
final class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
||||
static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XWINProtocol");
|
||||
|
||||
/* Gnome WM spec */
|
||||
@ -37,10 +37,12 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
||||
XAtom XA_WIN_PROTOCOLS = XAtom.get("_WIN_PROTOCOLS");
|
||||
XAtom XA_WIN_STATE = XAtom.get("_WIN_STATE");
|
||||
|
||||
@Override
|
||||
public boolean supportsState(int state) {
|
||||
return doStateProtocol(); // TODO - check for Frame constants
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setState(XWindowPeer window, int state) {
|
||||
if (window.isShowing()) {
|
||||
/*
|
||||
@ -121,6 +123,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getState(XWindowPeer window) {
|
||||
long win_state = XA_WIN_STATE.getCard32Property(window);
|
||||
int java_state = Frame.NORMAL;
|
||||
@ -133,10 +136,12 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
||||
return java_state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStateChange(XPropertyEvent e) {
|
||||
return doStateProtocol() && e.get_atom() == XA_WIN_STATE.getAtom();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unshadeKludge(XWindowPeer window) {
|
||||
long win_state = XA_WIN_STATE.getCard32Property(window);
|
||||
if ((win_state & WIN_STATE_SHADED) == 0) {
|
||||
@ -146,10 +151,12 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol {
|
||||
XA_WIN_STATE.setCard32Property(window, win_state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsLayer(int layer) {
|
||||
return ((layer == LAYER_ALWAYS_ON_TOP) || (layer == LAYER_NORMAL)) && doLayerProtocol();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayer(XWindowPeer window, int layer) {
|
||||
if (window.isShowing()) {
|
||||
XClientMessageEvent req = new XClientMessageEvent();
|
||||
|
||||
@ -106,6 +106,7 @@ final class XWM
|
||||
CWM_WM = 14,
|
||||
MUTTER_WM = 15,
|
||||
UNITY_COMPIZ_WM = 16;
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (WMID) {
|
||||
case NO_WM:
|
||||
|
||||
@ -189,6 +189,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
graphicsConfigData = new AwtGraphicsConfigData(graphicsConfig.getAData());
|
||||
}
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
super.preInit(params);
|
||||
reparented = Boolean.TRUE.equals(params.get(REPARENTED));
|
||||
@ -254,6 +255,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
savedState = XUtilConstants.WithdrawnState;
|
||||
}
|
||||
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
|
||||
@ -271,6 +273,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsConfiguration getGraphicsConfiguration() {
|
||||
if (graphicsConfig == null) {
|
||||
initGraphicsConfiguration();
|
||||
@ -342,6 +345,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
return (parent == target);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getTarget() {
|
||||
return target;
|
||||
}
|
||||
@ -384,6 +388,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
return new SunGraphics2D(surfData, fgColor, bgColor, font);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Graphics getGraphics() {
|
||||
return getGraphics(surfaceData,
|
||||
target.getForeground(),
|
||||
@ -533,6 +538,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
void paintPeer(final Graphics g) {
|
||||
}
|
||||
//used by Peers to avoid flickering within paint()
|
||||
@Override
|
||||
protected void flush(){
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
@ -547,6 +553,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
xSetBounds(x, y, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleExposeEvent(XEvent xev) {
|
||||
super.handleExposeEvent(xev);
|
||||
XExposeEvent xe = xev.get_xexpose();
|
||||
@ -656,6 +663,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
return AWT_MULTICLICK_SMUDGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleButtonPressRelease(XEvent xev) {
|
||||
super.handleButtonPressRelease(xev);
|
||||
XButtonEvent xbe = xev.get_xbutton();
|
||||
@ -779,6 +787,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMotionNotify(XEvent xev) {
|
||||
super.handleMotionNotify(xev);
|
||||
XMotionEvent xme = xev.get_xmotion();
|
||||
@ -884,6 +893,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleXCrossingEvent(XEvent xev) {
|
||||
super.handleXCrossingEvent(xev);
|
||||
XCrossingEvent xce = xev.get_xcrossing();
|
||||
@ -996,6 +1006,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
|
||||
public void doLayout(int x, int y, int width, int height) {}
|
||||
|
||||
@Override
|
||||
public void handleConfigureNotifyEvent(XEvent xev) {
|
||||
Rectangle oldBounds = getBounds();
|
||||
|
||||
@ -1020,6 +1031,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMapNotifyEvent(XEvent xev) {
|
||||
super.handleMapNotifyEvent(xev);
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
@ -1034,6 +1046,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
postEventToEventQueue(ce);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleUnmapNotifyEvent(XEvent xev) {
|
||||
super.handleUnmapNotifyEvent(xev);
|
||||
if (isEventDisabled(xev)) {
|
||||
@ -1084,6 +1097,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
keyEventLog.fine("XXXXXXXXXXXXXX javakeycode will be most probably:0x"+ Integer.toHexString(XKeysym.getJavaKeycodeOnly(ev)));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void handleKeyPress(XEvent xev) {
|
||||
super.handleKeyPress(xev);
|
||||
XKeyEvent ev = xev.get_xkey();
|
||||
@ -1193,6 +1207,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleKeyRelease(XEvent xev) {
|
||||
super.handleKeyRelease(xev);
|
||||
XKeyEvent ev = xev.get_xkey();
|
||||
@ -1403,6 +1418,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurfaceData getSurfaceData() {
|
||||
return surfaceData;
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
package sun.awt.X11;
|
||||
import sun.awt.IconInfo;
|
||||
|
||||
class XWindowAttributesData {
|
||||
final class XWindowAttributesData {
|
||||
static int NORMAL = 0;
|
||||
static int ICONIC = 1;
|
||||
static int MAXIMIZED = 2;
|
||||
|
||||
@ -150,6 +150,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
*/
|
||||
private static final int MAXIMUM_BUFFER_LENGTH_NET_WM_ICON = (2<<15) - 1;
|
||||
|
||||
@Override
|
||||
void preInit(XCreateWindowParams params) {
|
||||
target = (Component)params.get(TARGET);
|
||||
windowType = ((Window)target).getType();
|
||||
@ -203,6 +204,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getWMName() {
|
||||
String name = target.getName();
|
||||
if (name == null || name.trim().isEmpty()) {
|
||||
@ -214,6 +216,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
private static native String getLocalHostname();
|
||||
private static native int getJvmPID();
|
||||
|
||||
@Override
|
||||
void postInit(XCreateWindowParams params) {
|
||||
super.postInit(params);
|
||||
|
||||
@ -284,6 +287,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
// no need in updateOpaque() as it is no-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateIconImages() {
|
||||
Window target = (Window)this.target;
|
||||
java.util.List<Image> iconImages = target.getIconImages();
|
||||
@ -453,6 +457,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMinimumSize() {
|
||||
//This function only saves minimumSize value in XWindowPeer
|
||||
//Setting WMSizeHints is implemented in XDecoratedPeer
|
||||
@ -475,6 +480,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
//Since events are not posted from Component.setBounds we need to send them here.
|
||||
//Note that this function is overridden in XDecoratedPeer so event
|
||||
//posting is not changing for decorated peers
|
||||
@Override
|
||||
public void setBounds(int x, int y, int width, int height, int op) {
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
@ -516,6 +522,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getInsets() {
|
||||
return new Insets(0, 0, 0, 0);
|
||||
}
|
||||
@ -717,6 +724,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
* From the DisplayChangedListener interface; called from
|
||||
* X11GraphicsDevice when the display mode has been changed.
|
||||
*/
|
||||
@Override
|
||||
public void displayChanged() {
|
||||
executeDisplayChangedOnEDT(getGraphicsConfiguration());
|
||||
}
|
||||
@ -725,6 +733,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
* From the DisplayChangedListener interface; top-levels do not need
|
||||
* to react to this event.
|
||||
*/
|
||||
@Override
|
||||
public void paletteChanged() {
|
||||
}
|
||||
|
||||
@ -897,6 +906,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
|
||||
void setSaveUnder(boolean state) {}
|
||||
|
||||
@Override
|
||||
public void toFront() {
|
||||
if (isOverrideRedirect() && mustControlStackPosition) {
|
||||
mustControlStackPosition = false;
|
||||
@ -914,6 +924,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBack() {
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
@ -1034,6 +1045,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
XLayerProtocol.LAYER_NORMAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAlwaysOnTopState() {
|
||||
this.alwaysOnTop = ((Window) this.target).isAlwaysOnTop();
|
||||
if (ownerPeer != null) {
|
||||
@ -1049,6 +1061,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
updateAlwaysOnTop();
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isLocationByPlatform() {
|
||||
return locationByPlatform;
|
||||
}
|
||||
@ -1068,6 +1081,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean vis) {
|
||||
if (!isVisible() && vis) {
|
||||
isBeforeFirstMapNotify = true;
|
||||
@ -1174,6 +1188,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
winAttr.nativeDecor == false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (isGrabbed()) {
|
||||
if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
@ -1208,10 +1223,12 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isResizable() {
|
||||
return winAttr.isResizable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleVisibilityEvent(XEvent xev) {
|
||||
super.handleVisibilityEvent(xev);
|
||||
XVisibilityEvent ve = xev.get_xvisibility();
|
||||
@ -1293,6 +1310,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMapNotifyEvent(XEvent xev) {
|
||||
removeStartupNotification();
|
||||
|
||||
@ -1329,6 +1347,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleUnmapNotifyEvent(XEvent xev) {
|
||||
super.handleUnmapNotifyEvent(xev);
|
||||
|
||||
@ -1414,6 +1433,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void setReparented(boolean newValue) {
|
||||
super.setReparented(newValue);
|
||||
XToolkit.awtLock();
|
||||
@ -1493,6 +1513,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
return javaToplevels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setModalBlocked(Dialog d, boolean blocked) {
|
||||
setModalBlocked(d, blocked, null);
|
||||
}
|
||||
@ -1980,6 +2001,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
rootPropertyEventDispatcher = null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void updateFocusableWindowState() {
|
||||
cachedFocusableWindow = isFocusableWindow();
|
||||
}
|
||||
@ -2000,6 +2022,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropMwmHints getMWMHints() {
|
||||
if (mwm_hints == null) {
|
||||
mwm_hints = new PropMwmHints();
|
||||
@ -2010,6 +2033,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
return mwm_hints;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMWMHints(PropMwmHints hints) {
|
||||
mwm_hints = hints;
|
||||
if (hints != null) {
|
||||
@ -2046,6 +2070,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
return grab && XAwtState.getGrabWindow() == this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleXCrossingEvent(XEvent xev) {
|
||||
XCrossingEvent xce = xev.get_xcrossing();
|
||||
if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
@ -2074,6 +2099,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
super.handleXCrossingEvent(xev);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMotionNotify(XEvent xev) {
|
||||
XMotionEvent xme = xev.get_xmotion();
|
||||
if (grabLog.isLoggable(PlatformLogger.Level.FINER)) {
|
||||
@ -2135,6 +2161,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
// we use it to retarget mouse drag and mouse release during grab.
|
||||
private XBaseWindow pressTarget = this;
|
||||
|
||||
@Override
|
||||
public void handleButtonPressRelease(XEvent xev) {
|
||||
XButtonEvent xbe = xev.get_xbutton();
|
||||
/*
|
||||
@ -2269,6 +2296,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
super.handleButtonPressRelease(xev);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(Graphics g) {
|
||||
// We assume we print the whole frame,
|
||||
// so we expect no clip was set previously
|
||||
|
||||
@ -31,6 +31,7 @@ import sun.util.logging.PlatformLogger;
|
||||
abstract class XWrapperBase {
|
||||
static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.wrappers");
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String ret = "";
|
||||
|
||||
@ -62,6 +63,7 @@ abstract class XWrapperBase {
|
||||
}
|
||||
}
|
||||
public abstract long getPData();
|
||||
@Override
|
||||
public XEvent clone() {
|
||||
long copy = XlibWrapper.unsafe.allocateMemory(getDataSize());
|
||||
XlibWrapper.unsafe.copyMemory(getPData(), copy, getDataSize());
|
||||
|
||||
@ -44,7 +44,7 @@ import sun.java2d.pipe.Region;
|
||||
* This class is a collection of utility methods that operate
|
||||
* with native windows.
|
||||
*/
|
||||
public class XlibUtil
|
||||
public final class XlibUtil
|
||||
{
|
||||
/**
|
||||
* The constructor is made private to eliminate any
|
||||
|
||||
@ -44,10 +44,11 @@ public abstract class X11CustomCursor extends CustomCursor {
|
||||
super(cursor, hotSpot, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createNativeCursor(Image im, int[] pixels, int width, int height,
|
||||
int xHotSpot, int yHotSpot) {
|
||||
|
||||
class CCount implements Comparable<CCount> {
|
||||
final class CCount implements Comparable<CCount> {
|
||||
int color;
|
||||
int count;
|
||||
|
||||
@ -56,6 +57,7 @@ public abstract class X11CustomCursor extends CustomCursor {
|
||||
count = ct;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(CCount cc) {
|
||||
return cc.count - count;
|
||||
}
|
||||
|
||||
@ -673,6 +673,7 @@ public final class X11FontManager extends FcFontManager {
|
||||
}
|
||||
|
||||
// Implements SunGraphicsEnvironment.createFontConfiguration.
|
||||
@Override
|
||||
protected FontConfiguration createFontConfiguration() {
|
||||
/* The logic here decides whether to use a preconfigured
|
||||
* fontconfig.properties file, or synthesise one using platform APIs.
|
||||
@ -697,6 +698,7 @@ public final class X11FontManager extends FcFontManager {
|
||||
return mFontConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontConfiguration
|
||||
createFontConfiguration(boolean preferLocaleFonts,
|
||||
boolean preferPropFonts) {
|
||||
@ -705,6 +707,7 @@ public final class X11FontManager extends FcFontManager {
|
||||
preferLocaleFonts, preferPropFonts);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected synchronized String getFontPath(boolean noType1Fonts) {
|
||||
isHeadless(); // make sure GE is inited, as its the X11 lock.
|
||||
return getFontPathNative(noType1Fonts, true);
|
||||
|
||||
@ -314,6 +314,7 @@ public class X11GraphicsConfig extends GraphicsConfiguration
|
||||
return aData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ("X11GraphicsConfig[dev="+device+
|
||||
",vis=0x"+Integer.toHexString(visual)+
|
||||
@ -335,7 +336,7 @@ public class X11GraphicsConfig extends GraphicsConfiguration
|
||||
return device.getBounds();
|
||||
}
|
||||
|
||||
private static class XDBECapabilities extends BufferCapabilities {
|
||||
private static final class XDBECapabilities extends BufferCapabilities {
|
||||
public XDBECapabilities() {
|
||||
super(imageCaps, imageCaps, FlipContents.UNDEFINED);
|
||||
}
|
||||
@ -364,7 +365,7 @@ public class X11GraphicsConfig extends GraphicsConfiguration
|
||||
|
||||
private static native void dispose(long x11ConfigData);
|
||||
|
||||
private static class X11GCDisposerRecord implements DisposerRecord {
|
||||
private static final class X11GCDisposerRecord implements DisposerRecord {
|
||||
private long x11ConfigData;
|
||||
public X11GCDisposerRecord(long x11CfgData) {
|
||||
this.x11ConfigData = x11CfgData;
|
||||
|
||||
@ -605,6 +605,7 @@ public final class X11GraphicsDevice extends GraphicsDevice
|
||||
topLevels.remove(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ("X11GraphicsDevice[screen="+screen+"]");
|
||||
}
|
||||
|
||||
@ -179,6 +179,7 @@ public final class X11GraphicsEnvironment extends SunGraphicsEnvironment {
|
||||
*/
|
||||
private static native void initDisplay(boolean glxRequested);
|
||||
|
||||
@Override
|
||||
protected native int getNumScreens();
|
||||
|
||||
private native int getDefaultScreenNum();
|
||||
@ -267,6 +268,7 @@ public final class X11GraphicsEnvironment extends SunGraphicsEnvironment {
|
||||
"should not be called in this implementation");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDisplayLocal() {
|
||||
if (isDisplayLocal == null) {
|
||||
SunToolkit.awtLock();
|
||||
|
||||
@ -54,6 +54,7 @@ public abstract class X11InputMethod extends X11InputMethodBase {
|
||||
/**
|
||||
* Reset the composition state to the current composition state.
|
||||
*/
|
||||
@Override
|
||||
protected void resetCompositionState() {
|
||||
if (compositionEnableSupported && haveActiveClient()) {
|
||||
try {
|
||||
@ -69,6 +70,7 @@ public abstract class X11InputMethod extends X11InputMethodBase {
|
||||
/**
|
||||
* Activate input method.
|
||||
*/
|
||||
@Override
|
||||
public synchronized void activate() {
|
||||
clientComponentWindow = getClientComponentWindow();
|
||||
if (clientComponentWindow == null)
|
||||
@ -120,6 +122,7 @@ public abstract class X11InputMethod extends X11InputMethodBase {
|
||||
/**
|
||||
* Deactivate input method.
|
||||
*/
|
||||
@Override
|
||||
public synchronized void deactivate(boolean isTemporary) {
|
||||
boolean isAc = haveActiveClient();
|
||||
/* Usually as the client component, let's call it component A,
|
||||
@ -157,6 +160,7 @@ public abstract class X11InputMethod extends X11InputMethodBase {
|
||||
}
|
||||
|
||||
// implements java.awt.im.spi.InputMethod.hideWindows
|
||||
@Override
|
||||
public void hideWindows() {
|
||||
// ??? need real implementation
|
||||
}
|
||||
@ -174,6 +178,7 @@ public abstract class X11InputMethod extends X11InputMethodBase {
|
||||
// This functionality is implemented in a package-private method
|
||||
// to insure that it cannot be overridden by client subclasses.
|
||||
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
|
||||
@Override
|
||||
void dispatchComposedText(String chgText,
|
||||
int[] chgStyles,
|
||||
int chgOffset,
|
||||
@ -326,6 +331,7 @@ public abstract class X11InputMethod extends X11InputMethodBase {
|
||||
* Subclasses should override disposeImpl() instead of dispose(). Client
|
||||
* code should always invoke dispose(), never disposeImpl().
|
||||
*/
|
||||
@Override
|
||||
protected synchronized void disposeImpl() {
|
||||
disposeXIC();
|
||||
awtLock();
|
||||
@ -340,6 +346,7 @@ public abstract class X11InputMethod extends X11InputMethodBase {
|
||||
/**
|
||||
* @see java.awt.im.spi.InputMethod#setCompositionEnabled(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setCompositionEnabled(boolean enable) {
|
||||
/* If the composition state is successfully changed, set
|
||||
the savedCompositionState to 'enable'. Otherwise, simply
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user