Skip to content

Commit ef37669

Browse files
Merge
2 parents f2bca9f + 5906521 commit ef37669

File tree

37 files changed

+2020
-95
lines changed

37 files changed

+2020
-95
lines changed

build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -3571,6 +3571,7 @@ project(":systemTests") {
35713571
testapp4
35723572
testapp5
35733573
testapp6
3574+
testscriptapp1
35743575
}
35753576

35763577
def nonModSrcSets = [
@@ -3583,7 +3584,8 @@ project(":systemTests") {
35833584
sourceSets.testapp3,
35843585
sourceSets.testapp4,
35853586
sourceSets.testapp5,
3586-
sourceSets.testapp6
3587+
sourceSets.testapp6,
3588+
sourceSets.testscriptapp1
35873589
]
35883590

35893591
project.ext.buildModule = false
@@ -3683,7 +3685,7 @@ project(":systemTests") {
36833685
}
36843686
test.dependsOn(createTestApps);
36853687

3686-
def modtestapps = [ "testapp2", "testapp3", "testapp4", "testapp5", "testapp6" ]
3688+
def modtestapps = [ "testapp2", "testapp3", "testapp4", "testapp5", "testapp6", "testscriptapp1" ]
36873689
modtestapps.each { testapp ->
36883690
def testappCapital = testapp.capitalize()
36893691
def copyTestAppTask = task("copy${testappCapital}", type: Copy) {

build.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ javadoc.header=JavaFX 15
7373
##############################################################################
7474

7575
# JDK
76-
jfx.build.jdk.version=13.0.1
77-
jfx.build.jdk.buildnum=9
76+
jfx.build.jdk.version=14
77+
jfx.build.jdk.buildnum=36
7878
jfx.build.jdk.version.min=11
7979
jfx.build.jdk.buildnum.min=28
8080

@@ -84,7 +84,7 @@ jfx.build.jdk.buildnum.min=28
8484
# gradle/legal/gradle.md.
8585
# The jfx.gradle.version.min property defines the minimum version of gradle
8686
# that is supported. It must be <= jfx.gradle.version.
87-
jfx.gradle.version=6.0
87+
jfx.gradle.version=6.3
8888
jfx.gradle.version.min=5.3
8989

9090
# Toolchains

buildSrc/linux.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if (hasProperty('toolchainDir')) {
7979
toolchainDir = ""
8080
}
8181

82-
def gtk2CCFlags = [ ];
82+
def gtk2CCFlags = [ "-Wno-deprecated-declarations" ];
8383
def gtk3CCFlags = [ "-Wno-deprecated-declarations" ];
8484
def gtk2LinkFlags = [ ];
8585
def gtk3LinkFlags = [ ];

gradle/legal/gradle.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Gradle v6.0
1+
## Gradle v6.3
22

33
### Apache 2.0 License
44
```
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

modules/javafx.base/src/main/java/com/sun/javafx/binding/BidirectionalBinding.java

+7-12
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
package com.sun.javafx.binding;
2727

28-
import javafx.beans.Observable;
2928
import javafx.beans.WeakListener;
3029
import javafx.beans.property.*;
3130
import javafx.beans.value.ChangeListener;
@@ -35,13 +34,13 @@
3534
import java.lang.ref.WeakReference;
3635
import java.text.Format;
3736
import java.text.ParseException;
37+
import java.util.Objects;
3838

3939
public abstract class BidirectionalBinding<T> implements ChangeListener<T>, WeakListener {
4040

4141
private static void checkParameters(Object property1, Object property2) {
42-
if ((property1 == null) || (property2 == null)) {
43-
throw new NullPointerException("Both properties must be specified.");
44-
}
42+
Objects.requireNonNull(property1, "Both properties must be specified.");
43+
Objects.requireNonNull(property2, "Both properties must be specified.");
4544
if (property1 == property2) {
4645
throw new IllegalArgumentException("Cannot bind property to itself");
4746
}
@@ -69,10 +68,8 @@ public static <T> BidirectionalBinding bind(Property<T> property1, Property<T> p
6968

7069
public static Object bind(Property<String> stringProperty, Property<?> otherProperty, Format format) {
7170
checkParameters(stringProperty, otherProperty);
72-
if (format == null) {
73-
throw new NullPointerException("Format cannot be null");
74-
}
75-
final StringConversionBidirectionalBinding<?> binding = new StringFormatBidirectionalBinding(stringProperty, otherProperty, format);
71+
Objects.requireNonNull(format, "Format cannot be null");
72+
final var binding = new StringFormatBidirectionalBinding(stringProperty, otherProperty, format);
7673
stringProperty.setValue(format.format(otherProperty.getValue()));
7774
stringProperty.addListener(binding);
7875
otherProperty.addListener(binding);
@@ -81,10 +78,8 @@ public static Object bind(Property<String> stringProperty, Property<?> otherProp
8178

8279
public static <T> Object bind(Property<String> stringProperty, Property<T> otherProperty, StringConverter<T> converter) {
8380
checkParameters(stringProperty, otherProperty);
84-
if (converter == null) {
85-
throw new NullPointerException("Converter cannot be null");
86-
}
87-
final StringConversionBidirectionalBinding<T> binding = new StringConverterBidirectionalBinding<T>(stringProperty, otherProperty, converter);
81+
Objects.requireNonNull(converter, "Converter cannot be null");
82+
final var binding = new StringConverterBidirectionalBinding<>(stringProperty, otherProperty, converter);
8883
stringProperty.setValue(converter.toString(otherProperty.getValue()));
8984
stringProperty.addListener(binding);
9085
otherProperty.addListener(binding);

modules/javafx.base/src/main/java/javafx/beans/property/BooleanProperty.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
package javafx.beans.property;
2727

28+
import java.util.Objects;
29+
2830
import com.sun.javafx.binding.BidirectionalBinding;
2931
import javafx.beans.binding.Bindings;
3032
import javafx.beans.value.ObservableValue;
@@ -133,9 +135,7 @@ public String toString() {
133135
* @since JavaFX 8.0
134136
*/
135137
public static BooleanProperty booleanProperty(final Property<Boolean> property) {
136-
if (property == null) {
137-
throw new NullPointerException("Property cannot be null");
138-
}
138+
Objects.requireNonNull(property, "Property cannot be null");
139139
return property instanceof BooleanProperty ? (BooleanProperty)property : new BooleanPropertyBase() {
140140
{
141141
BidirectionalBinding.bind(this, property);
@@ -164,7 +164,7 @@ public String getName() {
164164
*/
165165
@Override
166166
public ObjectProperty<Boolean> asObject() {
167-
return new ObjectPropertyBase<Boolean> () {
167+
return new ObjectPropertyBase<> () {
168168
{
169169
BidirectionalBinding.bind(this, BooleanProperty.this);
170170
}

modules/javafx.base/src/main/java/javafx/beans/property/DoubleProperty.java

+6-13
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,14 @@
2525

2626
package javafx.beans.property;
2727

28+
import java.util.Objects;
29+
2830
import com.sun.javafx.binding.BidirectionalBinding;
29-
import com.sun.javafx.binding.ExpressionHelper;
31+
import com.sun.javafx.binding.Logging;
32+
3033
import javafx.beans.binding.Bindings;
3134
import javafx.beans.value.ObservableValue;
3235
import javafx.beans.value.WritableDoubleValue;
33-
import com.sun.javafx.binding.Logging;
34-
import javafx.beans.InvalidationListener;
35-
import javafx.beans.Observable;
36-
import javafx.beans.WeakInvalidationListener;
37-
import javafx.beans.value.ChangeListener;
38-
import javafx.beans.value.ObservableDoubleValue;
3936

4037
/**
4138
* This class defines a {@link Property} wrapping a {@code double} value.
@@ -148,9 +145,7 @@ public String toString() {
148145
* @since JavaFX 8.0
149146
*/
150147
public static DoubleProperty doubleProperty(final Property<Double> property) {
151-
if (property == null) {
152-
throw new NullPointerException("Property cannot be null");
153-
}
148+
Objects.requireNonNull(property, "Property cannot be null");
154149
return new DoublePropertyBase() {
155150
{
156151
BidirectionalBinding.bindNumber(this, property);
@@ -189,7 +184,7 @@ public String getName() {
189184
*/
190185
@Override
191186
public ObjectProperty<Double> asObject() {
192-
return new ObjectPropertyBase<Double> () {
187+
return new ObjectPropertyBase<> () {
193188
{
194189
BidirectionalBinding.bindNumber(this, DoubleProperty.this);
195190
}
@@ -205,6 +200,4 @@ public String getName() {
205200
}
206201
};
207202
}
208-
209-
210203
}

modules/javafx.base/src/main/java/javafx/beans/property/FloatProperty.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
package javafx.beans.property;
2727

28+
import java.util.Objects;
29+
2830
import com.sun.javafx.binding.BidirectionalBinding;
2931
import javafx.beans.binding.Bindings;
3032
import javafx.beans.value.ObservableValue;
@@ -142,10 +144,8 @@ public String toString() {
142144
* @see #asObject()
143145
* @since JavaFX 8.0
144146
*/
145-
public static FloatProperty floatProperty(final Property<Float> property) {
146-
if (property == null) {
147-
throw new NullPointerException("Property cannot be null");
148-
}
147+
public static FloatProperty floatProperty(final Property<Float> property) {
148+
Objects.requireNonNull(property, "Property cannot be null");
149149
return new FloatPropertyBase() {
150150
{
151151
BidirectionalBinding.bindNumber(this, property);
@@ -184,7 +184,7 @@ public String getName() {
184184
*/
185185
@Override
186186
public ObjectProperty<Float> asObject() {
187-
return new ObjectPropertyBase<Float> () {
187+
return new ObjectPropertyBase<> () {
188188
{
189189
BidirectionalBinding.bindNumber(this, FloatProperty.this);
190190
}
@@ -200,5 +200,4 @@ public String getName() {
200200
}
201201
};
202202
}
203-
204203
}

modules/javafx.base/src/main/java/javafx/beans/property/IntegerProperty.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
package javafx.beans.property;
2727

28+
import java.util.Objects;
29+
2830
import com.sun.javafx.binding.BidirectionalBinding;
2931
import javafx.beans.binding.Bindings;
3032
import javafx.beans.value.ObservableValue;
@@ -142,10 +144,8 @@ public String toString() {
142144
* @see #asObject()
143145
* @since JavaFX 8.0
144146
*/
145-
public static IntegerProperty integerProperty(final Property<Integer> property) {
146-
if (property == null) {
147-
throw new NullPointerException("Property cannot be null");
148-
}
147+
public static IntegerProperty integerProperty(final Property<Integer> property) {
148+
Objects.requireNonNull(property, "Property cannot be null");
149149
return new IntegerPropertyBase() {
150150
{
151151
BidirectionalBinding.bindNumber(this, property);
@@ -184,7 +184,7 @@ public String getName() {
184184
*/
185185
@Override
186186
public ObjectProperty<Integer> asObject() {
187-
return new ObjectPropertyBase<Integer> () {
187+
return new ObjectPropertyBase<> () {
188188
{
189189
BidirectionalBinding.bindNumber(this, IntegerProperty.this);
190190
}

modules/javafx.base/src/main/java/javafx/beans/property/LongProperty.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
package javafx.beans.property;
2727

28+
import java.util.Objects;
29+
2830
import com.sun.javafx.binding.BidirectionalBinding;
2931
import javafx.beans.binding.Bindings;
3032
import javafx.beans.value.ObservableValue;
@@ -140,10 +142,8 @@ public String toString() {
140142
* @see #asObject()
141143
* @since JavaFX 8.0
142144
*/
143-
public static LongProperty longProperty(final Property<Long> property) {
144-
if (property == null) {
145-
throw new NullPointerException("Property cannot be null");
146-
}
145+
public static LongProperty longProperty(final Property<Long> property) {
146+
Objects.requireNonNull(property, "Property cannot be null");
147147
return new LongPropertyBase() {
148148
{
149149
BidirectionalBinding.bindNumber(this, property);
@@ -182,7 +182,7 @@ public String getName() {
182182
*/
183183
@Override
184184
public ObjectProperty<Long> asObject() {
185-
return new ObjectPropertyBase<Long> () {
185+
return new ObjectPropertyBase<> () {
186186
{
187187
BidirectionalBinding.bindNumber(this, LongProperty.this);
188188
}

modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/behavior/TableViewBehaviorBase.java

+27-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -146,20 +146,20 @@ public TableViewBehaviorBase(C control) {
146146
new KeyMapping(PAGE_UP, e -> scrollUp()),
147147
new KeyMapping(PAGE_DOWN, e -> scrollDown()),
148148

149-
new KeyMapping(LEFT, e -> selectLeftCell()),
150-
new KeyMapping(KP_LEFT, e -> selectLeftCell()),
151-
new KeyMapping(RIGHT, e -> selectRightCell()),
152-
new KeyMapping(KP_RIGHT, e -> selectRightCell()),
149+
new KeyMapping(LEFT, e -> { if(isRTL()) selectRightCell(); else selectLeftCell(); }),
150+
new KeyMapping(KP_LEFT,e -> { if(isRTL()) selectRightCell(); else selectLeftCell(); }),
151+
new KeyMapping(RIGHT, e -> { if(isRTL()) selectLeftCell(); else selectRightCell(); }),
152+
new KeyMapping(KP_RIGHT, e -> { if(isRTL()) selectLeftCell(); else selectRightCell(); }),
153153

154154
new KeyMapping(UP, e -> selectPreviousRow()),
155155
new KeyMapping(KP_UP, e -> selectPreviousRow()),
156156
new KeyMapping(DOWN, e -> selectNextRow()),
157157
new KeyMapping(KP_DOWN, e -> selectNextRow()),
158158

159-
new KeyMapping(LEFT, FocusTraversalInputMap::traverseLeft),
160-
new KeyMapping(KP_LEFT, FocusTraversalInputMap::traverseLeft),
161-
new KeyMapping(RIGHT, FocusTraversalInputMap::traverseRight),
162-
new KeyMapping(KP_RIGHT, FocusTraversalInputMap::traverseRight),
159+
new KeyMapping(LEFT, e -> { if(isRTL()) focusTraverseRight(); else focusTraverseLeft(); }),
160+
new KeyMapping(KP_LEFT, e -> { if(isRTL()) focusTraverseRight(); else focusTraverseLeft(); }),
161+
new KeyMapping(RIGHT, e -> { if(isRTL()) focusTraverseLeft(); else focusTraverseRight(); }),
162+
new KeyMapping(KP_RIGHT, e -> { if(isRTL()) focusTraverseLeft(); else focusTraverseRight(); }),
163163
new KeyMapping(UP, FocusTraversalInputMap::traverseUp),
164164
new KeyMapping(KP_UP, FocusTraversalInputMap::traverseUp),
165165
new KeyMapping(DOWN, FocusTraversalInputMap::traverseDown),
@@ -178,17 +178,17 @@ public TableViewBehaviorBase(C control) {
178178
new KeyMapping(new KeyBinding(SPACE).shift(), e -> selectAllToFocus(false)),
179179
new KeyMapping(new KeyBinding(SPACE).shortcut().shift(), e -> selectAllToFocus(true)),
180180

181-
new KeyMapping(new KeyBinding(LEFT).shift(), e -> alsoSelectLeftCell()),
182-
new KeyMapping(new KeyBinding(KP_LEFT).shift(), e -> alsoSelectLeftCell()),
183-
new KeyMapping(new KeyBinding(RIGHT).shift(), e -> alsoSelectRightCell()),
184-
new KeyMapping(new KeyBinding(KP_RIGHT).shift(), e -> alsoSelectRightCell()),
181+
new KeyMapping(new KeyBinding(LEFT).shift(), e -> { if(isRTL()) alsoSelectRightCell(); else alsoSelectLeftCell(); }),
182+
new KeyMapping(new KeyBinding(KP_LEFT).shift(), e -> { if(isRTL()) alsoSelectRightCell(); else alsoSelectLeftCell(); }),
183+
new KeyMapping(new KeyBinding(RIGHT).shift(), e -> { if(isRTL()) alsoSelectLeftCell(); else alsoSelectRightCell(); }),
184+
new KeyMapping(new KeyBinding(KP_RIGHT).shift(), e -> { if(isRTL()) alsoSelectLeftCell(); else alsoSelectRightCell(); }),
185185

186186
new KeyMapping(new KeyBinding(UP).shortcut(), e -> focusPreviousRow()),
187187
new KeyMapping(new KeyBinding(DOWN).shortcut(), e -> focusNextRow()),
188-
new KeyMapping(new KeyBinding(RIGHT).shortcut(), e -> focusRightCell()),
189-
new KeyMapping(new KeyBinding(KP_RIGHT).shortcut(), e -> focusRightCell()),
190-
new KeyMapping(new KeyBinding(LEFT).shortcut(), e -> focusLeftCell()),
191-
new KeyMapping(new KeyBinding(KP_LEFT).shortcut(), e -> focusLeftCell()),
188+
new KeyMapping(new KeyBinding(RIGHT).shortcut(), e -> { if(isRTL()) focusLeftCell(); else focusRightCell(); }),
189+
new KeyMapping(new KeyBinding(KP_RIGHT).shortcut(), e -> { if(isRTL()) focusLeftCell(); else focusRightCell(); }),
190+
new KeyMapping(new KeyBinding(LEFT).shortcut(), e -> { if(isRTL()) focusRightCell(); else focusLeftCell(); }),
191+
new KeyMapping(new KeyBinding(KP_LEFT).shortcut(), e -> { if(isRTL()) focusRightCell(); else focusLeftCell(); }),
192192

193193
new KeyMapping(new KeyBinding(A).shortcut(), e -> selectAll()),
194194
new KeyMapping(new KeyBinding(HOME).shortcut(), e -> focusFirstRow()),
@@ -198,8 +198,8 @@ public TableViewBehaviorBase(C control) {
198198

199199
new KeyMapping(new KeyBinding(UP).shortcut().shift(), e -> discontinuousSelectPreviousRow()),
200200
new KeyMapping(new KeyBinding(DOWN).shortcut().shift(), e -> discontinuousSelectNextRow()),
201-
new KeyMapping(new KeyBinding(LEFT).shortcut().shift(), e -> discontinuousSelectPreviousColumn()),
202-
new KeyMapping(new KeyBinding(RIGHT).shortcut().shift(), e -> discontinuousSelectNextColumn()),
201+
new KeyMapping(new KeyBinding(LEFT).shortcut().shift(), e -> { if(isRTL()) discontinuousSelectNextColumn(); else discontinuousSelectPreviousColumn(); }),
202+
new KeyMapping(new KeyBinding(RIGHT).shortcut().shift(), e -> { if(isRTL()) discontinuousSelectPreviousColumn(); else discontinuousSelectNextColumn(); }),
203203
new KeyMapping(new KeyBinding(PAGE_UP).shortcut().shift(), e -> discontinuousSelectPageUp()),
204204
new KeyMapping(new KeyBinding(PAGE_DOWN).shortcut().shift(), e -> discontinuousSelectPageDown()),
205205
new KeyMapping(new KeyBinding(HOME).shortcut().shift(), e -> discontinuousSelectAllToFirstRow()),
@@ -1309,4 +1309,12 @@ protected void discontinuousSelectAllToLastRow() {
13091309

13101310
if (onMoveToLastCell != null) onMoveToLastCell.run();
13111311
}
1312+
1313+
private EventHandler<KeyEvent> focusTraverseLeft() {
1314+
return FocusTraversalInputMap::traverseLeft;
1315+
}
1316+
1317+
private EventHandler<KeyEvent> focusTraverseRight() {
1318+
return FocusTraversalInputMap::traverseRight;
1319+
}
13121320
}

0 commit comments

Comments
 (0)