|
8 | 8 | import java.util.Collections; |
9 | 9 | import java.util.List; |
10 | 10 | import java.util.Locale; |
| 11 | +import java.util.Objects; |
11 | 12 | import java.util.Optional; |
12 | 13 | import java.util.function.BiConsumer; |
13 | 14 | import java.util.function.BiFunction; |
@@ -392,11 +393,11 @@ public Node getParagraphGraphic( int parNdx ) { |
392 | 393 | * <br>To customize the placeholder's layout override {@link #configurePlaceholder( Node )} |
393 | 394 | */ |
394 | 395 | public final void setPlaceholder(Node value) { setPlaceholder(value,Pos.CENTER); } |
395 | | - public final void setPlaceholder(Node value, Pos where) { placeHolderProp.set(value); placeHolderPos = where; } |
| 396 | + public void setPlaceholder(Node value, Pos where) { placeHolderProp.set(value); placeHolderPos = Objects.requireNonNull(where); } |
396 | 397 | private ObjectProperty<Node> placeHolderProp = new SimpleObjectProperty<>(this, "placeHolder", null); |
397 | 398 | public final ObjectProperty<Node> placeholderProperty() { return placeHolderProp; } |
398 | 399 | public final Node getPlaceholder() { return placeHolderProp.get(); } |
399 | | - private Pos placeHolderPos; |
| 400 | + private Pos placeHolderPos = Pos.CENTER; |
400 | 401 |
|
401 | 402 | private ObjectProperty<ContextMenu> contextMenu = new SimpleObjectProperty<>(null); |
402 | 403 | @Override public final ObjectProperty<ContextMenu> contextMenuObjectProperty() { return contextMenu; } |
@@ -929,7 +930,7 @@ private void displayPlaceHolder( boolean show, Node newNode ) |
929 | 930 | */ |
930 | 931 | protected void configurePlaceholder( Node placeholder ) |
931 | 932 | { |
932 | | - positionPlaceholder = true; |
| 933 | + positionPlaceholder = true; |
933 | 934 | } |
934 | 935 |
|
935 | 936 | /* ********************************************************************** * |
@@ -1691,10 +1692,10 @@ protected void layoutChildren() { |
1691 | 1692 | }); |
1692 | 1693 |
|
1693 | 1694 | Node holder = placeholder; |
1694 | | - if (holder != null && holder.isResizable() && holder.isManaged()) { |
1695 | | - holder.autosize(); |
1696 | | - if ( positionPlaceholder ) Region.positionInArea |
1697 | | - ( |
| 1695 | + if (holder != null && holder.isManaged()) { |
| 1696 | + if (holder.isResizable()) holder.autosize(); |
| 1697 | + if (positionPlaceholder) Region.positionInArea |
| 1698 | + ( |
1698 | 1699 | holder, getLayoutX(), getLayoutY(), getWidth(), getHeight(), getBaselineOffset(), |
1699 | 1700 | ins, placeHolderPos.getHpos(), placeHolderPos.getVpos(), isSnapToPixel() |
1700 | 1701 | ); |
|
0 commit comments