Skip to content

Commit 18745c5

Browse files
committed
improved documentation
1 parent 9c40ce1 commit 18745c5

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

modules/javafx.graphics/src/main/java/javafx/scene/Node.java

+17-13
Original file line numberDiff line numberDiff line change
@@ -8526,11 +8526,11 @@ public String getName() {
85268526
* a focus request. A node that receives a focus hoisting request may decide to hoist the request even further
85278527
* up the scene graph.
85288528
* <p>
8529-
* Focus scoping is a technique employed by controls that need to isolate their internal scene graph substructure
8530-
* (for example, their skin) from their external representation. Consider a control with an internal substructure
8531-
* that contains an interactive and independently focusable control. When a user clicks on the contained interactive
8532-
* control, it is often desired that the external control representation, and not its internal components, receive
8533-
* the the input focus.
8529+
* Focus scoping is a technique employed by controls that need to isolate their internal structure (which may
8530+
* be defined by a skin) from their external representation. Consider a control with an internal structure
8531+
* that contains an interactive and independently focusable control. When a user clicks on the internal
8532+
* interactive control, it is often desired that the external representation receive the input focus, so
8533+
* that users of the control can reason about it as a monolith instead of a composite with unknown parts.
85348534
* <p>
85358535
* Focus scoping is often combined with {@link #getFocusDelegate() focus delegation}.
85368536
*
@@ -8545,17 +8545,21 @@ boolean isFocusScope() {
85458545
/**
85468546
* Gets the focus delegate for this {@code Node}, which must be a descendant of this {@code Node}.
85478547
* <p>
8548-
* Focus delegation allows nodes to delegate events targeted at them to one of their descendants. This is a
8549-
* technique employed by controls that need to isolate their internal scene graph substructure (for example,
8550-
* their skin) from their external representation. The external control representation delegates the input focus
8551-
* to an internal control by returning the internal control from the {@link #getFocusDelegate()} method. In this
8552-
* case, when the external control representation receives the input focus, the internal control is focused as
8553-
* well. Input events will be targeted at the external control first, and then at each consecutive focus delegate
8554-
* in sequence.
8548+
* Focus delegation allows nodes to delegate events targeted at them to one of their descendants. This is
8549+
* a technique employed by controls that need to isolate their internal structure (which may be defined by
8550+
* a skin) from their external representation. The external representation delegates the input focus to an
8551+
* internal control by returning the internal control from the {@link #getFocusDelegate()} method. In this
8552+
* case, when the external control receives the input focus, the internal control is focused as well. When
8553+
* an input event is sent to the focused control, the external control receives the event first. If the
8554+
* event is not consumed, it is dispatched to the focus delegate. A focus delegate might delegate the input
8555+
* focus even further, forming a chain of focus delegates.
8556+
* <p>
8557+
* If an implementation returns a node from this method that is not a descendant of this {@code Node},
8558+
* JavaFX ignores the returned value and treats this {@code Node} as having no focus delegate.
85558559
* <p>
85568560
* Focus delegation is often combined with {@link #isFocusScope() focus scoping}.
85578561
*
8558-
* @return the focus delegate
8562+
* @return the focus delegate, which is a descendant of this {@code Node}
85598563
* @since 24
85608564
*/
85618565
Node getFocusDelegate() {

modules/javafx.graphics/src/main/java/javafx/scene/Parent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1433,12 +1433,12 @@ void nodeResolvedOrientationChanged() {
14331433
}
14341434

14351435
@Override
1436-
public boolean isFocusScope() { // Overridden to make the method public
1436+
protected boolean isFocusScope() { // Overridden to make the method protected
14371437
return false;
14381438
}
14391439

14401440
@Override
1441-
public Node getFocusDelegate() { // Overridden to make the method public
1441+
protected Node getFocusDelegate() { // Overridden to make the method protected
14421442
return null;
14431443
}
14441444

0 commit comments

Comments
 (0)