java.awt.FocusTraversalPolicy Java Examples
The following examples show how to use
java.awt.FocusTraversalPolicy.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultFocusManager.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #2
Source File: DefaultFocusManager.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
public Component getFirstComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getFirstComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getFirstComponent(root); } return null; }
Example #3
Source File: DefaultFocusManager.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #4
Source File: DefaultFocusManager.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public Component getLastComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getLastComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getLastComponent(root); } return null; }
Example #5
Source File: DefaultFocusManager.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public Component getLastComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getLastComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getLastComponent(root); } return null; }
Example #6
Source File: DefaultFocusManager.java From JDKSourceCode1.8 with MIT License | 6 votes |
public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #7
Source File: DefaultFocusManager.java From JDKSourceCode1.8 with MIT License | 6 votes |
public Component getComponentBefore(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentBefore(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentBefore(root, aComponent); } return null; }
Example #8
Source File: DefaultFocusManager.java From JDKSourceCode1.8 with MIT License | 6 votes |
public Component getFirstComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getFirstComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getFirstComponent(root); } return null; }
Example #9
Source File: DefaultFocusManager.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public Component getLastComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getLastComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getLastComponent(root); } return null; }
Example #10
Source File: DefaultFocusManager.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public Component getComponentBefore(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentBefore(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentBefore(root, aComponent); } return null; }
Example #11
Source File: DefaultFocusManager.java From Java8CN with Apache License 2.0 | 6 votes |
public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #12
Source File: DefaultFocusManager.java From hottub with GNU General Public License v2.0 | 6 votes |
public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #13
Source File: DefaultFocusManager.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #14
Source File: DefaultFocusManager.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #15
Source File: NodeOperationImpl.java From netbeans with Apache License 2.0 | 6 votes |
/** Opens a modal propertySheet on given set of Nodes * @param n the array of nodes to show properties for */ public void showProperties (Node[] nodes) { Dialog d = findCachedPropertiesDialog( nodes ); if( null == d ) { openProperties(new NbSheet(), nodes); } else { d.setVisible( true ); //#131724 - PropertySheet clears its Nodes in removeNotify and keeps //only a weakref which is being reused in subsequent addNotify //so we should set the Nodes again in case the weakref got garbage collected //pls note that PropertySheet code checks for redundant calls of setNodes NbSheet sheet = findCachedSheet( d ); if( null != sheet ) sheet.setNodes(nodes); d.toFront(); FocusTraversalPolicy ftp = d.getFocusTraversalPolicy(); if( null != ftp && null != ftp.getDefaultComponent(d) ) { ftp.getDefaultComponent(d).requestFocusInWindow(); } else { d.requestFocusInWindow(); } } }
Example #16
Source File: DefaultFocusManager.java From Java8CN with Apache License 2.0 | 6 votes |
public Component getComponentBefore(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentBefore(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentBefore(root, aComponent); } return null; }
Example #17
Source File: DefaultFocusManager.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #18
Source File: DefaultFocusManager.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public Component getComponentBefore(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentBefore(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentBefore(root, aComponent); } return null; }
Example #19
Source File: DefaultFocusManager.java From hottub with GNU General Public License v2.0 | 6 votes |
public Component getLastComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getLastComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getLastComponent(root); } return null; }
Example #20
Source File: DefaultFocusManager.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public Component getLastComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getLastComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getLastComponent(root); } return null; }
Example #21
Source File: LegacyGlueFocusTraversalPolicy.java From Bytecoder with Apache License 2.0 | 6 votes |
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { ObjectInputStream.GetField f = in.readFields(); @SuppressWarnings("unchecked") HashMap<Component, Component> newForwardMap = (HashMap<Component, Component> ) f.get("forwardMap", null); if (newForwardMap == null) { throw new InvalidObjectException("Null forwardMap"); } forwardMap = newForwardMap; @SuppressWarnings("unchecked") HashMap<Component, Component> newBackwardMap = (HashMap<Component, Component>) f.get("backwardMap", null); if (newBackwardMap == null) { throw new InvalidObjectException("Null backwardMap"); } backwardMap = newBackwardMap; delegatePolicy = (FocusTraversalPolicy)in.readObject(); delegateManager = (DefaultFocusManager)in.readObject(); }
Example #22
Source File: DefaultFocusManager.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * Returns the component after. * @return the component after * @param aContainer a container * @param aComponent a component */ public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #23
Source File: DefaultFocusManager.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * Returns the component before. * @return the component before * @param aContainer a container * @param aComponent a component */ public Component getComponentBefore(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentBefore(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentBefore(root, aComponent); } return null; }
Example #24
Source File: DefaultFocusManager.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * Returns the first component. * @return the first component * @param aContainer a container */ public Component getFirstComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getFirstComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getFirstComponent(root); } return null; }
Example #25
Source File: DefaultFocusManager.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * Returns the last component. * @return the last component * @param aContainer a container */ public Component getLastComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getLastComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getLastComponent(root); } return null; }
Example #26
Source File: DefaultFocusManager.java From Java8CN with Apache License 2.0 | 6 votes |
public Component getFirstComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getFirstComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getFirstComponent(root); } return null; }
Example #27
Source File: DefaultFocusManager.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Returns the first component. * @return the first component * @param aContainer a container */ public Component getFirstComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getFirstComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getFirstComponent(root); } return null; }
Example #28
Source File: DefaultFocusManager.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public Component getComponentBefore(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentBefore(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentBefore(root, aComponent); } return null; }
Example #29
Source File: DefaultFocusManager.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public Component getComponentAfter(Container aContainer, Component aComponent) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getComponentAfter(root, aComponent); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getComponentAfter(root, aComponent); } return null; }
Example #30
Source File: DefaultFocusManager.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public Component getFirstComponent(Container aContainer) { Container root = (aContainer.isFocusCycleRoot()) ? aContainer : aContainer.getFocusCycleRootAncestor(); // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's // traversal policy is non-legacy, then honor it. if (root != null) { FocusTraversalPolicy policy = root.getFocusTraversalPolicy(); if (policy != gluePolicy) { return policy.getFirstComponent(root); } comparator.setComponentOrientation(root.getComponentOrientation()); return layoutPolicy.getFirstComponent(root); } return null; }