public class LayoutFocusTraversalPolicy extends SortingFocusTraversalPolicy implements Serializable
ComponentOrientation
。在进行下一行之前,在一行中的所有列都是完全遍历的。
ComponentOrientation
Constructor and Description |
---|
LayoutFocusTraversalPolicy()
构建了一个layoutfocustraversalpolicy。
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(Component aComponent)
确定指定的
Component 是一个可以接受的选择,作为新的焦点所有者。
|
Component |
getComponentAfter(Container aContainer, Component aComponent)
返回后,应确定接收焦点的组件。
|
Component |
getComponentBefore(Container aContainer, Component aComponent)
返回前一接收焦点的组件。
|
Component |
getFirstComponent(Container aContainer)
返回遍历循环中的第一个组件。
|
Component |
getLastComponent(Container aContainer)
返回遍历周期中的最后一个组件。
|
getComparator, getDefaultComponent, getImplicitDownCycleTraversal, setComparator, setImplicitDownCycleTraversal
getInitialComponent
getInitialComponent
public LayoutFocusTraversalPolicy()
public Component getComponentAfter(Container aContainer, Component aComponent)
默认情况下,LayoutFocusTraversalPolicy暗中转移焦点下周期。也就是说,在正常的焦点遍历,组件遍历一个聚焦周期后的根将是焦点周期根的默认组件为焦点。这种行为可以被禁用,以setImplicitDownCycleTraversal
方法。
如果容器是focus traversal policy provider,焦点总是向下传递周期。
getComponentAfter
方法重写,继承类
SortingFocusTraversalPolicy
aContainer
-一个部件或一个焦点遍历策略提供者焦点循环根
aComponent
-(可能是间接的)容器或容器本身的孩子,
IllegalArgumentException
如果容器不是一个部件或一个焦点遍历策略提供者焦点循环根,或者一个容器或一个是空的
public Component getComponentBefore(Container aContainer, Component aComponent)
默认情况下,LayoutFocusTraversalPolicy暗中转移焦点下周期。也就是说,在正常的焦点遍历,组件遍历一个聚焦周期后的根将是焦点周期根的默认组件为焦点。这种行为可以被禁用,以setImplicitDownCycleTraversal
方法。
如果容器是focus traversal policy provider,焦点总是向下传递周期。
getComponentBefore
方法重写,继承类
SortingFocusTraversalPolicy
aContainer
-一个部件或一个焦点遍历策略提供者焦点循环根
aComponent
-(可能是间接的)容器或容器本身的孩子,
IllegalArgumentException
如果容器不是一个部件或一个焦点遍历策略提供者焦点循环根,或者一个容器或一个是空的
public Component getFirstComponent(Container aContainer)
getFirstComponent
方法重写,继承类
SortingFocusTraversalPolicy
aContainer
-一个部件或一个焦点遍历策略提供者的第一个组件是被返回的焦点循环根
IllegalArgumentException
如果容器为空
public Component getLastComponent(Container aContainer)
getLastComponent
方法重写,继承类
SortingFocusTraversalPolicy
aContainer
-一个部件或一个焦点遍历策略供应商的最后一部分是被返回的焦点循环根
IllegalArgumentException
如果容器为空
protected boolean accept(Component aComponent)
Component
是一个可以接受的选择,作为新的焦点所有者。此方法执行以下操作程序:
aComponent
是可见的,可显示,启用,并可。如果任何这些属性是false
,此方法返回false
。aComponent
是JTable
实例,返回true
。aComponent
是JComboBox
实例,然后返回aComponent.getUI().isFocusTraversable(aComponent)
价值。aComponent
是一个JComponent.WHEN_FOCUSED
InputMap
既不null
也空JComponent
,返回true
。DefaultFocusTraversalPolicy.accept(aComponent)
。accept
方法重写,继承类
SortingFocusTraversalPolicy
aComponent
-
Component
其健身作为焦点所有者进行测试
true
如果
aComponent
是焦点所有者的有效选择;否则
false
Component.isVisible()
,
Component.isDisplayable()
,
Component.isEnabled()
,
Component.isFocusable()
,
ComboBoxUI.isFocusTraversable(javax.swing.JComboBox)
,
JComponent.getInputMap(int)
,
DefaultFocusTraversalPolicy.accept(java.awt.Component)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.