Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrushforth committed Apr 3, 2020
2 parents d2346b8 + ef37669 commit d299465
Show file tree
Hide file tree
Showing 37 changed files with 2,020 additions and 95 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3571,6 +3571,7 @@ project(":systemTests") {
testapp4
testapp5
testapp6
testscriptapp1
}

def nonModSrcSets = [
Expand All @@ -3583,7 +3584,8 @@ project(":systemTests") {
sourceSets.testapp3,
sourceSets.testapp4,
sourceSets.testapp5,
sourceSets.testapp6
sourceSets.testapp6,
sourceSets.testscriptapp1
]

project.ext.buildModule = false
Expand Down Expand Up @@ -3683,7 +3685,7 @@ project(":systemTests") {
}
test.dependsOn(createTestApps);

def modtestapps = [ "testapp2", "testapp3", "testapp4", "testapp5", "testapp6" ]
def modtestapps = [ "testapp2", "testapp3", "testapp4", "testapp5", "testapp6", "testscriptapp1" ]
modtestapps.each { testapp ->
def testappCapital = testapp.capitalize()
def copyTestAppTask = task("copy${testappCapital}", type: Copy) {
Expand Down
6 changes: 3 additions & 3 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ javadoc.header=JavaFX 15
##############################################################################

# JDK
jfx.build.jdk.version=13.0.1
jfx.build.jdk.buildnum=9
jfx.build.jdk.version=14
jfx.build.jdk.buildnum=36
jfx.build.jdk.version.min=11
jfx.build.jdk.buildnum.min=28

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

# Toolchains
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/linux.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if (hasProperty('toolchainDir')) {
toolchainDir = ""
}

def gtk2CCFlags = [ ];
def gtk2CCFlags = [ "-Wno-deprecated-declarations" ];
def gtk3CCFlags = [ "-Wno-deprecated-declarations" ];
def gtk2LinkFlags = [ ];
def gtk3LinkFlags = [ ];
Expand Down
2 changes: 1 addition & 1 deletion gradle/legal/gradle.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Gradle v6.0
## Gradle v6.3

### Apache 2.0 License
```
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

package com.sun.javafx.binding;

import javafx.beans.Observable;
import javafx.beans.WeakListener;
import javafx.beans.property.*;
import javafx.beans.value.ChangeListener;
Expand All @@ -35,13 +34,13 @@
import java.lang.ref.WeakReference;
import java.text.Format;
import java.text.ParseException;
import java.util.Objects;

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

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

public static Object bind(Property<String> stringProperty, Property<?> otherProperty, Format format) {
checkParameters(stringProperty, otherProperty);
if (format == null) {
throw new NullPointerException("Format cannot be null");
}
final StringConversionBidirectionalBinding<?> binding = new StringFormatBidirectionalBinding(stringProperty, otherProperty, format);
Objects.requireNonNull(format, "Format cannot be null");
final var binding = new StringFormatBidirectionalBinding(stringProperty, otherProperty, format);
stringProperty.setValue(format.format(otherProperty.getValue()));
stringProperty.addListener(binding);
otherProperty.addListener(binding);
Expand All @@ -81,10 +78,8 @@ public static Object bind(Property<String> stringProperty, Property<?> otherProp

public static <T> Object bind(Property<String> stringProperty, Property<T> otherProperty, StringConverter<T> converter) {
checkParameters(stringProperty, otherProperty);
if (converter == null) {
throw new NullPointerException("Converter cannot be null");
}
final StringConversionBidirectionalBinding<T> binding = new StringConverterBidirectionalBinding<T>(stringProperty, otherProperty, converter);
Objects.requireNonNull(converter, "Converter cannot be null");
final var binding = new StringConverterBidirectionalBinding<>(stringProperty, otherProperty, converter);
stringProperty.setValue(converter.toString(otherProperty.getValue()));
stringProperty.addListener(binding);
otherProperty.addListener(binding);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

package javafx.beans.property;

import java.util.Objects;

import com.sun.javafx.binding.BidirectionalBinding;
import javafx.beans.binding.Bindings;
import javafx.beans.value.ObservableValue;
Expand Down Expand Up @@ -133,9 +135,7 @@ public String toString() {
* @since JavaFX 8.0
*/
public static BooleanProperty booleanProperty(final Property<Boolean> property) {
if (property == null) {
throw new NullPointerException("Property cannot be null");
}
Objects.requireNonNull(property, "Property cannot be null");
return property instanceof BooleanProperty ? (BooleanProperty)property : new BooleanPropertyBase() {
{
BidirectionalBinding.bind(this, property);
Expand Down Expand Up @@ -164,7 +164,7 @@ public String getName() {
*/
@Override
public ObjectProperty<Boolean> asObject() {
return new ObjectPropertyBase<Boolean> () {
return new ObjectPropertyBase<> () {
{
BidirectionalBinding.bind(this, BooleanProperty.this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,14 @@

package javafx.beans.property;

import java.util.Objects;

import com.sun.javafx.binding.BidirectionalBinding;
import com.sun.javafx.binding.ExpressionHelper;
import com.sun.javafx.binding.Logging;

import javafx.beans.binding.Bindings;
import javafx.beans.value.ObservableValue;
import javafx.beans.value.WritableDoubleValue;
import com.sun.javafx.binding.Logging;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.WeakInvalidationListener;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableDoubleValue;

/**
* This class defines a {@link Property} wrapping a {@code double} value.
Expand Down Expand Up @@ -148,9 +145,7 @@ public String toString() {
* @since JavaFX 8.0
*/
public static DoubleProperty doubleProperty(final Property<Double> property) {
if (property == null) {
throw new NullPointerException("Property cannot be null");
}
Objects.requireNonNull(property, "Property cannot be null");
return new DoublePropertyBase() {
{
BidirectionalBinding.bindNumber(this, property);
Expand Down Expand Up @@ -189,7 +184,7 @@ public String getName() {
*/
@Override
public ObjectProperty<Double> asObject() {
return new ObjectPropertyBase<Double> () {
return new ObjectPropertyBase<> () {
{
BidirectionalBinding.bindNumber(this, DoubleProperty.this);
}
Expand All @@ -205,6 +200,4 @@ public String getName() {
}
};
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

package javafx.beans.property;

import java.util.Objects;

import com.sun.javafx.binding.BidirectionalBinding;
import javafx.beans.binding.Bindings;
import javafx.beans.value.ObservableValue;
Expand Down Expand Up @@ -142,10 +144,8 @@ public String toString() {
* @see #asObject()
* @since JavaFX 8.0
*/
public static FloatProperty floatProperty(final Property<Float> property) {
if (property == null) {
throw new NullPointerException("Property cannot be null");
}
public static FloatProperty floatProperty(final Property<Float> property) {
Objects.requireNonNull(property, "Property cannot be null");
return new FloatPropertyBase() {
{
BidirectionalBinding.bindNumber(this, property);
Expand Down Expand Up @@ -184,7 +184,7 @@ public String getName() {
*/
@Override
public ObjectProperty<Float> asObject() {
return new ObjectPropertyBase<Float> () {
return new ObjectPropertyBase<> () {
{
BidirectionalBinding.bindNumber(this, FloatProperty.this);
}
Expand All @@ -200,5 +200,4 @@ public String getName() {
}
};
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

package javafx.beans.property;

import java.util.Objects;

import com.sun.javafx.binding.BidirectionalBinding;
import javafx.beans.binding.Bindings;
import javafx.beans.value.ObservableValue;
Expand Down Expand Up @@ -142,10 +144,8 @@ public String toString() {
* @see #asObject()
* @since JavaFX 8.0
*/
public static IntegerProperty integerProperty(final Property<Integer> property) {
if (property == null) {
throw new NullPointerException("Property cannot be null");
}
public static IntegerProperty integerProperty(final Property<Integer> property) {
Objects.requireNonNull(property, "Property cannot be null");
return new IntegerPropertyBase() {
{
BidirectionalBinding.bindNumber(this, property);
Expand Down Expand Up @@ -184,7 +184,7 @@ public String getName() {
*/
@Override
public ObjectProperty<Integer> asObject() {
return new ObjectPropertyBase<Integer> () {
return new ObjectPropertyBase<> () {
{
BidirectionalBinding.bindNumber(this, IntegerProperty.this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

package javafx.beans.property;

import java.util.Objects;

import com.sun.javafx.binding.BidirectionalBinding;
import javafx.beans.binding.Bindings;
import javafx.beans.value.ObservableValue;
Expand Down Expand Up @@ -140,10 +142,8 @@ public String toString() {
* @see #asObject()
* @since JavaFX 8.0
*/
public static LongProperty longProperty(final Property<Long> property) {
if (property == null) {
throw new NullPointerException("Property cannot be null");
}
public static LongProperty longProperty(final Property<Long> property) {
Objects.requireNonNull(property, "Property cannot be null");
return new LongPropertyBase() {
{
BidirectionalBinding.bindNumber(this, property);
Expand Down Expand Up @@ -182,7 +182,7 @@ public String getName() {
*/
@Override
public ObjectProperty<Long> asObject() {
return new ObjectPropertyBase<Long> () {
return new ObjectPropertyBase<> () {
{
BidirectionalBinding.bindNumber(this, LongProperty.this);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, 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
Expand Down Expand Up @@ -146,20 +146,20 @@ public TableViewBehaviorBase(C control) {
new KeyMapping(PAGE_UP, e -> scrollUp()),
new KeyMapping(PAGE_DOWN, e -> scrollDown()),

new KeyMapping(LEFT, e -> selectLeftCell()),
new KeyMapping(KP_LEFT, e -> selectLeftCell()),
new KeyMapping(RIGHT, e -> selectRightCell()),
new KeyMapping(KP_RIGHT, e -> selectRightCell()),
new KeyMapping(LEFT, e -> { if(isRTL()) selectRightCell(); else selectLeftCell(); }),
new KeyMapping(KP_LEFT,e -> { if(isRTL()) selectRightCell(); else selectLeftCell(); }),
new KeyMapping(RIGHT, e -> { if(isRTL()) selectLeftCell(); else selectRightCell(); }),
new KeyMapping(KP_RIGHT, e -> { if(isRTL()) selectLeftCell(); else selectRightCell(); }),

new KeyMapping(UP, e -> selectPreviousRow()),
new KeyMapping(KP_UP, e -> selectPreviousRow()),
new KeyMapping(DOWN, e -> selectNextRow()),
new KeyMapping(KP_DOWN, e -> selectNextRow()),

new KeyMapping(LEFT, FocusTraversalInputMap::traverseLeft),
new KeyMapping(KP_LEFT, FocusTraversalInputMap::traverseLeft),
new KeyMapping(RIGHT, FocusTraversalInputMap::traverseRight),
new KeyMapping(KP_RIGHT, FocusTraversalInputMap::traverseRight),
new KeyMapping(LEFT, e -> { if(isRTL()) focusTraverseRight(); else focusTraverseLeft(); }),
new KeyMapping(KP_LEFT, e -> { if(isRTL()) focusTraverseRight(); else focusTraverseLeft(); }),
new KeyMapping(RIGHT, e -> { if(isRTL()) focusTraverseLeft(); else focusTraverseRight(); }),
new KeyMapping(KP_RIGHT, e -> { if(isRTL()) focusTraverseLeft(); else focusTraverseRight(); }),
new KeyMapping(UP, FocusTraversalInputMap::traverseUp),
new KeyMapping(KP_UP, FocusTraversalInputMap::traverseUp),
new KeyMapping(DOWN, FocusTraversalInputMap::traverseDown),
Expand All @@ -178,17 +178,17 @@ public TableViewBehaviorBase(C control) {
new KeyMapping(new KeyBinding(SPACE).shift(), e -> selectAllToFocus(false)),
new KeyMapping(new KeyBinding(SPACE).shortcut().shift(), e -> selectAllToFocus(true)),

new KeyMapping(new KeyBinding(LEFT).shift(), e -> alsoSelectLeftCell()),
new KeyMapping(new KeyBinding(KP_LEFT).shift(), e -> alsoSelectLeftCell()),
new KeyMapping(new KeyBinding(RIGHT).shift(), e -> alsoSelectRightCell()),
new KeyMapping(new KeyBinding(KP_RIGHT).shift(), e -> alsoSelectRightCell()),
new KeyMapping(new KeyBinding(LEFT).shift(), e -> { if(isRTL()) alsoSelectRightCell(); else alsoSelectLeftCell(); }),
new KeyMapping(new KeyBinding(KP_LEFT).shift(), e -> { if(isRTL()) alsoSelectRightCell(); else alsoSelectLeftCell(); }),
new KeyMapping(new KeyBinding(RIGHT).shift(), e -> { if(isRTL()) alsoSelectLeftCell(); else alsoSelectRightCell(); }),
new KeyMapping(new KeyBinding(KP_RIGHT).shift(), e -> { if(isRTL()) alsoSelectLeftCell(); else alsoSelectRightCell(); }),

new KeyMapping(new KeyBinding(UP).shortcut(), e -> focusPreviousRow()),
new KeyMapping(new KeyBinding(DOWN).shortcut(), e -> focusNextRow()),
new KeyMapping(new KeyBinding(RIGHT).shortcut(), e -> focusRightCell()),
new KeyMapping(new KeyBinding(KP_RIGHT).shortcut(), e -> focusRightCell()),
new KeyMapping(new KeyBinding(LEFT).shortcut(), e -> focusLeftCell()),
new KeyMapping(new KeyBinding(KP_LEFT).shortcut(), e -> focusLeftCell()),
new KeyMapping(new KeyBinding(RIGHT).shortcut(), e -> { if(isRTL()) focusLeftCell(); else focusRightCell(); }),
new KeyMapping(new KeyBinding(KP_RIGHT).shortcut(), e -> { if(isRTL()) focusLeftCell(); else focusRightCell(); }),
new KeyMapping(new KeyBinding(LEFT).shortcut(), e -> { if(isRTL()) focusRightCell(); else focusLeftCell(); }),
new KeyMapping(new KeyBinding(KP_LEFT).shortcut(), e -> { if(isRTL()) focusRightCell(); else focusLeftCell(); }),

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

new KeyMapping(new KeyBinding(UP).shortcut().shift(), e -> discontinuousSelectPreviousRow()),
new KeyMapping(new KeyBinding(DOWN).shortcut().shift(), e -> discontinuousSelectNextRow()),
new KeyMapping(new KeyBinding(LEFT).shortcut().shift(), e -> discontinuousSelectPreviousColumn()),
new KeyMapping(new KeyBinding(RIGHT).shortcut().shift(), e -> discontinuousSelectNextColumn()),
new KeyMapping(new KeyBinding(LEFT).shortcut().shift(), e -> { if(isRTL()) discontinuousSelectNextColumn(); else discontinuousSelectPreviousColumn(); }),
new KeyMapping(new KeyBinding(RIGHT).shortcut().shift(), e -> { if(isRTL()) discontinuousSelectPreviousColumn(); else discontinuousSelectNextColumn(); }),
new KeyMapping(new KeyBinding(PAGE_UP).shortcut().shift(), e -> discontinuousSelectPageUp()),
new KeyMapping(new KeyBinding(PAGE_DOWN).shortcut().shift(), e -> discontinuousSelectPageDown()),
new KeyMapping(new KeyBinding(HOME).shortcut().shift(), e -> discontinuousSelectAllToFirstRow()),
Expand Down Expand Up @@ -1309,4 +1309,12 @@ protected void discontinuousSelectAllToLastRow() {

if (onMoveToLastCell != null) onMoveToLastCell.run();
}

private EventHandler<KeyEvent> focusTraverseLeft() {
return FocusTraversalInputMap::traverseLeft;
}

private EventHandler<KeyEvent> focusTraverseRight() {
return FocusTraversalInputMap::traverseRight;
}
}
Loading

0 comments on commit d299465

Please sign in to comment.