Methods Summary |
---|
private boolean | accept(java.awt.Component aComponent)
if (!(aComponent.isVisible() && aComponent.isDisplayable() &&
aComponent.isFocusable() && aComponent.isEnabled())) {
return false;
}
// Verify that the Component is recursively enabled. Disabling a
// heavyweight Container disables its children, whereas disabling
// a lightweight Container does not.
if (!(aComponent instanceof Window)) {
for (Container enableTest = aComponent.getParent();
enableTest != null;
enableTest = enableTest.getParent())
{
if (!(enableTest.isEnabled() || enableTest.isLightweight())) {
return false;
}
if (enableTest instanceof Window) {
break;
}
}
}
return true;
|
public java.awt.Component | getComponentAfter(java.awt.Container focusCycleRoot, java.awt.Component aComponent)
Component hardCoded = aComponent, prevHardCoded;
HashSet sanity = new HashSet();
do {
prevHardCoded = hardCoded;
hardCoded = (Component)forwardMap.get(hardCoded);
if (hardCoded == null) {
if (delegatePolicy != null &&
prevHardCoded.isFocusCycleRoot(focusCycleRoot)) {
return delegatePolicy.getComponentAfter(focusCycleRoot,
prevHardCoded);
} else if (delegateManager != null) {
return delegateManager.
getComponentAfter(focusCycleRoot, aComponent);
} else {
return null;
}
}
if (sanity.contains(hardCoded)) {
// cycle detected; bail
return null;
}
sanity.add(hardCoded);
} while (!accept(hardCoded));
return hardCoded;
|
public java.awt.Component | getComponentBefore(java.awt.Container focusCycleRoot, java.awt.Component aComponent)
Component hardCoded = aComponent, prevHardCoded;
HashSet sanity = new HashSet();
do {
prevHardCoded = hardCoded;
hardCoded = (Component)backwardMap.get(hardCoded);
if (hardCoded == null) {
if (delegatePolicy != null &&
prevHardCoded.isFocusCycleRoot(focusCycleRoot)) {
return delegatePolicy.getComponentBefore(focusCycleRoot,
prevHardCoded);
} else if (delegateManager != null) {
return delegateManager.
getComponentBefore(focusCycleRoot, aComponent);
} else {
return null;
}
}
if (sanity.contains(hardCoded)) {
// cycle detected; bail
return null;
}
sanity.add(hardCoded);
} while (!accept(hardCoded));
return hardCoded;
|
public java.awt.Component | getDefaultComponent(java.awt.Container focusCycleRoot)
if (delegatePolicy != null) {
return delegatePolicy.getDefaultComponent(focusCycleRoot);
} else {
return getFirstComponent(focusCycleRoot);
}
|
public java.awt.Component | getFirstComponent(java.awt.Container focusCycleRoot)
if (delegatePolicy != null) {
return delegatePolicy.getFirstComponent(focusCycleRoot);
} else if (delegateManager != null) {
return delegateManager.getFirstComponent(focusCycleRoot);
} else {
return null;
}
|
public java.awt.Component | getLastComponent(java.awt.Container focusCycleRoot)
if (delegatePolicy != null) {
return delegatePolicy.getLastComponent(focusCycleRoot);
} else if (delegateManager != null) {
return delegateManager.getLastComponent(focusCycleRoot);
} else {
return null;
}
|
private void | readObject(java.io.ObjectInputStream in)
in.defaultReadObject();
delegatePolicy = (FocusTraversalPolicy)in.readObject();
delegateManager = (DefaultFocusManager)in.readObject();
|
void | setNextFocusableComponent(java.awt.Component left, java.awt.Component right)
forwardMap.put(left, right);
backwardMap.put(right, left);
|
void | unsetNextFocusableComponent(java.awt.Component left, java.awt.Component right)
forwardMap.remove(left);
backwardMap.remove(right);
|
private void | writeObject(java.io.ObjectOutputStream out)
out.defaultWriteObject();
if (delegatePolicy instanceof Serializable) {
out.writeObject(delegatePolicy);
} else {
out.writeObject(null);
}
if (delegateManager instanceof Serializable) {
out.writeObject(delegateManager);
} else {
out.writeObject(null);
}
|