/hg/icedtea8-forest/jdk: 7 new changesets
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Thu Jun 30 02:20:24 UTC 2016
changeset d512cab27ec8 in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=d512cab27ec8
author: yan
date: Thu Jun 23 17:44:14 2016 +0100
8133539, PR1061: [TEST_BUG] Split java/awt/image/MultiResolutionImageTest.java in two to allow restricted access
Reviewed-by: alexsch, serb
Contributed-by: Renjith Alexander <renjith.alexander at oracle.com>
changeset bea91f8444b8 in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=bea91f8444b8
author: alexsch
date: Wed Apr 22 13:46:03 2015 +0400
8069361, PR1061: SunGraphics2D.getDefaultTransform() does not include scale factor
Reviewed-by: flar, prr, serb
changeset 8e8854357890 in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=8e8854357890
author: alexsch
date: Mon Jun 27 19:36:44 2016 +0100
8029339, PR1061: Custom MultiResolution image support on HiDPI displays
Reviewed-by: flar, serb
changeset a56192255ebc in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=a56192255ebc
author: alexsch
date: Tue Jun 28 04:05:50 2016 +0100
8073320, PR1061: Windows HiDPI Graphics support
Reviewed-by: flar, serb
changeset d0462c26152f in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=d0462c26152f
author: alexsch
date: Tue Jun 28 19:44:50 2016 +0100
8137571, PR1061: Linux HiDPI Graphics support
Reviewed-by: flar, serb
changeset 9fffaa63c49d in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=9fffaa63c49d
author: ssadetsky
date: Wed Jun 29 18:09:29 2016 +0100
6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate
Reviewed-by: alexsch, azvegint
changeset f65aa11c1f04 in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=f65aa11c1f04
author: ssdetsky
date: Thu Jun 30 03:16:23 2016 +0100
8145547, PR1061: [AWT/Swing] Conditional support for GTK 3 on Linux
Reviewed-by: prr, alexsch
diffstat:
make/lib/Awt2dLibraries.gmk | 2 +
make/mapfiles/libawt/mapfile-vers-linux | 1 +
make/mapfiles/libawt_xawt/mapfile-vers | 2 +
src/macosx/classes/sun/awt/CGraphicsConfig.java | 3 +-
src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java | 7 +-
src/macosx/classes/sun/lwawt/LWWindowPeer.java | 4 +-
src/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java | 24 +-
src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java | 45 +-
src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java | 55 +-
src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java | 21 +-
src/share/classes/sun/awt/SunHints.java | 26 +-
src/share/classes/sun/awt/image/AbstractMultiResolutionImage.java | 64 +-
src/share/classes/sun/awt/image/BaseMultiResolutionImage.java | 150 +
src/share/classes/sun/awt/image/BufImgSurfaceData.java | 101 +-
src/share/classes/sun/awt/image/BufferedImageGraphicsConfig.java | 31 +-
src/share/classes/sun/awt/image/MultiResolutionCachedImage.java | 23 +-
src/share/classes/sun/awt/image/MultiResolutionImage.java | 72 +-
src/share/classes/sun/awt/image/MultiResolutionToolkitImage.java | 17 +-
src/share/classes/sun/awt/image/SunVolatileImage.java | 13 +-
src/share/classes/sun/awt/image/SurfaceManager.java | 24 +-
src/share/classes/sun/awt/image/VolatileSurfaceManager.java | 12 +-
src/share/classes/sun/java2d/SunGraphics2D.java | 261 +-
src/share/classes/sun/java2d/SunGraphicsEnvironment.java | 48 +
src/share/classes/sun/java2d/SurfaceData.java | 16 +-
src/share/classes/sun/java2d/pipe/DrawImage.java | 7 +-
src/solaris/classes/sun/awt/UNIXToolkit.java | 71 +-
src/solaris/classes/sun/awt/X11/InfoWindow.java | 4 +-
src/solaris/classes/sun/awt/X11/XBaseWindow.java | 80 +-
src/solaris/classes/sun/awt/X11/XChoicePeer.java | 2 +-
src/solaris/classes/sun/awt/X11/XComponentPeer.java | 10 +-
src/solaris/classes/sun/awt/X11/XDecoratedPeer.java | 18 +-
src/solaris/classes/sun/awt/X11/XDesktopPeer.java | 9 +-
src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java | 36 +-
src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java | 2 +-
src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java | 28 +-
src/solaris/classes/sun/awt/X11/XMenuBarPeer.java | 2 +-
src/solaris/classes/sun/awt/X11/XMenuWindow.java | 2 +-
src/solaris/classes/sun/awt/X11/XMouseInfoPeer.java | 7 +
src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java | 2 +-
src/solaris/classes/sun/awt/X11/XRobotPeer.java | 11 +-
src/solaris/classes/sun/awt/X11/XToolkit.java | 68 +-
src/solaris/classes/sun/awt/X11/XWM.java | 22 +-
src/solaris/classes/sun/awt/X11/XWarningWindow.java | 8 +-
src/solaris/classes/sun/awt/X11/XWindow.java | 81 +-
src/solaris/classes/sun/awt/X11/XWindowPeer.java | 62 +-
src/solaris/classes/sun/awt/X11/XlibUtil.java | 24 +-
src/solaris/classes/sun/awt/X11GraphicsConfig.java | 26 +-
src/solaris/classes/sun/awt/X11GraphicsDevice.java | 25 +
src/solaris/classes/sun/java2d/xr/XRSurfaceData.java | 42 +-
src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java | 5 +-
src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java | 8 +-
src/solaris/native/sun/awt/awt_GraphicsEnv.c | 35 +
src/solaris/native/sun/awt/awt_Robot.c | 36 +-
src/solaris/native/sun/awt/awt_UNIXToolkit.c | 92 +-
src/solaris/native/sun/awt/gtk2_interface.c | 429 +-
src/solaris/native/sun/awt/gtk2_interface.h | 487 +-
src/solaris/native/sun/awt/gtk3_interface.c | 2875 ++++++++++
src/solaris/native/sun/awt/gtk3_interface.h | 573 +
src/solaris/native/sun/awt/gtk_interface.c | 158 +
src/solaris/native/sun/awt/gtk_interface.h | 549 +
src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c | 78 +-
src/solaris/native/sun/awt/swing_GTKEngine.c | 141 +-
src/solaris/native/sun/awt/swing_GTKStyle.c | 37 +-
src/solaris/native/sun/xawt/awt_Desktop.c | 14 +-
src/solaris/native/sun/xawt/gnome_interface.h | 4 +-
src/windows/classes/sun/awt/Win32GraphicsConfig.java | 6 +-
src/windows/classes/sun/awt/Win32GraphicsDevice.java | 40 +
src/windows/classes/sun/awt/Win32GraphicsEnvironment.java | 18 +
src/windows/classes/sun/awt/windows/WWindowPeer.java | 9 +-
src/windows/classes/sun/java2d/d3d/D3DSurfaceData.java | 38 +-
src/windows/classes/sun/java2d/opengl/WGLSurfaceData.java | 27 +-
src/windows/classes/sun/java2d/windows/GDIWindowSurfaceData.java | 22 +-
src/windows/native/sun/windows/MouseInfo.cpp | 13 +-
src/windows/native/sun/windows/awt_Choice.cpp | 9 +-
src/windows/native/sun/windows/awt_Component.cpp | 61 +-
src/windows/native/sun/windows/awt_Component.h | 5 +
src/windows/native/sun/windows/awt_Font.cpp | 58 +-
src/windows/native/sun/windows/awt_Robot.cpp | 24 +-
src/windows/native/sun/windows/awt_Toolkit.cpp | 16 +-
src/windows/native/sun/windows/awt_Win32GraphicsConfig.cpp | 24 +-
src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp | 168 +
src/windows/native/sun/windows/awt_Win32GraphicsDevice.h | 10 +
src/windows/native/sun/windows/awt_Window.cpp | 93 +-
src/windows/native/sun/windows/awt_Window.h | 1 +
src/windows/resource/java.manifest | 2 +-
test/java/awt/Cursor/MultiResolutionCursorTest/MultiResolutionCursorTest.java | 68 +-
test/java/awt/Graphics2D/ScaledTransform/ScaledTransform.java | 90 +
test/java/awt/Robot/HiDPIMouseClick/HiDPIRobotMouseClick.java | 87 +
test/java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java | 115 +
test/java/awt/hidpi/properties/HiDPIPropertiesLinuxTest.java | 92 +
test/java/awt/hidpi/properties/HiDPIPropertiesWindowsTest.java | 139 +
test/java/awt/image/MultiResolutionImage/MultiResolutionDrawImageWithTransformTest.java | 248 +
test/java/awt/image/MultiResolutionImage/NSImageToMultiResolutionImageTest.java | 5 +-
test/java/awt/image/MultiResolutionImageCommonTest.java | 207 +
test/java/awt/image/MultiResolutionImageTest.java | 288 +-
test/java/awt/image/multiresolution/BaseMultiResolutionImageTest.java | 205 +
test/java/awt/image/multiresolution/MultiResolutionCachedImageTest.java | 2 +-
test/java/awt/image/multiresolution/MultiResolutionRenderingHintsTest.java | 220 +
98 files changed, 8023 insertions(+), 1579 deletions(-)
diffs (truncated from 13274 to 500 lines):
diff -r 954f8b3a950a -r f65aa11c1f04 make/lib/Awt2dLibraries.gmk
--- a/make/lib/Awt2dLibraries.gmk Thu Jul 30 12:40:45 2015 +0400
+++ b/make/lib/Awt2dLibraries.gmk Thu Jun 30 03:16:23 2016 +0100
@@ -611,6 +611,8 @@
debug_util.c \
gnome_interface.c \
gtk2_interface.c \
+ gtk3_interface.c \
+ gtk_interface.c \
swing_GTKEngine.c \
swing_GTKStyle.c \
rect.c \
diff -r 954f8b3a950a -r f65aa11c1f04 make/mapfiles/libawt/mapfile-vers-linux
--- a/make/mapfiles/libawt/mapfile-vers-linux Thu Jul 30 12:40:45 2015 +0400
+++ b/make/mapfiles/libawt/mapfile-vers-linux Thu Jun 30 03:16:23 2016 +0100
@@ -208,6 +208,7 @@
Java_sun_awt_X11GraphicsDevice_enumDisplayModes;
Java_sun_awt_X11GraphicsDevice_configDisplayMode;
Java_sun_awt_X11GraphicsDevice_resetNativeData;
+ Java_sun_awt_X11GraphicsDevice_getNativeScaleFactor;
Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
Java_sun_awt_X11GraphicsEnvironment_getDisplayString;
diff -r 954f8b3a950a -r f65aa11c1f04 make/mapfiles/libawt_xawt/mapfile-vers
--- a/make/mapfiles/libawt_xawt/mapfile-vers Thu Jul 30 12:40:45 2015 +0400
+++ b/make/mapfiles/libawt_xawt/mapfile-vers Thu Jun 30 03:16:23 2016 +0100
@@ -173,6 +173,7 @@
Java_sun_awt_UNIXToolkit_load_1gtk_1icon;
Java_sun_awt_UNIXToolkit_nativeSync;
Java_sun_awt_UNIXToolkit_gtkCheckVersionImpl;
+ Java_sun_awt_UNIXToolkit_get_1gtk_1version;
Java_java_awt_AWTEvent_initIDs;
Java_java_awt_event_InputEvent_initIDs;
Java_java_awt_event_KeyEvent_initIDs;
@@ -214,6 +215,7 @@
Java_sun_awt_X11GraphicsDevice_enumDisplayModes;
Java_sun_awt_X11GraphicsDevice_configDisplayMode;
Java_sun_awt_X11GraphicsDevice_resetNativeData;
+ Java_sun_awt_X11GraphicsDevice_getNativeScaleFactor;
Java_sun_awt_X11GraphicsConfig_initIDs;
Java_sun_awt_X11GraphicsConfig_getXResolution;
Java_sun_awt_X11GraphicsConfig_getYResolution;
diff -r 954f8b3a950a -r f65aa11c1f04 src/macosx/classes/sun/awt/CGraphicsConfig.java
--- a/src/macosx/classes/sun/awt/CGraphicsConfig.java Thu Jul 30 12:40:45 2015 +0400
+++ b/src/macosx/classes/sun/awt/CGraphicsConfig.java Thu Jun 30 03:16:23 2016 +0100
@@ -72,7 +72,8 @@
@Override
public AffineTransform getDefaultTransform() {
- return new AffineTransform();
+ double scaleFactor = device.getScaleFactor();
+ return AffineTransform.getScaleInstance(scaleFactor, scaleFactor);
}
@Override
diff -r 954f8b3a950a -r f65aa11c1f04 src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java
--- a/src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java Thu Jul 30 12:40:45 2015 +0400
+++ b/src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java Thu Jun 30 03:16:23 2016 +0100
@@ -169,7 +169,12 @@
}
@Override
- public int getDefaultScale() {
+ public double getDefaultScaleX() {
+ return scale;
+ }
+
+ @Override
+ public double getDefaultScaleY() {
return scale;
}
diff -r 954f8b3a950a -r f65aa11c1f04 src/macosx/classes/sun/lwawt/LWWindowPeer.java
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java Thu Jul 30 12:40:45 2015 +0400
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java Thu Jun 30 03:16:23 2016 +0100
@@ -1109,7 +1109,9 @@
&& !(dst instanceof NullSurfaceData)
&& !(src instanceof NullSurfaceData)
&& src.getSurfaceType().equals(dst.getSurfaceType())
- && src.getDefaultScale() == dst.getDefaultScale()) {
+ && src.getDefaultScaleX() == dst.getDefaultScaleX()
+ && src.getDefaultScaleY() == dst.getDefaultScaleY())
+ {
final Rectangle size = src.getBounds();
final Blit blit = Blit.locate(src.getSurfaceType(),
CompositeType.Src,
diff -r 954f8b3a950a -r f65aa11c1f04 src/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java Thu Jul 30 12:40:45 2015 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java Thu Jun 30 03:16:23 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,9 @@
*/
static enum Settings {
GTK_FONT_NAME,
- GTK_ICON_SIZES
+ GTK_ICON_SIZES,
+ GTK_CURSOR_BLINK,
+ GTK_CURSOR_BLINK_TIME
}
/* Custom regions are needed for representing regions that don't exist
@@ -156,8 +158,8 @@
int widgetType, int state, int shadowType, String detail,
int x, int y, int width, int height, int synthState, int dir);
private native void native_paint_slider(
- int widgetType, int state, int shadowType, String detail,
- int x, int y, int width, int height, int orientation);
+ int widgetType, int state, int shadowType, String detail, int x,
+ int y, int width, int height, int orientation, boolean hasFocus);
private native void native_paint_vline(
int widgetType, int state, String detail,
int x, int y, int width, int height);
@@ -489,6 +491,14 @@
int gtkState =
GTKLookAndFeel.synthStateToGTKStateType(state).ordinal();
int synthState = context.getComponentState();
+ Container parent = context.getComponent().getParent();
+ if(GTKLookAndFeel.is3()) {
+ if (parent != null && parent.getParent() instanceof JComboBox) {
+ if (parent.getParent().hasFocus()) {
+ synthState |= SynthConstants.FOCUSED;
+ }
+ }
+ }
int dir = getTextDirection(context);
int widget = getWidgetType(context.getComponent(), id).ordinal();
native_paint_shadow(widget, gtkState, shadowType.ordinal(), detail,
@@ -496,13 +506,13 @@
}
public void paintSlider(Graphics g, SynthContext context,
- Region id, int state, ShadowType shadowType, String detail,
- int x, int y, int w, int h, Orientation orientation) {
+ Region id, int state, ShadowType shadowType, String detail, int x,
+ int y, int w, int h, Orientation orientation, boolean hasFocus) {
state = GTKLookAndFeel.synthStateToGTKStateType(state).ordinal();
int widget = getWidgetType(context.getComponent(), id).ordinal();
native_paint_slider(widget, state, shadowType.ordinal(), detail,
- x - x0, y - y0, w, h, orientation.ordinal());
+ x - x0, y - y0, w, h, orientation.ordinal(), hasFocus);
}
public void paintVline(Graphics g, SynthContext context,
diff -r 954f8b3a950a -r f65aa11c1f04 src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Thu Jul 30 12:40:45 2015 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Thu Jun 30 03:16:23 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,8 @@
* @author Scott Violet
*/
public class GTKLookAndFeel extends SynthLookAndFeel {
- private static final boolean IS_22;
+ private static boolean IS_22;
+ private static boolean IS_3;
/**
* Whether or not text is drawn antialiased. This keys off the
@@ -105,17 +106,6 @@
private static String gtkThemeName = "Default";
static {
- // Backup for specifying the version, this isn't currently documented.
- // If you pass in anything but 2.2 you got the 2.0 colors/look.
- String version = AccessController.doPrivileged(
- new GetPropertyAction("swing.gtk.version"));
- if (version != null) {
- IS_22 = version.equals("2.2");
- }
- else {
- IS_22 = true;
- }
-
String language = Locale.getDefault().getLanguage();
boolean cjkLocale =
(Locale.CHINESE.getLanguage().equals(language) ||
@@ -156,6 +146,10 @@
return IS_22;
}
+ static boolean is3() {
+ return IS_3;
+ }
+
/**
* Maps a swing constant to a GTK constant.
*/
@@ -371,7 +365,17 @@
int vProgWidth = 22 - (progXThickness * 2);
int vProgHeight = 80 - (progYThickness * 2);
- Integer caretBlinkRate = Integer.valueOf(500);
+ Integer caretBlinkRate;
+ if (Boolean.FALSE.equals(GTKEngine.INSTANCE.getSetting(
+ GTKEngine.Settings.GTK_CURSOR_BLINK))) {
+ caretBlinkRate = Integer.valueOf(0);
+ } else {
+ caretBlinkRate = (Integer) GTKEngine.INSTANCE.getSetting(
+ GTKEngine.Settings.GTK_CURSOR_BLINK_TIME);
+ if (caretBlinkRate == null) {
+ caretBlinkRate = Integer.valueOf(500);
+ }
+ }
Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0);
Double defaultCaretAspectRatio = new Double(0.025);
@@ -1447,6 +1451,19 @@
throw new InternalError("Unable to load native GTK libraries");
}
+ if (UNIXToolkit.getGtkVersion() == UNIXToolkit.GtkVersions.GTK2) {
+ String version = AccessController.doPrivileged(
+ new GetPropertyAction("jdk.gtk.version"));
+ if (version != null) {
+ IS_22 = version.equals("2.2");
+ } else {
+ IS_22 = true;
+ }
+ } else if (UNIXToolkit.getGtkVersion() ==
+ UNIXToolkit.GtkVersions.GTK3) {
+ IS_3 = true;
+ }
+
super.initialize();
inInitialize = true;
loadStyles();
diff -r 954f8b3a950a -r f65aa11c1f04 src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java Thu Jul 30 12:40:45 2015 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java Thu Jun 30 03:16:23 2016 +0100
@@ -743,6 +743,15 @@
// The ubuntulooks engine paints slider troughs differently depending
// on the current slider value and its component orientation.
JSlider slider = (JSlider)context.getComponent();
+ if (GTKLookAndFeel.is3()) {
+ if (slider.getOrientation() == JSlider.VERTICAL) {
+ y += 1;
+ h -= 2;
+ } else {
+ x += 1;
+ w -= 2;
+ }
+ }
double value = slider.getValue();
double min = slider.getMinimum();
double max = slider.getMaximum();
@@ -776,15 +785,19 @@
Region id = context.getRegion();
int gtkState = GTKLookAndFeel.synthStateToGTKState(
id, context.getComponentState());
+ boolean hasFocus = GTKLookAndFeel.is3() &&
+ ((context.getComponentState() & SynthConstants.FOCUSED) != 0);
synchronized (UNIXToolkit.GTK_LOCK) {
- if (! ENGINE.paintCachedImage(g, x, y, w, h, id, gtkState, dir)) {
+ if (! ENGINE.paintCachedImage(g, x, y, w, h, id, gtkState, dir,
+ hasFocus)) {
Orientation orientation = (dir == JSlider.HORIZONTAL ?
Orientation.HORIZONTAL : Orientation.VERTICAL);
String detail = (dir == JSlider.HORIZONTAL ?
"hscale" : "vscale");
ENGINE.startPainting(g, x, y, w, h, id, gtkState, dir);
ENGINE.paintSlider(g, context, id, gtkState,
- ShadowType.OUT, detail, x, y, w, h, orientation);
+ ShadowType.OUT, detail, x, y, w, h, orientation,
+ hasFocus);
ENGINE.finishPainting();
}
}
@@ -963,15 +976,21 @@
int yThickness = style.getYThickness();
ENGINE.startPainting(g, x, y, w, h, id, state);
+ if (GTKLookAndFeel.is3()) {
+ ENGINE.paintBackground(g, context, id, gtkState, null,
+ x, y, w, h);
+ }
ENGINE.paintShadow(g, context, id, gtkState,
ShadowType.IN, "entry", x, y, w, h);
- ENGINE.paintFlatBox(g, context, id,
- gtkState, ShadowType.NONE, "entry_bg",
- x + xThickness,
- y + yThickness,
- w - (2 * xThickness),
- h - (2 * yThickness),
- ColorType.TEXT_BACKGROUND);
+ if (!GTKLookAndFeel.is3()) {
+ ENGINE.paintFlatBox(g, context, id,
+ gtkState, ShadowType.NONE, "entry_bg",
+ x + xThickness,
+ y + yThickness,
+ w - (2 * xThickness),
+ h - (2 * yThickness),
+ ColorType.TEXT_BACKGROUND);
+ }
if (focusSize > 0 && (state & SynthConstants.FOCUSED) != 0) {
if (!interiorFocus) {
@@ -982,14 +1001,14 @@
} else {
if (containerParent instanceof JComboBox) {
x += (focusSize + 2);
- y += (focusSize + 1);
- w -= (2 * focusSize + 1);
- h -= (2 * focusSize + 2);
+ y += focusSize + (GTKLookAndFeel.is3() ? 3 : 1);
+ w -= 2 * focusSize + (GTKLookAndFeel.is3() ? 4 : 1);
+ h -= 2 * focusSize + (GTKLookAndFeel.is3() ? 6 : 2);
} else {
- x += focusSize;
- y += focusSize;
- w -= 2 * focusSize;
- h -= 2 * focusSize;
+ x += focusSize + (GTKLookAndFeel.is3() ? 2 : 0);
+ y += focusSize + (GTKLookAndFeel.is3() ? 2 :0 );
+ w -= 2 * focusSize + (GTKLookAndFeel.is3() ? 4 : 0);
+ h -= 2 * focusSize + (GTKLookAndFeel.is3() ? 4 : 0);
}
}
ENGINE.paintFocus(g, context, id, gtkState,
@@ -1138,8 +1157,8 @@
Orientation orientation = (dir == JScrollBar.HORIZONTAL ?
Orientation.HORIZONTAL : Orientation.VERTICAL);
ENGINE.setRangeValue(context, id, value, min, max, visible);
- ENGINE.paintSlider(g, context, id, gtkState,
- ShadowType.OUT, "slider", x, y, w, h, orientation);
+ ENGINE.paintSlider(g, context, id, gtkState, ShadowType.OUT,
+ "slider", x, y, w, h, orientation, false);
ENGINE.finishPainting();
}
}
diff -r 954f8b3a950a -r f65aa11c1f04 src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Thu Jul 30 12:40:45 2015 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Thu Jun 30 03:16:23 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -710,29 +710,33 @@
if (region == Region.COMBO_BOX ||
region == Region.DESKTOP_PANE ||
region == Region.DESKTOP_ICON ||
- region == Region.EDITOR_PANE ||
- region == Region.FORMATTED_TEXT_FIELD ||
region == Region.INTERNAL_FRAME ||
region == Region.LIST ||
region == Region.MENU_BAR ||
region == Region.PANEL ||
- region == Region.PASSWORD_FIELD ||
region == Region.POPUP_MENU ||
region == Region.PROGRESS_BAR ||
region == Region.ROOT_PANE ||
region == Region.SCROLL_PANE ||
- region == Region.SPINNER ||
region == Region.SPLIT_PANE_DIVIDER ||
region == Region.TABLE ||
region == Region.TEXT_AREA ||
- region == Region.TEXT_FIELD ||
- region == Region.TEXT_PANE ||
region == Region.TOOL_BAR_DRAG_WINDOW ||
region == Region.TOOL_TIP ||
region == Region.TREE ||
region == Region.VIEWPORT) {
return true;
}
+ if (!GTKLookAndFeel.is3()) {
+ if (region == Region.EDITOR_PANE ||
+ region == Region.FORMATTED_TEXT_FIELD ||
+ region == Region.PASSWORD_FIELD ||
+ region == Region.SPINNER ||
+ region == Region.TEXT_FIELD ||
+ region == Region.TEXT_PANE) {
+ return true;
+ }
+ }
Component c = context.getComponent();
String name = c.getName();
if (name == "ComboBox.renderer" || name == "ComboBox.listRenderer") {
@@ -828,6 +832,8 @@
int focusPad =
getClassSpecificIntValue(context, "focus-padding", 1);
return indicatorSpacing + focusSize + focusPad;
+ } else if (GTKLookAndFeel.is3() && "ComboBox.forceOpaque".equals(key)) {
+ return true;
}
// Is it a stock icon ?
@@ -1107,6 +1113,7 @@
static {
CLASS_SPECIFIC_MAP = new HashMap<String,String>();
CLASS_SPECIFIC_MAP.put("Slider.thumbHeight", "slider-width");
+ CLASS_SPECIFIC_MAP.put("Slider.thumbWidth", "slider-length");
CLASS_SPECIFIC_MAP.put("Slider.trackBorder", "trough-border");
CLASS_SPECIFIC_MAP.put("SplitPane.size", "handle-size");
CLASS_SPECIFIC_MAP.put("Tree.expanderSize", "expander-size");
diff -r 954f8b3a950a -r f65aa11c1f04 src/share/classes/sun/awt/SunHints.java
--- a/src/share/classes/sun/awt/SunHints.java Thu Jul 30 12:40:45 2015 +0400
+++ b/src/share/classes/sun/awt/SunHints.java Thu Jun 30 03:16:23 2016 +0100
@@ -257,8 +257,10 @@
*/
@Native public static final int INTKEY_RESOLUTION_VARIANT = 9;
@Native public static final int INTVAL_RESOLUTION_VARIANT_DEFAULT = 0;
- @Native public static final int INTVAL_RESOLUTION_VARIANT_OFF = 1;
- @Native public static final int INTVAL_RESOLUTION_VARIANT_ON = 2;
+ @Native public static final int INTVAL_RESOLUTION_VARIANT_BASE = 1;
+ @Native public static final int INTVAL_RESOLUTION_VARIANT_SIZE_FIT = 2;
+ @Native public static final int INTVAL_RESOLUTION_VARIANT_DPI_FIT = 3;
+
/**
* LCD text contrast control hint key.
* Value is "100" to make discontiguous with the others which
@@ -466,15 +468,23 @@
public static final Object VALUE_RESOLUTION_VARIANT_DEFAULT =
new SunHints.Value(KEY_RESOLUTION_VARIANT,
SunHints.INTVAL_RESOLUTION_VARIANT_DEFAULT,
- "Choose image resolutions based on a default heuristic");
- public static final Object VALUE_RESOLUTION_VARIANT_OFF =
+ "Choose image resolutions based on a default"
+ + "heuristic");
+ public static final Object VALUE_RESOLUTION_VARIANT_BASE =
new SunHints.Value(KEY_RESOLUTION_VARIANT,
- SunHints.INTVAL_RESOLUTION_VARIANT_OFF,
+ SunHints.INTVAL_RESOLUTION_VARIANT_BASE,
"Use only the standard resolution of an image");
- public static final Object VALUE_RESOLUTION_VARIANT_ON =
+ public static final Object VALUE_RESOLUTION_VARIANT_SIZE_FIT =
new SunHints.Value(KEY_RESOLUTION_VARIANT,
- SunHints.INTVAL_RESOLUTION_VARIANT_ON,
- "Always use resolution-specific variants of images");
+ SunHints.INTVAL_RESOLUTION_VARIANT_SIZE_FIT,
+ "Choose image resolutions based on the DPI"
+ + "of the screen and transform"
+ + "in the Graphics2D context");
+ public static final Object VALUE_RESOLUTION_VARIANT_DPI_FIT =
+ new SunHints.Value(KEY_RESOLUTION_VARIANT,
+ SunHints.INTVAL_RESOLUTION_VARIANT_DPI_FIT,
+ "Choose image resolutions based only on the DPI"
+ + " of the screen");
public static class LCDContrastKey extends Key {
diff -r 954f8b3a950a -r f65aa11c1f04 src/share/classes/sun/awt/image/AbstractMultiResolutionImage.java
--- a/src/share/classes/sun/awt/image/AbstractMultiResolutionImage.java Thu Jul 30 12:40:45 2015 +0400
+++ b/src/share/classes/sun/awt/image/AbstractMultiResolutionImage.java Thu Jun 30 03:16:23 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,43 +29,33 @@
import java.awt.image.*;
/**
- * This class provides default implementations for the
- * <code>MultiResolutionImage</code> interface. The developer needs only
- * to subclass this abstract class and define the <code>getResolutionVariant</code>,
- * <code>getResolutionVariants</code>, and <code>getBaseImage</code> methods.
- *
+ * This class provides default implementations of several {@code Image} methods
+ * for classes that want to implement the {@MultiResolutionImage} interface.
*
* For example,
- * {@code
+ * <pre> {@code
* public class CustomMultiResolutionImage extends AbstractMultiResolutionImage {
*
- * int baseImageIndex;
- * Image[] resolutionVariants;
+ * final Image[] resolutionVariants;
*
- * public CustomMultiResolutionImage(int baseImageIndex,
- * Image... resolutionVariants) {
- * this.baseImageIndex = baseImageIndex;
+ * public CustomMultiResolutionImage(Image... resolutionVariants) {
* this.resolutionVariants = resolutionVariants;
* }
*
- * @Override
- * public Image getResolutionVariant(float logicalDPIX, float logicalDPIY,
- * float baseImageWidth, float baseImageHeight,
- * float destImageWidth, float destImageHeight) {
- * // return a resolution variant based on the given logical DPI,
- * // base image size, or destination image size
+ * public Image getResolutionVariant(
+ * double destImageWidth, double destImageHeight) {
More information about the distro-pkg-dev
mailing list