openjfx/8/master/rt: 97d1312344e8 (original) (raw)
OpenJDK / openjfx / 8 / master / rt
changeset 1817:97d1312344e8 8.0-b61
Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/MASTER/rt
leifs | |
---|---|
date | Tue, 16 Oct 2012 13:34:08 -0700 |
parents | a49900764c1d c731a926c171 |
children | dafaa830d4d0 d811a42d75ba |
files | |
diffstat | 10 files changed, 155 insertions(+), 70 deletions(-)[+] [-] javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java 43 javafx-ui-common/src/com/sun/javafx/scene/KeyboardShortcutsHandler.java 59 javafx-ui-common/src/javafx/scene/Parent.java 40 javafx-ui-common/src/javafx/scene/Scene.java 2 javafx-ui-common/src/javafx/scene/doc-files/cssref.html 2 javafx-ui-common/src/javafx/scene/layout/Background.java 2 javafx-ui-common/src/javafx/scene/layout/CornerRadii.java 35 javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVK.java 2 javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java 36 javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/caspian.css 4 |
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java Tue Oct 16 13:34:08 2012 -0700 @@ -44,6 +44,8 @@ import com.sun.javafx.css.converters.FontConverter; import com.sun.javafx.css.parser.CSSParser; import com.sun.javafx.logging.PlatformLogger; +import javafx.beans.property.ObjectProperty; +import javafx.beans.property.SimpleObjectProperty; import javafx.scene.Parent; /** @@ -862,11 +864,7 @@ calculatedValue = lookup(node, styleable, isUserSet, getPseudoClassState(), inlineStyles, node, cacheEntry, styleList);
if (fastpath) {[](#l1.16)
// if userStyles is null and calculatedValue was null,[](#l1.17)
// then the calculatedValue didn't come from the cache[](#l1.18)
cacheEntry.put(property, calculatedValue);[](#l1.19)
}[](#l1.20)
cacheEntry.put(property, calculatedValue);[](#l1.21)
} @@ -1224,9 +1222,9 @@ * Find the property among the styles that pertain to the Node */ private CascadingStyle resolveRef(Node node, String property, long states,
Map<String,CascadingStyle> userStyles) {[](#l1.29)
Map<String,CascadingStyle> inlineStyles) {[](#l1.30) [](#l1.31)
final CascadingStyle style = getStyle(node, property, states, userStyles);[](#l1.32)
final CascadingStyle style = getStyle(node, property, states, inlineStyles);[](#l1.33) if (style != null) {[](#l1.34) return style;[](#l1.35) } else {[](#l1.36)
@@ -1235,7 +1233,7 @@ if (states > 0) { // if states > 0, then we need to check this node again, // but without any states.
return resolveRef(node,property,0,userStyles);[](#l1.41)
return resolveRef(node,property,0,inlineStyles);[](#l1.42) } else {[](#l1.43) // TODO: This block was copied from inherit. Both should use same code somehow.[](#l1.44) Node parent = node.getParent();[](#l1.45)
@@ -1262,7 +1260,8 @@ Node node, ParsedValue value, long states,
Map<String,CascadingStyle> userStyles, [](#l1.50)
Map<String,CascadingStyle> inlineStyles,[](#l1.51)
ObjectProperty<Origin> whence,[](#l1.52) List<Style> styleList) {[](#l1.53) [](#l1.54) [](#l1.55)
@@ -1279,7 +1278,7 @@ final String sval = (String)val; CascadingStyle resolved =
resolveRef(node, sval, states, userStyles);[](#l1.60)
resolveRef(node, sval, states, inlineStyles);[](#l1.61)
if (resolved != null) { @@ -1290,10 +1289,22 @@ } }
// The origin of this parsed value is the greatest of [](#l1.69)
// any of the resolved reference. If a resolved reference[](#l1.70)
// comes from an inline style, for example, then the value[](#l1.71)
// calculated from the resolved lookup should have inline[](#l1.72)
// as its origin. Otherwise, an inline style could be [](#l1.73)
// stored in shared cache.[](#l1.74)
final Origin wOrigin = whence.get();[](#l1.75)
final Origin rOrigin = resolved.getOrigin();[](#l1.76)
if (rOrigin != null && (wOrigin == null || wOrigin.compareTo(rOrigin) < 0)) {[](#l1.77)
whence.set(rOrigin);[](#l1.78)
} [](#l1.79)
[](#l1.80) // the resolved value may itself need to be resolved.[](#l1.81) // For example, if the value "color" resolves to "base",[](#l1.82) // then "base" will need to be resolved as well.[](#l1.83)
return resolveLookups(node, resolved.getParsedValue(), states, userStyles, styleList);[](#l1.84)
return resolveLookups(node, resolved.getParsedValue(), states, inlineStyles, whence, styleList);[](#l1.85) }[](#l1.86) }[](#l1.87) }[](#l1.88)
@@ -1311,7 +1322,7 @@ for (int ll=0; ll<layers[l].length; ll++) { if (layers[l][ll] == null) continue; layers[l][ll].resolved =
resolveLookups(node, layers[l][ll], states, userStyles, styleList);[](#l1.93)
resolveLookups(node, layers[l][ll], states, inlineStyles, whence, styleList);[](#l1.94) }[](#l1.95) }[](#l1.96)
@@ -1321,7 +1332,7 @@ for (int l=0; l<layer.length; l++) { if (layer[l] == null) continue; layer[l].resolved =
resolveLookups(node, layer[l], states, userStyles, styleList);[](#l1.102)
resolveLookups(node, layer[l], states, inlineStyles, whence, styleList);[](#l1.103) }[](#l1.104) }[](#l1.105)
@@ -1414,6 +1425,7 @@ return sbuf.toString(); }
@@ -1427,8 +1439,9 @@ final ParsedValue cssValue = style.getParsedValue(); if (cssValue != null && !("null").equals(cssValue.getValue())) {
ObjectProperty<Origin> whence = new SimpleObjectProperty<Origin>(style.getOrigin());[](#l1.119) final ParsedValue resolved = [](#l1.120)
resolveLookups(node, cssValue, states, inlineStyles, styleList);[](#l1.121)
resolveLookups(node, cssValue, states, inlineStyles, whence, styleList);[](#l1.122) [](#l1.123) try {[](#l1.124) // The computed value[](#l1.125)
@@ -1519,7 +1532,7 @@ else val = styleable.getConverter().convert(resolved, font);
final Origin origin = style.getOrigin();[](#l1.130)
final Origin origin = whence.get();[](#l1.131) return new CalculatedValue(val, origin, resolved.isNeedsFont());[](#l1.132) [](#l1.133) } catch (ClassCastException cce) {[](#l1.134)
--- a/javafx-ui-common/src/com/sun/javafx/scene/KeyboardShortcutsHandler.java Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-common/src/com/sun/javafx/scene/KeyboardShortcutsHandler.java Tue Oct 16 13:34:08 2012 -0700 @@ -44,6 +44,13 @@ import com.sun.javafx.collections.ObservableListWrapper; import com.sun.javafx.collections.ObservableMapWrapper; import com.sun.javafx.event.BasicEventDispatcher; +import com.sun.javafx.scene.traversal.Direction; + +import static javafx.scene.input.KeyCode.DOWN; +import static javafx.scene.input.KeyCode.LEFT; +import static javafx.scene.input.KeyCode.RIGHT; +import static javafx.scene.input.KeyCode.TAB; +import static javafx.scene.input.KeyCode.UP; public final class KeyboardShortcutsHandler extends BasicEventDispatcher { private ObservableMap<KeyCombination, Runnable> accelerators; @@ -93,14 +100,58 @@ return accelerators; }
- public void processTraversal(Event event) {
if (event instanceof KeyEvent && event.getEventType() == KeyEvent.KEY_PRESSED) {[](#l2.26)
if (!((KeyEvent)event).isMetaDown() && !((KeyEvent)event).isControlDown() && !((KeyEvent)event).isAltDown()) {[](#l2.27)
Object obj = event.getTarget();[](#l2.28)
if (obj instanceof Node) {[](#l2.29)
[](#l2.30)
switch (((KeyEvent)event).getCode()) {[](#l2.31)
case TAB :[](#l2.32)
if (((KeyEvent)event).isShiftDown()) {[](#l2.33)
traverse(((Node)obj), com.sun.javafx.scene.traversal.Direction.PREVIOUS);[](#l2.34)
}[](#l2.35)
else {[](#l2.36)
traverse(((Node)obj), com.sun.javafx.scene.traversal.Direction.NEXT);[](#l2.37)
}[](#l2.38)
event.consume();[](#l2.39)
break;[](#l2.40)
case UP :[](#l2.41)
traverse(((Node)obj), com.sun.javafx.scene.traversal.Direction.UP);[](#l2.42)
event.consume();[](#l2.43)
break;[](#l2.44)
case DOWN :[](#l2.45)
traverse(((Node)obj), com.sun.javafx.scene.traversal.Direction.DOWN);[](#l2.46)
event.consume();[](#l2.47)
break;[](#l2.48)
case LEFT :[](#l2.49)
traverse(((Node)obj), com.sun.javafx.scene.traversal.Direction.LEFT);[](#l2.50)
event.consume();[](#l2.51)
break;[](#l2.52)
case RIGHT :[](#l2.53)
traverse(((Node)obj), com.sun.javafx.scene.traversal.Direction.RIGHT);[](#l2.54)
event.consume();[](#l2.55)
break;[](#l2.56)
default :[](#l2.57)
break;[](#l2.58)
}[](#l2.59)
}[](#l2.60)
}[](#l2.61)
}[](#l2.62)
- }
+ @Override public Event dispatchBubblingEvent(Event event) { /* ** If the key event hasn't been consumed then ** we will process global events in the order :
** . Navigation, -> handled by the traversalEngine[](#l2.70) ** . Mnemonics,[](#l2.71)
** . Accelerators.[](#l2.72)
** . Accelerators,[](#l2.73)
** . Navigation.[](#l2.74) ** This processing is extra to that of listeners and[](#l2.75) ** the focus Node.[](#l2.76) */[](#l2.77)
@@ -118,6 +169,10 @@ if (!event.isConsumed()) { processAccelerators((KeyEvent)event); } +
if (!event.isConsumed()) {[](#l2.83)
processTraversal(event);[](#l2.84)
}[](#l2.85) }[](#l2.86)
--- a/javafx-ui-common/src/javafx/scene/Parent.java Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-common/src/javafx/scene/Parent.java Tue Oct 16 13:34:08 2012 -0700 @@ -1115,28 +1115,28 @@ styleManager = null;
final boolean hasStylesheets = (getStylesheets().isEmpty() == false);[](#l3.7)
[](#l3.8)
if (hasStylesheets) {[](#l3.9)
final Scene scene = getScene();[](#l3.10)
if (scene == null) return null;[](#l3.11)
// This Parent's styleManager will chain to the styleManager of [](#l3.13)
// one of its ancestors, or to the scene styleManager.[](#l3.14)
StyleManager parentStyleManager = null;[](#l3.15)
Parent parent = getParent();[](#l3.16)
while (parent != null && [](#l3.17)
(parentStyleManager = parent.getStyleManager()) == null) {[](#l3.18)
parent = parent.getParent();[](#l3.19)
}[](#l3.20)
// This Parent's styleManager will chain to the styleManager of [](#l3.21)
// one of its ancestors, or to the scene styleManager.[](#l3.22)
StyleManager parentStyleManager = null;[](#l3.23)
Parent parent = getParent();[](#l3.24)
while (parent != null && parentStyleManager == null) {[](#l3.25)
parentStyleManager = parent.getStyleManager();[](#l3.26)
parent = parent.getParent();[](#l3.27)
}[](#l3.28)
[](#l3.29)
if (parentStyleManager == null) parentStyleManager = scene.styleManager;[](#l3.30)
[](#l3.31)
if (getStylesheets().isEmpty() == false) {[](#l3.32) [](#l3.33)
if (parentStyleManager != null) {[](#l3.34)
styleManager = [](#l3.35)
StyleManager.createStyleManager(Parent.this, parentStyleManager);[](#l3.36)
} else {[](#l3.37)
final Scene scene = getScene();[](#l3.38)
if (scene != null) {[](#l3.39)
StyleManager.createStyleManager(Parent.this, scene.styleManager);[](#l3.40)
}[](#l3.41)
} [](#l3.42)
styleManager = [](#l3.43)
StyleManager.createStyleManager(Parent.this, parentStyleManager);[](#l3.44)
[](#l3.45)
} else {[](#l3.46)
[](#l3.47)
styleManager = parentStyleManager; [](#l3.48) [](#l3.49) }[](#l3.50) return styleManager;[](#l3.51)
--- a/javafx-ui-common/src/javafx/scene/Scene.java Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-common/src/javafx/scene/Scene.java Tue Oct 16 13:34:08 2012 -0700 @@ -1840,6 +1840,8 @@ * on this scene. */ void registerTraversable(Node n) {
initializeInternalEventDispatcher();[](#l4.7)
+ final TraversalEngine te = lookupTraversalEngine(n); if (te != null) { if (traversalRegistry == null) {
--- a/javafx-ui-common/src/javafx/scene/doc-files/cssref.html Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-common/src/javafx/scene/doc-files/cssref.html Tue Oct 16 13:34:08 2012 -0700 @@ -2153,9 +2153,9 @@
- background fills
- background images
<li>contents</li>[](#l5.7) <li>border strokes</li>[](#l5.8) <li>border images</li>[](#l5.9)
<li>contents</li>[](#l5.10)
The background and border mechanisms are patterned after the CSS 3 draft[](#l5.12) backgrounds and borders module. See [4] for a[](#l5.13)
--- a/javafx-ui-common/src/javafx/scene/layout/Background.java Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-common/src/javafx/scene/layout/Background.java Tue Oct 16 13:34:08 2012 -0700 @@ -69,7 +69,7 @@ static final StyleableProperty<Node,Paint[]> BACKGROUND_COLOR = new SubStyleableProperty<Paint[]>("-fx-background-color", PaintConverter.SequenceConverter.getInstance(),
new Paint[] {Color.BLACK});[](#l6.7)
new Paint[] {Color.TRANSPARENT});[](#l6.8)
static final StyleableProperty<Node,Insets[]> BACKGROUND_RADIUS = new SubStyleableProperty<Insets[]>("-fx-background-radius",
--- a/javafx-ui-common/src/javafx/scene/layout/CornerRadii.java Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-common/src/javafx/scene/layout/CornerRadii.java Tue Oct 16 13:34:08 2012 -0700 @@ -371,4 +371,39 @@ @Override public int hashCode() { return hash; } +
- @Override public String toString() {
if (isUniform()) {[](#l7.9)
return "CornerRadii [uniform radius = " + topLeftHorizontalRadius + "]";[](#l7.10)
}[](#l7.11)
return "CornerRadii [" +[](#l7.13)
(topLeftHorizontalRadius == topLeftVerticalRadius ?[](#l7.14)
"topLeft=" + topLeftHorizontalRadius :[](#l7.15)
"topLeftHorizontalRadius=" + topLeftHorizontalRadius +[](#l7.16)
", topLeftVerticalRadius=" + topLeftVerticalRadius) +[](#l7.17)
(topRightHorizontalRadius == topRightVerticalRadius ?[](#l7.18)
", topRight=" + topRightHorizontalRadius :[](#l7.19)
", topRightVerticalRadius=" + topRightVerticalRadius +[](#l7.20)
", topRightHorizontalRadius=" + topRightHorizontalRadius) +[](#l7.21)
(bottomRightHorizontalRadius == bottomRightVerticalRadius ?[](#l7.22)
", bottomRight=" + bottomRightHorizontalRadius :[](#l7.23)
", bottomRightHorizontalRadius=" + bottomRightHorizontalRadius +[](#l7.24)
", bottomRightVerticalRadius=" + bottomRightVerticalRadius) +[](#l7.25)
(bottomLeftHorizontalRadius == bottomLeftVerticalRadius ?[](#l7.26)
", bottomLeft=" + bottomLeftHorizontalRadius :[](#l7.27)
", bottomLeftVerticalRadius=" + bottomLeftVerticalRadius +[](#l7.28)
", bottomLeftHorizontalRadius=" + bottomLeftHorizontalRadius) +[](#l7.29)
+// ", topLeftHorizontalRadiusAsPercentage=" + topLeftHorizontalRadiusAsPercentage + +// ", topLeftVerticalRadiusAsPercentage=" + topLeftVerticalRadiusAsPercentage + +// ", topRightVerticalRadiusAsPercentage=" + topRightVerticalRadiusAsPercentage + +// ", topRightHorizontalRadiusAsPercentage=" + topRightHorizontalRadiusAsPercentage + +// ", bottomRightHorizontalRadiusAsPercentage=" + bottomRightHorizontalRadiusAsPercentage + +// ", bottomRightVerticalRadiusAsPercentage=" + bottomRightVerticalRadiusAsPercentage + +// ", bottomLeftVerticalRadiusAsPercentage=" + bottomLeftVerticalRadiusAsPercentage + +// ", bottomLeftHorizontalRadiusAsPercentage=" + bottomLeftHorizontalRadiusAsPercentage + +// ", hasPercentBasedRadii=" + hasPercentBasedRadii + +// ", uniform=" + uniform +
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVK.java Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVK.java Tue Oct 16 13:34:08 2012 -0700 @@ -51,7 +51,7 @@ public class FXVK extends Control {
- final static String[] VK_TYPE_NAMES = new String[] { "text", "numeric", "url", "email" }; public final static String VK_TYPE_PROP_KEY = "vkType"; String[] chars;
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java Tue Oct 16 13:34:08 2012 -0700 @@ -29,24 +29,19 @@ import javafx.beans.value.ObservableValue; import javafx.collections.ListChangeListener; import javafx.event.ActionEvent; +import javafx.event.Event; import javafx.event.EventHandler; -import javafx.geometry.HPos; import javafx.geometry.Insets; -import javafx.geometry.VPos; import javafx.scene.Scene; import javafx.scene.control.ContextMenu; +import javafx.scene.control.Menu; import javafx.scene.control.MenuButton; import javafx.scene.control.MenuItem; import javafx.scene.control.SkinBase; import javafx.scene.input.MouseEvent; +import javafx.scene.layout.Region; import javafx.scene.layout.StackPane; - import com.sun.javafx.scene.control.behavior.MenuButtonBehaviorBase; -import javafx.event.Event; -import javafx.event.Event; -import javafx.event.EventType; -import javafx.scene.control.Menu; -import javafx.scene.layout.Region; /**
- Base class for MenuButtonSkin and SplitMenuButtonSkin. It consists of the @@ -239,20 +234,16 @@ @Override protected double computePrefWidth(double height) { final Insets padding = getInsets();
final Insets arrowButtonPadding = arrowButton.getInsets();[](#l9.35) return padding.getLeft()[](#l9.36) + label.prefWidth(height)[](#l9.37)
+ arrowButtonPadding.getLeft()[](#l9.38)
+ arrow.prefWidth(height)[](#l9.39)
+ arrowButtonPadding.getRight()[](#l9.40)
} @Override protected double computePrefHeight(double width) { final Insets padding = getInsets();+ snapSize(arrowButton.prefWidth(height))[](#l9.41) + padding.getRight();[](#l9.42)
final Insets arrowButtonPadding = arrowButton.getInsets();[](#l9.47) return padding.getTop()[](#l9.48)
+ Math.max(label.prefHeight(width), arrowButtonPadding.getTop() + arrow.prefHeight(-1) + arrowButtonPadding.getBottom())[](#l9.49)
} @@ -265,21 +256,10 @@ } @Override protected void layoutChildren(final double x, final double y,+ Math.max(label.prefHeight(width), snapSize(arrowButton.prefHeight(-1)))[](#l9.50) + padding.getBottom();[](#l9.51)
final double w, final double h) {[](#l9.58)
final Insets padding = getInsets();[](#l9.59)
final Insets arrowButtonPadding = arrowButton.getInsets();[](#l9.60)
final double arrowWidth = arrow.prefWidth(-1);[](#l9.62)
final double arrowButtonWidth = arrowButtonPadding.getLeft() + arrowWidth + arrowButtonPadding.getRight();[](#l9.63)
final double w, final double h) {[](#l9.65)
final double arrowButtonWidth = snapSize(arrowButton.prefWidth(-1));[](#l9.66) label.resizeRelocate(x, y, w - arrowButtonWidth, h);[](#l9.67)
arrowButton.resize(arrowButtonWidth, h);[](#l9.69)
positionInArea(arrowButton, getWidth() - padding.getRight() - arrowButtonWidth, y, arrowButtonWidth, h,[](#l9.70)
/*baseline ignored*/0, HPos.CENTER, VPos.CENTER);[](#l9.71)
// size popup to its pref size[](#l9.73)
} private void addAccelerators(javafx.collections.ObservableList<javafx.scene.control.MenuItem> mItems) {arrowButton.resizeRelocate(x+(w-arrowButtonWidth), y, arrowButtonWidth, h);[](#l9.75)
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/caspian.css Tue Oct 16 09:40:28 2012 -0700 +++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/caspian/caspian.css Tue Oct 16 13:34:08 2012 -0700 @@ -1834,7 +1834,7 @@ /* The SplitMenuButton skin uses an inner Label part */ .split-menu-button > .label { -fx-background-color: -fx-outer-border, -fx-inner-border, -fx-body-color;
- -fx-background-insets: 0, 1 0 1 1, 2 1 2 2; -fx-background-radius: 5 0 0 5, 4 0 0 4, 3 0 0 3; -fx-padding: 0.166667em 1.5em 0.25em 0.833333em; /* 2 18 3 10 */ }
@@ -1850,7 +1850,7 @@ -fx-color: -fx-hover-base; } -.split-menu-button > .arrow-button:armed { +.split-menu-button > .arrow-button:pressed { -fx-color: -fx-pressed-base; }